changeset 19045:080b801c34f1

histedit: ensure rules return short hex at all time Handling homogeneous data is both simpler and safer.
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Thu, 18 Apr 2013 15:10:01 +0200
parents f77c23ec09f7
children 36adbbe960ca
files hgext/histedit.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Thu Apr 18 13:51:27 2013 +0200
+++ b/hgext/histedit.py	Thu Apr 18 15:10:01 2013 +0200
@@ -724,11 +724,12 @@
         action, rest = r.split(' ', 1)
         ha = rest.strip().split(' ', 1)[0]
         try:
-            if repo[ha] not in ctxs:
-                raise util.Abort(
-                    _('may not use changesets other than the ones listed'))
+            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:
+            raise util.Abort(
+                _('may not use changesets other than the ones listed'))
         if action not in actiontable:
             raise util.Abort(_('unknown action "%s"') % action)
         parsed.append([action, ha])