histedit: track short hash instead of changectx object
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 18 Apr 2013 15:13:35 +0200
changeset 19046 36adbbe960ca
parent 19045 080b801c34f1
child 19047 81de87f8b480
histedit: track short hash instead of changectx object This simplifies set usage and allow us to add a missing revision check in a later commit.
hgext/histedit.py
--- a/hgext/histedit.py	Thu Apr 18 15:10:01 2013 +0200
+++ b/hgext/histedit.py	Thu Apr 18 15:13:35 2013 +0200
@@ -716,7 +716,8 @@
     or a rule on a changeset outside of the user-given range.
     """
     parsed = []
-    if len(rules) != len(ctxs):
+    expected = set(str(c) for c in ctxs)
+    if len(rules) != len(expected):
         raise util.Abort(_('must specify a rule for each changeset once'))
     for r in rules:
         if ' ' not in r:
@@ -727,7 +728,7 @@
             ha = str(repo[ha])  # ensure its a short hash
         except error.RepoError:
             raise util.Abort(_('unknown changeset %s listed') % ha)
-        if repo[ha] not in ctxs:
+        if ha not in expected:
             raise util.Abort(
                 _('may not use changesets other than the ones listed'))
         if action not in actiontable: