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

Gilles Moris gilles.moris at free.fr
Sun May 9 15:50:13 CDT 2010


 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'))
         extra['close'] = 1
     e = cmdutil.commiteditor
     if opts.get('force_editor'):


More information about the Mercurial-devel mailing list