# HG changeset patch # User Sean Farley # Date 2014-10-17 06:27:54 # Node ID aead63705504d6ad43f9596da109ad8c0be6c863 # Parent 3b3a962e3677884205c9f8acfe21e3f2ed592e08 changectx: use names api to simplify and extend node lookup Previously, changectx had to know about each type of name (bookmark, tag, etc.) to look up. Now, we use repo.namenodes to simplify (and extend) this. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -407,10 +407,14 @@ class changectx(basectx): except (TypeError, LookupError): pass - if changeid in repo._bookmarks: - self._node = repo._bookmarks[changeid] + # lookup bookmarks through the name interface + try: + self._node = repo.names.singlenode(changeid) self._rev = repo.changelog.rev(self._node) return + except KeyError: + pass + if changeid in repo._tagscache.tags: self._node = repo._tagscache.tags[changeid] self._rev = repo.changelog.rev(self._node)