hgext/evolve.py
changeset 645 ca5459892427
parent 632 cb0807646f5a
parent 644 8e41d5b78dff
child 647 a2b805bacdc0
--- a/hgext/evolve.py	Tue Dec 18 17:31:23 2012 +0100
+++ b/hgext/evolve.py	Wed Jan 02 14:38:40 2013 +0100
@@ -701,7 +701,7 @@
     ret = orig(ui, repo, *args, **kwargs)
     nbunstable = len(getrevs(repo, 'unstable'))
     nbbumped = len(getrevs(repo, 'bumped'))
-    nbdivergent = len(getrevs(repo, 'unstable'))
+    nbdivergent = len(getrevs(repo, 'divergent'))
     write('unstable: %i changesets\n', nbunstable)
     write('bumped: %i changesets\n', nbbumped)
     write('divergent: %i changesets\n', nbdivergent)
@@ -998,22 +998,27 @@
     """
     def selfanddescendants(repo, pctx):
         yield pctx
+        for prec in repo.set('allprecursors(%d)', pctx):
+            yield prec
         for ctx in pctx.descendants():
             yield ctx
+            for prec in repo.set('allprecursors(%d)', ctx):
+                yield prec
 
     # Look for an unstable which can be stabilized as a child of
     # node. The unstable must be a child of one of node predecessors.
     for ctx in selfanddescendants(repo, pctx):
-        unstables = list(repo.set('unstable() and children(allprecursors(%d))',
-                                  ctx.rev()))
-        if unstables:
-            return unstables[0]
+        for child in ctx.children():
+            if child.unstable():
+                return child
     return None
 
 def _solveunstable(ui, repo, orig, dryrun=False):
     """Stabilize a unstable changeset"""
     obs = orig.parents()[0]
     if not obs.obsolete():
+        print obs.rev(), orig.parents()
+        print orig.rev()
         obs = orig.parents()[1]
     assert obs.obsolete()
     newer = obsolete.successorssets(repo, obs.node())
@@ -1306,8 +1311,9 @@
         return 1
 
 @command('^prune|obsolete|kill',
-    [('n', 'new', [], _("successor changeset"))],
-    _('[OPTION] REV...'))
+    [('n', 'new', [], _("successor changeset")),
+     ('r', 'rev', [], _("revisions to fold"))],
+    _('[OPTION] [-r] REV...'))
 def kill(ui, repo, *revs, **opts):
     """mark a changeset as obsolete
 
@@ -1318,6 +1324,8 @@
     XXX handle merge
     XXX check immutable first
     """
+    revs = list(revs)
+    revs.extend(opts['rev'])
     wlock = repo.wlock()
     try:
         lock = repo.lock()
@@ -1659,7 +1667,7 @@
         lockmod.release(lock, wlock)
 
 @command('^fold',
-    [('r', 'rev', [], 'revisions to fold'),
+    [('r', 'rev', [], _("revisions to fold")),
     ],
     # allow to choose the seed ?
     _('[-r] revs'))