[PATCH 1 of 4] commit: prevent to close non head changesets

Dirkjan Ochtman dirkjan at ochtman.nl
Mon May 10 00:50:48 CDT 2010


On Sun, May 9, 2010 at 23:44, Matt Mackall <mpm at selenic.com> wrote:
>> # HG changeset patch
>> # User Gilles Moris <gilles.moris at free.fr>
>> # Date 1273437438 -7200
>> # Node ID 9ab8b7dc5065557877d765b4f524ceb9cb1751e3
>> # Parent  0b465972baec1efccb4bf1a92992519665332713
>> commit: prevent to close non head changesets
>>
>> diff -r 0b465972baec -r 9ab8b7dc5065 mercurial/commands.py
>> --- a/mercurial/commands.py   Tue May 04 09:57:16 2010 +0200
>> +++ b/mercurial/commands.py   Sun May 09 22:37:18 2010 +0200
>> @@ -717,6 +717,8 @@
>>      """
>>      extra = {}
>>      if opts.get('close_branch'):
>> +        if repo['.'].node() not in repo.branchheads():
>> +            raise util.Abort(_('cannot close non head changeset'))
>
> Seems sensible. Should be 'non-head', though I think we should say
> something like 'can only close branch heads' instead.

Hmm, didn't we change it at the sprint so that topoheads can now be
meaningfully closed, as well?

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list