Patchwork D3135: bookmarks: drop always-None argument from calculateupdate()

login
register
mail settings
Submitter phabricator
Date April 5, 2018, 7:17 p.m.
Message ID <39800551230ea355e33ff2095b5c7018@localhost.localdomain>
Download mbox | patch
Permalink /patch/30400/
State Not Applicable
Headers show

Comments

phabricator - April 5, 2018, 7:17 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa973bb92ab71: bookmarks: drop always-None argument from calculateupdate() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3135?vs=7732&id=7747

REVISION DETAIL
  https://phab.mercurial-scm.org/D3135

AFFECTED FILES
  mercurial/bookmarks.py
  mercurial/destutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/destutil.py b/mercurial/destutil.py
--- a/mercurial/destutil.py
+++ b/mercurial/destutil.py
@@ -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
diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -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):