[PATCH] clone: update to tip instead of default branch if default branch is closed

Matt Mackall mpm at selenic.com
Mon Jun 13 12:38:21 CDT 2011


On Mon, 2011-06-13 at 18:48 +0200, Jesse Long wrote:
> On 13/06/2011 17:40, Matt Mackall wrote:
> > On Mon, 2011-06-13 at 11:28 +0200, Jesse Long wrote:
> >> # HG changeset patch
> >> # User Jesse Long<jpl at unknown.za.net>
> >> # Date 1307956824 -7200
> >> # Node ID 755a851bd451266de6b546833a9de1bc4490819e
> >> # Parent  17c0cb1045e549d9bbbd9ba25dee18f7df4a11a3
> >> clone: update to tip instead of default branch if default branch is closed
> >> Previously, if no explicit update revision is provided when cloning, hg
> >> updates the newly cloned repo to the tip-most head of the default branch
> >> if the default branch exists. If no default branch exists, hg updates to
> >> tip.
> > No thanks. Not having a default branch is a bad idea. Taking this patch
> > would suggest to people that it was supported usage.
> >
> 
> No problem - I had to try :-)
> 
> BTW, my patch does not introduce the behavior that suggests that no 
> default branch is acceptable. That behavior is currently in place. I am 
> just skipping the default branch if it exists, but is closed.
> 
> Also, I do use Mercurial without a default branch all the time. Would 
> you mind sending me a link to some text explaining why a lack of a 
> default branch is bad (apart from a little extra typing)?

It's right here! Not having a default branch means you get a random
named branch checked out on new clones based solely on which branch was
committed to last. 

The 'tip' fallback is there to avoid the extra-pathological behavior of
getting no checkout at all (ie the null revision) if you have managed to
create a repo with no commits on the default branch. But it's definitely
not an endorsement.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list