hgext/evolve.py
changeset 284 88a851a54f26
parent 272 78d01e341438
child 294 98c9c69c311d
--- a/hgext/evolve.py	Tue Jun 19 17:58:49 2012 +0200
+++ b/hgext/evolve.py	Tue Jun 19 17:57:54 2012 +0200
@@ -180,11 +180,17 @@
             rebase.rebasenode(repo, orig.node(), dest.node(),
                               {node.nullrev: node.nullrev})
         nodenew = rebase.concludenode(repo, orig.node(), dest.node(), node.nullid)
-        phases.retractboundary(repo, destphase, [nodenew])
-        repo.addobsolete(nodenew, nodesrc)
         oldbookmarks = repo.nodebookmarks(nodesrc)
-        for book in oldbookmarks:
-            repo._bookmarks[book] = nodenew
+        if nodenew is not None:
+            phases.retractboundary(repo, destphase, [nodenew])
+            repo.addobsolete(nodenew, nodesrc)
+            for book in oldbookmarks:
+                repo._bookmarks[book] = nodenew
+        else:
+            repo.addobsolete(node.nullid, nodesrc)
+            # Behave like rebase, move bookmarks to dest
+            for book in oldbookmarks:
+                repo._bookmarks[book] = dest.node()
         for book in destbookmarks: # restore bookmark that rebase move
             repo._bookmarks[book] = dest.node()
         if oldbookmarks or destbookmarks: