# HG changeset patch # User Martin von Zweigbergk # Date 1523684797 25200 # Node ID 5f8f013e7d5287fc94b264529a29e8c1773fd34c # Parent 41ac707322ba7012fd3968b421eff47e26549f29 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 diff -r 41ac707322ba -r 5f8f013e7d52 hgext/eol.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 diff -r 41ac707322ba -r 5f8f013e7d52 hgext/histedit.py --- 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) diff -r 41ac707322ba -r 5f8f013e7d52 mercurial/context.py --- 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) diff -r 41ac707322ba -r 5f8f013e7d52 mercurial/scmutil.py --- 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: