What exactly *is* a branch?
Adrian Buehlmann
adrian at cadifra.com
Thu Jun 24 13:55:08 UTC 2010
On 24.06.2010 14:59, Martin Geisler wrote:
> On Thu, Jun 24, 2010 at 14:37, Didly <didlybom at gmail.com> wrote:
>>
>> On Thu, Jun 24, 2010 at 1:03 PM, Daniel Carrera <dcarrera at gmail.com> wrote:
>>>
>>> When you pull from me and I pull from you, we'll have revisions that
>>> claim to be the same branch but are disconnected. And there is no way
>>> Mercurial or any DVCS could have warned us about this.
>>
>> That is true, but while it may be impossible to avoid getting into this
>> issue in some cases, it could be easy to avoid it in many others by simply
>> warning the user that it may be making a mistake.
>
> It's easy to test, so please try it! :-) You'll get this warning when
> you do 'hg branch':
>
> abort: a branch of the same name already exists (use --force to override)
>
>> Other than this reason (that you cannot avoid it) is there any other reason
>> to allow (or even to willfully get into) a situation in which unconnected
>> revisions belong to the same branch?
>
> When we release a new version of Mercurial, we do it using a changeset
> on the stable branch. It would not be so weird if we then restarted
> the default branch at that point instead of merging stable into
> default like I believe we did last time.
>
My gut feeling says it could be weird, but I don't have a prove.
An observation: If you do this, you will not have a full chain back to
the root revision via first parent ancestors on default. You will have
to travel via "stable land" when going back (parent of 9 switches from
default branch to stable when going back to 8, on 6, you have to decide
to go back via 4 if you still prefer default land).
default: 0 -- 1 -- 2 -- 4 - (gap) 9 -- 10 -- 11 -- 15 -- 16
\ \ / /
stable: -- 3 -- 5 -- 6 -- 7 -- 8 -- 12 -- 13 -- 14
This feels odd to somehow have lost the default branch back-connection
between 9 and 4 (a gap in the backbone).
Compare with:
default: 0 -- 1 -- 2 -- 4 -------------- 9 -- 10 -- 11 -- 15 -- 16
\ \ / /
stable: -- 3 -- 5 -- 6 -- 7 -- 8 -- 12 -- 13 -- 14
My "gut feeling rule" tells me: don't break the back-chain on default if
you don't have to. But maybe it's just unwarranted paranoia.
More information about the Mercurial
mailing list