bookmarks: drop always-None argument from calculateupdate()
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 05 Apr 2018 08:28:12 -0700
changeset 45049 a973bb92ab71dbf97f90892e5e731630cd94e9c8
parent 45048 ac42e39b1b77d1bdd72b43df1a3bf26ea1e3a5d8
child 45050 25940470c7e64e9678ef91fc02c914850d3f7640
push id779
push usergszorc@mozilla.com
push dateFri, 06 Apr 2018 17:27:47 +0000
bookmarks: drop always-None argument from calculateupdate() Thanks to Yuya for noticing. Differential Revision: https://phab.mercurial-scm.org/D3135
mercurial/bookmarks.py
mercurial/destutil.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -343,27 +343,26 @@ def headsforactive(repo):
             'headsforactive() only makes sense with an active bookmark')
     name = repo._activebookmark.split('@', 1)[0]
     heads = []
     for mark, n in repo._bookmarks.iteritems():
         if mark.split('@', 1)[0] == name:
             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):
     deletefrom = parents
     marks = repo._bookmarks
     active = marks.active
     if not active:
         return False
--- a/mercurial/destutil.py
+++ b/mercurial/destutil.py
@@ -51,17 +51,17 @@ def _destupdateobs(repo, clean):
             if bookmarks.isactivewdirparent(repo):
                 movemark = repo['.'].node()
     return node, movemark, None
 
 def _destupdatebook(repo, clean):
     """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
 
 def _destupdatebranch(repo, clean):
     """decide on an update destination from current branch
 
     This ignores closed branch heads.