hgext/evolve.py
branchstable
changeset 476 f17a0f801e0b
parent 475 9f69a5e41ab0
child 477 fded4d945f87
--- a/hgext/evolve.py	Tue Aug 21 12:42:09 2012 +0200
+++ b/hgext/evolve.py	Tue Aug 21 12:43:21 2012 +0200
@@ -416,6 +416,8 @@
             if old.phase() == phases.public:
                 raise util.Abort(_("can not rewrite immutable changeset %s")
                                  % old)
+            if not repo.revs('%d and (::.)', old):
+                raise error.Abort(_('cannot amend non ancestor changeset'))
             tr = repo.transaction('amend')
             try:
                 oldphase = old.phase()