changeset 37375:a973bb92ab71

bookmarks: drop always-None argument from calculateupdate() Thanks to Yuya for noticing. Differential Revision: https://phab.mercurial-scm.org/D3135
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 05 Apr 2018 08:28:12 -0700
parents ac42e39b1b77
children 25940470c7e6
files mercurial/bookmarks.py mercurial/destutil.py
diffstat 2 files changed, 9 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Tue Apr 03 09:58:16 2018 -0700
+++ b/mercurial/bookmarks.py	Thu Apr 05 08:28:12 2018 -0700
@@ -348,17 +348,16 @@
             heads.append(n)
     return heads
 
-def calculateupdate(ui, repo, checkout):
+def calculateupdate(ui, repo):
     '''Return a tuple (activemark, movemarkfrom) indicating the active bookmark
     and where to move the active bookmark from, if needed.'''
-    movemarkfrom = None
-    if checkout is None:
-        activemark = repo._activebookmark
-        if isactivewdirparent(repo):
-            movemarkfrom = repo['.'].node()
-        elif activemark:
-            ui.status(_("updating to active bookmark %s\n") % activemark)
-            checkout = activemark
+    checkout, movemarkfrom = None, None
+    activemark = repo._activebookmark
+    if isactivewdirparent(repo):
+        movemarkfrom = repo['.'].node()
+    elif activemark:
+        ui.status(_("updating to active bookmark %s\n") % activemark)
+        checkout = activemark
     return (checkout, movemarkfrom)
 
 def update(repo, parents, node):
--- a/mercurial/destutil.py	Tue Apr 03 09:58:16 2018 -0700
+++ b/mercurial/destutil.py	Thu Apr 05 08:28:12 2018 -0700
@@ -56,7 +56,7 @@
     """decide on an update destination from active bookmark"""
     # we also move the active bookmark, if any
     node = None
-    activemark, movemark = bookmarks.calculateupdate(repo.ui, repo, None)
+    activemark, movemark = bookmarks.calculateupdate(repo.ui, repo)
     if activemark is not None:
         node = repo.lookup(activemark)
     return node, movemark, activemark