Mercurial > hg-stable
changeset 37506:c4131138eadb
histedit: look up partial nodeid as partial nodeid
I'm about to remove support for repo[<partial hex nodeid>]. In the
verify() method, we know that self.node is always a partial or full
binary nodeid, so the most correct way to look up the revision is by
using changelog._partialmatch(), so let's do that. (It's closer to the
current code to do scmutil.revsymbol(), but that's less correct
because it will match a bookmark or tag that happens to have the same
prefix as the node.)
Differential Revision: https://phab.mercurial-scm.org/D3158
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 06 Apr 2018 09:43:17 -0700 |
parents | 966061b8826d |
children | 9b16a67cef56 |
files | hgext/histedit.py |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/histedit.py Fri Apr 06 09:41:25 2018 -0700 +++ b/hgext/histedit.py Fri Apr 06 09:43:17 2018 -0700 @@ -443,11 +443,9 @@ """ Verifies semantic correctness of the rule""" repo = self.repo ha = node.hex(self.node) - try: - self.node = repo[ha].node() - except error.RepoError: - raise error.ParseError(_('unknown changeset %s listed') - % ha[:12]) + self.node = scmutil.resolvepartialhexnodeid(repo, ha) + if self.node is None: + raise error.ParseError(_('unknown changeset %s listed') % ha[:12]) self._verifynodeconstraints(prev, expected, seen) def _verifynodeconstraints(self, prev, expected, seen):