Skip to content
Snippets Groups Projects
Commit 7fc759c0c430 authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

destupdate: extract logic based on bookmarks in its own function

One of the main goal of having consolidated destination function is to allow
extension to play with this logic. We extract sub logic to make is wrapping more
practical.
parent 52d08a93de1f
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,15 @@
movemark = repo['.'].node()
return node, movemark, None
def _destupdatebook(repo, clean, check):
"""decide on an update destination from active bookmark"""
# we also move the active bookmark, if any
activemark = None
node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
if node is not None:
activemark = node
return node, movemark, activemark
def destupdate(repo, clean=False, check=False):
"""destination for bare update operation
......@@ -91,5 +100,7 @@
movemark = activemark = None
node, movemark, activemark = _destupdateobs(repo, clean, check)
if node is None:
node, movemark, activemark = _destupdatebook(repo, clean, check)
if node is None:
......@@ -94,10 +105,5 @@
if node is None:
# we also move the active bookmark, if any
node, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
if node is not None:
activemark = node
if node is None:
try:
node = repo.branchtip(wc.branch())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment