RFC: dealing with dead, anonymous feature branches

Martin Geisler mg at aragost.com
Mon May 17 03:22:49 CDT 2010


Gilles Moris <gilles.moris at free.fr> writes:

> On Saturday 08 May 2010 10:10:33 pm Martin Geisler wrote:
>> Gilles Moris <gilles.moris at free.fr> writes:
>> > On Saturday 08 May 2010 10:32:04 am Martin Geisler wrote:
>> >
>> > May be it's just a matter of better advertising closed heads and of
>> > education. But we should be prepared to that.
>>
>> Yeah, there will be the problem of how to discover or re-find the
>> dead heads since I think they should be skipped in 'hg log' by
>> default (not hidden from other parts of Mercurial, just hidden in by
>> default in the various log viewers).
>
> You lost me: if just cloning will trim those dead heads, do we really
> need to also hide dead heads from logs. Just mark them as 'closed'
> should be sufficient, isn't it ?

I guess so and that would be more in line with how we normally do
things. I imagine TortoiseHg will get an option to exclude dead branches
from its log viewer but that should probably be something people enable
if they want.

>> So I basically think we need a way to say to Mercurial: "yes, I know
>> there is an extra head, but I've marked it as dead/closed -- please
>> stop bothering me" :-)
>
> Actually, I was wrong yesterday: after testing more, "hg heads", "hg
> branches", "hg update", "hg merge" seems to work OK in presence of
> closed heads: they are not reported or used for default merge/update.
>
> So the situation is far better than I thought originally, and may just
> need some polishing. I've made a few patches yesterday that I'll try
> to send.

Great job on the patches! I'm glad to see they went in without too much
fuzz.

>> Excluding the dead heads from push/pull will furthermore solve the
>> problem people have when they have made a mess and don't want to push
>> it anywhere. Just today a guy came by on IRC who had managed to
>> commit the same change at three different places in his history. Now
>> Mercurial (wisely) told him that he would create multiple heads on
>> push and he was very confused... It would have been great to tell him
>> to do
>>
>>   hg update first-troublesome-head
>>   hg commit --mark-dead (or --kill, --murder, etc :-)
>>   hg update second-troublesome-head
>>   hg commit --mark-dead
>>   hg push
>
> As I've just said, it seems that "--close-branch" seems to be working.

Almost. After marking a changeset as closed, it will still be pushed by
'hg push'. I want to be able to mark a changeset as dead and that should
exclude it from push/pull. That way the local mess in the above example
wont be pushed to the server.

> Do you intend to have another option here. Or just rename the option ?

I think a new option will be best.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list