named branches are really confusing

Aurelien Jacobs aurel at gnuage.org
Fri Dec 21 14:09:49 CST 2007


Neal Becker wrote:

> In my repo I have:
> hg branches
> pi4                            333:8b803d69d900
> default                        324:7ad94909abfe (inactive)
> nosplit                        179:1fb87f703baf (inactive)
> 
> hg id
> 8b803d69d900+ (pi4) tip
> 
> Now I clone it, using hg clone with no options.
> 
> The new clone:
> hg branches
> pi4                            333:8b803d69d900
> default                        324:7ad94909abfe (inactive)
> nosplit                        179:1fb87f703baf (inactive)
> 
> hg id
> 7ad94909abfe
> 
> I find this really confusing, and a real invitation to error.  I had
> forgotten about the branches, and I expected the clone to be, well, a
> clone.  Surprise, surpise!

This has nothing to do with branches !

Just an example in my repo which has no branche:
$ hg id
4df52d676bb2 tip
$ hg checkout bfc56059040a
$ hg id
bfc56059040a

Then if I clone this repo:
$ hg id
4df52d676bb2 tip

Well, this simply shows that the revision of the working directory is
not part of the repository itself. Clone is only about the
repository, not about the working directory.
Maybe you should use hg clone -U if you don't want it to checkout
the head of default branch.

Aurel


More information about the Mercurial-devel mailing list