diff hgext/evolve.py @ 1485:1ba64be11bf8

split: handle bookmarks instead of leaving them on precursor Before this patch we were leaving the bookmarks on the precursor of the split instead of moving them on the tip of the split chain. We add a test to verify the behavior.
author Laurent Charignon <lcharignon@fb.com>
date Sat, 08 Aug 2015 12:42:57 -0700
parents e3484e9632cd
children 3dec62fc266e
line wrap: on
line diff
--- a/hgext/evolve.py	Sat Aug 08 12:45:36 2015 -0700
+++ b/hgext/evolve.py	Sat Aug 08 12:42:57 2015 -0700
@@ -2603,6 +2603,11 @@
         if len(ctx.parents()) > 1:
             raise util.Abort(_("cannot split merge commits"))
         prev = ctx.p1()
+        bmupdate = _bookmarksupdater(repo, ctx.node())
+        bookactive = bmactive(repo)
+        if bookactive is not None:
+            repo.ui.status(_("(leaving bookmark %s)\n") % bmactive(repo))
+        bmdeactivate(repo)
         hg.update(repo, prev)
 
         commands.revert(ui, repo, rev=r, all=True)
@@ -2624,6 +2629,10 @@
             else:
                 ui.status("no more change to split\n")
 
+        tip = repo[newcommits[-1]]
+        bmupdate(tip.node())
+        if bookactive is not None:
+            bmactivate(repo, bookactive)
         obsolete.createmarkers(repo, [(repo[r], newcommits)])
         tr.close()
     finally: