Patchwork D3079: localrepo: drop "remote" argument from lookupbranch() (API)

login
register
mail settings
Submitter phabricator
Date April 4, 2018, 10:53 p.m.
Message ID <differential-rev-PHID-DREV-wtvukad5t6bzkaaprawh-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30296/
State Superseded
Headers show

Comments

phabricator - April 4, 2018, 10:53 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  According to `hg grep --all lookupbranch`, the "remote" argument has
  never been used ever since it was introduced in https://phab.mercurial-scm.org/rHGca739acf1a98f8c9ce889f798d0cd26344c6c3dd
  (commands: add more robust support for 'hg log -b' (issue2078),
  2010-04-12).

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/localrepo.py
  mercurial/repository.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/repository.py b/mercurial/repository.py
--- a/mercurial/repository.py
+++ b/mercurial/repository.py
@@ -446,7 +446,7 @@ 
     def lookup(key):
         """Resolve the node for a revision."""
 
-    def lookupbranch(key, remote=None):
+    def lookupbranch(key):
         """Look up the branch name of the given revision or branch name."""
 
     def known(nodes):
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1019,13 +1019,11 @@ 
     def lookup(self, key):
         return scmutil.revsymbol(self, key).node()
 
-    def lookupbranch(self, key, remote=None):
-        repo = remote or self
-        if key in repo.branchmap():
+    def lookupbranch(self, key):
+        if key in self.branchmap():
             return key
 
-        repo = (remote and remote.local()) and remote or self
-        return repo[key].branch()
+        return self[key].branch()
 
     def known(self, nodes):
         cl = self.changelog