hgext/evolve.py
branchstable
changeset 931 32915143d448
parent 930 cac35bef8aee
child 932 bcd0c12070b2
child 933 e5baeb8fefec
--- a/hgext/evolve.py	Fri May 09 03:06:36 2014 -0700
+++ b/hgext/evolve.py	Thu Jan 09 11:33:15 2014 +0100
@@ -1487,11 +1487,19 @@
 
         # informs that changeset have been pruned
         ui.status(_('%i changesets pruned\n') % len(precs))
-        # update to an unkilled parent
+
         wdp = repo['.']
-        newnode = wdp
-        while newnode.obsolete():
-            newnode = newnode.parents()[0]
+
+        if len(sucs) == 1 and len(precs) == 1 and wdp in precs:
+            # '.' killed, so update to the successor
+            newnode = sucs[0]
+        else:
+            # update to an unkilled parent
+            newnode = wdp
+
+            while newnode.obsolete():
+                newnode = newnode.parents()[0]
+
         if newnode.node() != wdp.node():
             commands.update(ui, repo, newnode.rev())
             ui.status(_('working directory now at %s\n') % newnode)