Commits

Pierre-Yves David committed b70fadb

evolution: add a --new argument for kill

Comments (0)

Files changed (1)

hgext/evolution.py

 
 
 @command('^kill',
-    [],
+    [
+    ('n', 'new', [], _("New changeset that justify this one to be killed"))
+    ],
     '<revs>')
-def kill(ui, repo, *revs):
+def kill(ui, repo, *revs, **opts):
     """mark a changeset as obsolete
 
     This update the parent directory to a not-killed parent if the current
     """
     wlock = repo.wlock()
     try:
+        new = opts['new']
         targetnodes = set(noderange(repo, revs))
+        if not new:
+            new = [node.nullid]
         for n in targetnodes:
-            repo.addobsolete(node.nullid, n)
+            if not repo[n].mutable():
+                ui.warn(_("Can't kill immutable changeset %s") % repo[n])
+            else:
+                for ne in new:
+                    repo.addobsolete(ne, n)
         # update to an unkilled parent
         wdp = repo['.']
         newnode = wdp