comparison hgext/histedit.py @ 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 41669a18a7d6
children 36adbbe960ca
comparison
equal deleted inserted replaced
19044:f77c23ec09f7 19045:080b801c34f1
722 if ' ' not in r: 722 if ' ' not in r:
723 raise util.Abort(_('malformed line "%s"') % r) 723 raise util.Abort(_('malformed line "%s"') % r)
724 action, rest = r.split(' ', 1) 724 action, rest = r.split(' ', 1)
725 ha = rest.strip().split(' ', 1)[0] 725 ha = rest.strip().split(' ', 1)[0]
726 try: 726 try:
727 if repo[ha] not in ctxs: 727 ha = str(repo[ha]) # ensure its a short hash
728 raise util.Abort(
729 _('may not use changesets other than the ones listed'))
730 except error.RepoError: 728 except error.RepoError:
731 raise util.Abort(_('unknown changeset %s listed') % ha) 729 raise util.Abort(_('unknown changeset %s listed') % ha)
730 if repo[ha] not in ctxs:
731 raise util.Abort(
732 _('may not use changesets other than the ones listed'))
732 if action not in actiontable: 733 if action not in actiontable:
733 raise util.Abort(_('unknown action "%s"') % action) 734 raise util.Abort(_('unknown action "%s"') % action)
734 parsed.append([action, ha]) 735 parsed.append([action, ha])
735 return parsed 736 return parsed
736 737