--- a/hgext/evolution.py Tue Jan 10 19:52:44 2012 +0100
+++ b/hgext/evolution.py Wed Jan 11 17:01:06 2012 +0100
@@ -222,9 +222,11 @@
@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
@@ -236,9 +238,16 @@
"""
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