mercurial/destutil.py
changeset 26723 52d08a93de1f
parent 26722 6cd643a1d32c
child 26724 7fc759c0c430
--- a/mercurial/destutil.py	Thu Oct 15 02:12:55 2015 +0100
+++ b/mercurial/destutil.py	Thu Oct 15 02:15:43 2015 +0100
@@ -40,20 +40,12 @@
                     hint = _("merge or update --check to force update")
                     raise error.UpdateAbort(msg, hint=hint)
 
-def destupdate(repo, clean=False, check=False):
-    """destination for bare update operation
-
-    return (rev, movemark, activemark)
-
-    - rev: the revision to update to,
-    - movemark: node to move the active bookmark from
-                (cf bookmark.calculate update),
-    - activemark: a bookmark to activate at the end of the update.
-    """
+def _destupdateobs(repo, clean, check):
+    """decide of an update destination from obsolescence markers"""
     node = None
     wc = repo[None]
     p1 = wc.p1()
-    movemark = activemark = None
+    movemark = None
 
     if p1.obsolete() and not p1.children():
         # allow updating to successors
@@ -82,6 +74,23 @@
             node = repo.revs('max(%ln)', successors).first()
             if bookmarks.isactivewdirparent(repo):
                 movemark = repo['.'].node()
+    return node, movemark, None
+
+def destupdate(repo, clean=False, check=False):
+    """destination for bare update operation
+
+    return (rev, movemark, activemark)
+
+    - rev: the revision to update to,
+    - movemark: node to move the active bookmark from
+                (cf bookmark.calculate update),
+    - activemark: a bookmark to activate at the end of the update.
+    """
+    node = None
+    wc = repo[None]
+    movemark = activemark = None
+
+    node, movemark, activemark = _destupdateobs(repo, clean, check)
 
     if node is None:
         # we also move the active bookmark, if any