Patchwork D3195: context: handle partial nodeids in revsymbol()

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

Comments

phabricator - April 8, 2018, 5:05 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/D3195

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
@@ -494,6 +494,11 @@ 
         except KeyError:
             pass
 
+        node = repo.unfiltered().changelog._partialmatch(symbol)
+        if node is not None:
+            rev = repo.changelog.rev(node)
+            return repo[rev]
+
         return repo[symbol]
 
     except error.WdirUnsupported: