# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1521807566 -19800 # Node ID 6756f2a85f5b050fafa79fa1884ca38fc8b3f0b2 # Parent 71fbb679e311a1ea1865bd5e9e51b5d71517e433 evolve: make sure bookmarks are moved after phase-divergence resolution This patch adds logic to move bookmarks from the rebased node to the phase-divergence resolved node. diff -r 71fbb679e311 -r 6756f2a85f5b hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Fri Mar 23 17:46:46 2018 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Fri Mar 23 17:49:26 2018 +0530 @@ -228,6 +228,9 @@ tr = repo.currenttransaction() assert tr is not None bmupdate = _bookmarksupdater(repo, bumped.node(), tr) + # function to update the bookmark from the rebased changeset to new resolved + # changeset + rebasedbmupdate = None # Checking for whether the phase-divergent changeset has common parents as # it's precursors. Phase-divergent changeset and precursor having different @@ -248,6 +251,7 @@ # after rebasing, the changeset against which revert should # happen should be the new rebased changeset bumped = tmpctx + rebasedbmupdate = _bookmarksupdater(repo, bumped.node(), tr) except MergeFailure: repo.vfs.write('graftstate', bumped.hex() + '\n') repo.ui.write_err(_('evolution failed!\n')) @@ -301,6 +305,9 @@ compat.createmarkers(repo, [(tmpctx, (repo[newid],))], flag=obsolete.bumpedfix, operation='evolve') bmupdate(newid) + # if rebased happened, update bookmarks from there too + if rebasedbmupdate: + rebasedbmupdate(newid) repo.ui.status(_('committed as %s\n') % node.short(newid)) # reroute the working copy parent to the new changeset with repo.dirstate.parentchange(): diff -r 71fbb679e311 -r 6756f2a85f5b tests/test-evolve-phase-divergence.t --- a/tests/test-evolve-phase-divergence.t Fri Mar 23 17:46:46 2018 +0530 +++ b/tests/test-evolve-phase-divergence.t Fri Mar 23 17:49:26 2018 +0530 @@ -608,10 +608,8 @@ XXX: we should move bookmark here $ hg glog - x 11:b1a0e143e32b added x to x - | (bm) draft - | @ 9:2352021b3785 added x to x - |/ () public + @ 9:2352021b3785 added x to x + | (bm) public o 8:502e73736632 phase-divergent update to b756eb10ea73: | | foo to bar