update into a different folder?

Mads Kiilerich mads at kiilerich.com
Mon Aug 1 13:30:45 UTC 2011


On 08/01/2011 12:06 PM, Jack Beauregard wrote:
> Hello all,
>
> can I running hg update into a different folder?
>
> Currenty I do this:
> $ cd /a
> $ hg clone... a
> # now I have /a/a/.hg
> # I have to run hg update now.
> # Now I have in /a/a/ the .hg folder and some project folders
> # But I'd like to update in this way that I get this structure: /a/
> a/.hg and /a/a/myProject/some project folders
>
> I did mkdir myProject in /a/a/, cd myProject, hg update, but it still
> creates the project folders in /a/a/.
>
> Is it possible?

I'm not sure exactly what you are asking, but:

Mercurial keeps things simple and has a very simple 1-to-1 relation 
between the location of the .hg directory (with the repository metadata) 
and the working directory (where your files are checked out with 'hg 
update'): They are always the same.

Perhaps you wanted to do:
   cd /a/a
   hg clone ... myProject

Mercurial working directories will always look the same. There is no way 
to check out only one subdirectory or remap the directory layout, so you 
have to create your repository layout correctly - and then you will have 
the benefit of everything looking the same way everywhere. You can move 
directories with 'hg mv' or you can convert your repository and change 
locations (see 'hg help convert').

Subrepositories could perhaps also do what you are asking for, but it is 
an advanced feature that most likely will cause trouble if you are new 
to Mercurial.

/Mads



More information about the Mercurial mailing list