changeset 19046:36adbbe960ca

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.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 18 Apr 2013 15:13:35 +0200
parents 080b801c34f1
children 81de87f8b480
files hgext/histedit.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: