Mercurial > public > mercurial-scm > hg-stable
diff hgext/histedit.py @ 27547:1cbfeb1dc5aa
histedit: handle exceptions from node.bin in fromrule
author | timeless <timeless@mozdev.org> |
---|---|
date | Wed, 23 Dec 2015 23:51:29 +0000 |
parents | c00924c54607 |
children | cfb26146a8cd |
line wrap: on
line diff
--- a/hgext/histedit.py Wed Dec 23 23:23:28 2015 +0000 +++ b/hgext/histedit.py Wed Dec 23 23:51:29 2015 +0000 @@ -356,7 +356,11 @@ """Parses the given rule, returning an instance of the histeditaction. """ rulehash = rule.strip().split(' ', 1)[0] - return cls(state, node.bin(rulehash)) + try: + rev = node.bin(rulehash) + except TypeError: + raise error.ParseError("invalid changeset %s" % rulehash) + return cls(state, rev) def verify(self, prev): """ Verifies semantic correctness of the rule"""