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

Augie Fackler durin42 at gmail.com
Wed May 12 09:35:54 CDT 2010


On Wed, May 12, 2010 at 3:15 AM, Gilles Moris <gilles.moris at free.fr> wrote:
> # HG changeset patch
> # User Gilles Moris <gilles.moris at free.fr>
> # Date 1273473816 -7200
> # Node ID fb42a17f51be019620d18aa277182a92e79d2d7b
> # Parent  3a75a6f6d3fd92f3568ec7cb978187a18512a99d
> commit: prevent to close non head changesets

"prevent closing non-head changesets"? What you have is a bit
confusing syntax-wise.

>
> diff -r 3a75a6f6d3fd -r fb42a17f51be mercurial/commands.py
> --- a/mercurial/commands.py     Tue May 04 09:57:16 2010 +0200
> +++ b/mercurial/commands.py     Mon May 10 08:43:36 2010 +0200
> @@ -717,6 +717,10 @@
>     """
>     extra = {}
>     if opts.get('close_branch'):
> +        if repo['.'].node() not in repo.branchheads():
> +            # The topo heads set is included in the branch heads set of the
> +            # current branch, so it's sufficient to test branchheads
> +            raise util.Abort(_('can only close branch heads'))
>         extra['close'] = 1
>     e = cmdutil.commiteditor
>     if opts.get('force_editor'):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>


More information about the Mercurial-devel mailing list