[PATCH 03 of 11 RFC] histedit: add rule handling for exec
David Soria Parra
dsp at experimentalworks.net
Wed Mar 5 15:38:51 CST 2014
Olle Lundberg <olle.lundberg at gmail.com> writes:
> # HG changeset patch
> # User Olle Lundberg <geek at nerd.sh>
> # Date 1394034350 -3600
> # Wed Mar 05 16:45:50 2014 +0100
> # Node ID 125d473d0d3982c8a01c94acbcec350522d9555e
> # Parent 52e135b90ce2b4719d7f550133a01d895a29c2bc
> histedit: add rule handling for exec
>
> This changeset modifies verifyrules to skip the repo and hash
> related logic since we are executing a command that is agnostic
> to the repo state and context.
>
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -769,24 +769,28 @@
> seen = set()
> for r in rules:
> if ' ' not in r:
> raise util.Abort(_('malformed line "%s"') % r)
> action, rest = r.split(' ', 1)
> - ha = rest.strip().split(' ', 1)[0]
> - try:
> - ha = str(repo[ha]) # ensure its a short hash
> - except error.RepoError:
> - raise util.Abort(_('unknown changeset %s listed') % ha)
> - if ha not in expected:
> - raise util.Abort(
> - _('may not use changesets other than the ones listed'))
> - if ha in seen:
> - raise util.Abort(_('duplicated command for changeset %s') % ha)
> - seen.add(ha)
> + if action not in ('x', 'exec'):
> + args = rest.strip().split(' ', 1)[0]
> + try:
I don't think his option is necessary or needed at all. Histedit doesn't
have any commands to modify the commandslist and I think it shouldn't
be part of histedit to modify the commandset itself. I highly recommend
dropping --exec completly.
More information about the Mercurial-devel
mailing list