# HG changeset patch # User Martin von Zweigbergk # Date 2018-04-06 16:43:17 # Node ID c4131138eadb232ca5888a0b36d49c7aee18c1df # Parent 966061b8826d2e875e28be2a8210b62e2e176990 histedit: look up partial nodeid as partial nodeid I'm about to remove support for repo[]. 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 diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -443,11 +443,9 @@ class histeditaction(object): """ 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):