scmutil: rename resolvepartialhexnodeid() to resolvehexnodeidprefix()
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 13 Apr 2018 22:46:37 -0700
changeset 37678 5f8f013e7d52
parent 37677 41ac707322ba
child 37679 ab828755e1ea
scmutil: rename resolvepartialhexnodeid() to resolvehexnodeidprefix() I'm going to wrap revlog.shortest() in scmutil. I plan on calling it shortesthexnodeidprefix(). resolvehexnodeidprefix() matches that better. Also, "prefix" carries more information than "partial". Differential Revision: https://phab.mercurial-scm.org/D3309
hgext/eol.py
hgext/histedit.py
mercurial/context.py
mercurial/scmutil.py
--- a/hgext/eol.py	Fri Apr 13 09:48:22 2018 -0700
+++ b/hgext/eol.py	Fri Apr 13 22:46:37 2018 -0700
@@ -300,7 +300,7 @@
 hook = checkheadshook
 
 def preupdate(ui, repo, hooktype, parent1, parent2):
-    p1node = scmutil.resolvepartialhexnodeid(repo, parent1)
+    p1node = scmutil.resolvehexnodeidprefix(repo, parent1)
     repo.loadeol([p1node])
     return False
 
--- a/hgext/histedit.py	Fri Apr 13 09:48:22 2018 -0700
+++ b/hgext/histedit.py	Fri Apr 13 22:46:37 2018 -0700
@@ -443,7 +443,7 @@
         """ Verifies semantic correctness of the rule"""
         repo = self.repo
         ha = node.hex(self.node)
-        self.node = scmutil.resolvepartialhexnodeid(repo, ha)
+        self.node = scmutil.resolvehexnodeidprefix(repo, ha)
         if self.node is None:
             raise error.ParseError(_('unknown changeset %s listed') % ha[:12])
         self._verifynodeconstraints(prev, expected, seen)
--- a/mercurial/context.py	Fri Apr 13 09:48:22 2018 -0700
+++ b/mercurial/context.py	Fri Apr 13 22:46:37 2018 -0700
@@ -392,7 +392,7 @@
     #  * If you know that "x" is a branch or in some other namespace,
     #    use the appropriate mechanism for that namespace
     #  * If you know that "x" is a hex nodeid prefix, use
-    #    repo[scmutil.resolvepartialhexnodeid(repo, x)]
+    #    repo[scmutil.resolvehexnodeidprefix(repo, x)]
     #  * If "x" is a string that can be any of the above, but you don't want
     #    to allow general revsets (perhaps because "x" may come from a remote
     #    user and the revset may be too costly), use scmutil.revsymbol(repo, x)
@@ -476,7 +476,7 @@
             except KeyError:
                 pass
 
-            self._node = scmutil.resolvepartialhexnodeid(repo, changeid)
+            self._node = scmutil.resolvehexnodeidprefix(repo, changeid)
             if self._node is not None:
                 self._rev = repo.changelog.rev(self._node)
                 changectxdeprecwarn(repo)
--- a/mercurial/scmutil.py	Fri Apr 13 09:48:22 2018 -0700
+++ b/mercurial/scmutil.py	Fri Apr 13 22:46:37 2018 -0700
@@ -434,8 +434,8 @@
         hexfunc = short
     return '%d:%s' % (rev, hexfunc(node))
 
-def resolvepartialhexnodeid(repo, prefix):
-    # Uses unfiltered repo because it's faster when then prefix is ambiguous/
+def resolvehexnodeidprefix(repo, prefix):
+    # Uses unfiltered repo because it's faster when prefix is ambiguous/
     # This matches the "shortest" template function.
     node = repo.unfiltered().changelog._partialmatch(prefix)
     if node is None: