[PATCH 2 of 2] branch: make it possible to gently (without force) revive an ancestor branch

Mads Kiilerich mads at kiilerich.com
Sat Aug 30 10:40:04 CDT 2014


On 08/30/2014 03:50 PM, Matt Mackall wrote:
> On Fri, 2014-08-29 at 12:22 +0200, Mads Kiilerich wrote:
>> # HG changeset patch
>> # User Mads Kiilerich <madski at unity3d.com>
>> # Date 1408124612 -7200
>> #      Fri Aug 15 19:43:32 2014 +0200
>> # Node ID 07b14258740026ef01bcf754da382c22e71b1d7c
>> # Parent  104cfce5efd2e557801dd45dba6e35b056b8f3d2
>> branch: make it possible to gently (without force) revive an ancestor branch
>>     $ hg branch default
>> -  abort: a branch of the same name already exists
>> -  (use 'hg update' to switch to it)
> The above behavior exists because people who have been exposed to Git
> think this is the command to switch branches. So they would get the
> below...

One good reason for "abort: a branch of the same name already exists" is 
that it in the general case prevents these users towards not creating an 
extra head on branch default. I agree with that.

>
>> +  marked working directory as branch default
>> +  (branches are permanent and global, did you want a bookmark?)
> ..and not realized they hadn't switched branches (because Git taught
> them not to bother reading output) and then be confused/upset/blame the
> tool when they had two heads.

In this case, assuming they were on tip that was the only branch head 
and on another branch, the next commit would give _one_ topo head on 
default (with a parent not on default).

But ok, they could be disappointed if they wanted to update to the 
parent revision that also is the branch head on default, and expected 
the next commit to give them a new head on default.

> So no, we can't switch this back.

Do we really want to let Mercurial functionality be controlled that much 
by what git and its users is doing?

/Mads


More information about the Mercurial-devel mailing list