diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -422,7 +422,14 @@ def fromrule(cls, state, rule): """Parses the given rule, returning an instance of the histeditaction. """ - rulehash = rule.strip().split(' ', 1)[0] + ruleid = rule.strip().split(' ', 1)[0] + # The ruleid can be anything like revison no,rulehashes, "tip","@" etc + # Check for validation of rule ids and get the rulehash + try: + _ctx = scmutil.revsingle(state.repo, ruleid) + rulehash = _ctx.hex()[:12] + except RepoLookupError : + raise error.ParseError("invalid changeset %s" % ruleid) try: rev = node.bin(rulehash) except TypeError: