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

Matt Mackall mpm at selenic.com
Sun May 9 16:44:30 CDT 2010


On Sun, 2010-05-09 at 22:50 +0200, Gilles Moris wrote:
> mercurial/commands.py |  2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> 
> # 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.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list