[PATCH] hgext/mq - idempotent operations should return success

Alexis S. L. Carvalho alexis at cecm.usp.br
Wed Feb 7 01:42:19 UTC 2007


Thus spake Ben Thomas:
> One of the items that I've noticed in use of mq is that idempotent
> operations return differing exit statuses.  This makes some scripted
> operations more challenging. In general, I prefer that idempotent
> operations that complete successfully return success.  An example,
[...]
> The attached patch makes a start at having idempotent operations
> return success. The specific cases that I looked at were:
> 
> hg qpush <xxx>
> hg qpop <xxx>
> hg qpush -a
> hg qpop -a

I mostly agree with this, but I really think that qpush without
arguments should return an error if it can't push another patch.
Otherwise you'll break this usage:

    while hg qpush; do
        something
    done

Same thing for qpop - but the error message in both cases could probably
be more friendly (see issue474).

Patches welcome :)  (especially if you can use hg export to generate
them with author and commit message).

Alexis



More information about the Mercurial-devel mailing list