D3194: context: handle namespaces in revsymbol()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Sun Apr 8 17:04:58 UTC 2018


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

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:



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


More information about the Mercurial-devel mailing list