named branches are really confusing

Matt Mackall mpm at selenic.com
Fri Dec 21 14:43:08 CST 2007


On Fri, 2007-12-21 at 21:09 +0100, Aurelien Jacobs wrote:
> 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.

The surprise is perhaps that the branch checked out by default is, well,
"default".

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list