Patchwork D3194: context: handle namespaces in revsymbol()

login
register
mail settings
Submitter phabricator
Date April 8, 2018, 5:04 p.m.
Message ID <differential-rev-PHID-DREV-rxkpwxl2zjhnay7wdfvh-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30576/
State Superseded
Headers show

Comments

phabricator - April 8, 2018, 5:04 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Similar reasoning as previous patches.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -486,6 +486,14 @@ 
             except (TypeError, LookupError):
                 pass
 
+        # look up bookmarks through the name interface
+        try:
+            node = repo.names.singlenode(repo, symbol)
+            rev = repo.changelog.rev(node)
+            return repo[rev]
+        except KeyError:
+            pass
+
         return repo[symbol]
 
     except error.WdirUnsupported: