sangeet259 updated this revision to Diff 6008.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2394?vs=6007&id=6008

REVISION DETAIL
  https://phab.mercurial-scm.org/D2394

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS

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:



To: sangeet259, durin42, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to