[PATCH] Add --setheader, --setuser, --setdate, --user, --date options to qnew and qrefresh

Peter Arrenbrecht peter.arrenbrecht at gmail.com
Thu Dec 6 01:19:33 CST 2007


On Dec 6, 2007 1:05 AM, Brendan Cully <brendan at kublai.com> wrote:
> > ...
> 1. Why not just use the export machinery instead of writing the header by
> hand?

That would take some refactoring of patch.export, I think. I want to
a) write only selected fields and b) leave other fields well alone if
they're present already. In all, I think the duplicated code is
negligible and thus not worth the trouble. But moving the key strings
to constants MQ can reuse sounds desirable.

> 2. MQ almost bends over backwards to avoid destructively altering the
> headers of existing patches, whether they are full email headers or
> just From: lines. I'm not really sure that it needs to try as hard
> as it does, but we should either discuss what needs to be preserved or
> be very careful about altering the header. It could certainly be argued
> that using -U or (the somewhat less useful) -D is an agreement to destroy
> the existing header though.
>

First, I agree about -D. We might consider dropping it altogether, as
this would render all of -H, -D, and -d superfluous, leading to less
option clutter.

But I am a little wary of destroying headers. You never know what
people are using them for. Might even be used by other tools to keep
custom patch annotations in.

-peter


More information about the Mercurial-devel mailing list