Commit 57cd21da authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

evolvecmd: reorder some functions to match order they're called

parent 28dc9ac2958a
......@@ -938,6 +938,27 @@ def _relocate(repo, orig, dest, evolvestate, pctx=None, keepbranch=False,
_finalizerelocate(repo, orig, dest, nodenew, tr, category, evolvestate)
return nodenew
def _evolvemerge(repo, orig, dest, pctx, keepbranch):
"""Used by the evolve function to merge dest on top of pctx.
return the same tuple as merge.graft"""
if repo[b'.'].rev() != dest.rev():
compat._update(repo, dest, branchmerge=False, force=True)
if repo._activebookmark:
repo.ui.status(_(b"(leaving bookmark %s)\n") % repo._activebookmark)
bookmarksmod.deactivate(repo)
if keepbranch:
repo.dirstate.setbranch(orig.branch())
if util.safehasattr(repo, 'currenttopic'):
# uurrgs
# there no other topic setter yet
if not orig.topic() and repo.vfs.exists(b'topic'):
repo.vfs.unlink(b'topic')
else:
with repo.vfs.open(b'topic', b'w') as f:
f.write(orig.topic())
return merge.graft(repo, orig, pctx, [b'destination', b'evolving'], True)
def _relocatecommit(repo, orig, commitmsg):
if commitmsg is None:
commitmsg = orig.description()
......@@ -977,27 +998,6 @@ def _finalizerelocate(repo, orig, dest, nodenew, tr, category, evolvestate):
bmchanges.append((book, bmdest))
repo._bookmarks.applychanges(repo, tr, bmchanges)
def _evolvemerge(repo, orig, dest, pctx, keepbranch):
"""Used by the evolve function to merge dest on top of pctx.
return the same tuple as merge.graft"""
if repo[b'.'].rev() != dest.rev():
compat._update(repo, dest, branchmerge=False, force=True)
if repo._activebookmark:
repo.ui.status(_(b"(leaving bookmark %s)\n") % repo._activebookmark)
bookmarksmod.deactivate(repo)
if keepbranch:
repo.dirstate.setbranch(orig.branch())
if util.safehasattr(repo, 'currenttopic'):
# uurrgs
# there no other topic setter yet
if not orig.topic() and repo.vfs.exists(b'topic'):
repo.vfs.unlink(b'topic')
else:
with repo.vfs.open(b'topic', b'w') as f:
f.write(orig.topic())
return merge.graft(repo, orig, pctx, [b'destination', b'evolving'], True)
instabilities_map = {
b'contentdivergent': b"content-divergent",
b'phasedivergent': b"phase-divergent"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment