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

Brendan Cully brendan at kublai.com
Wed Dec 5 18:05:01 CST 2007


On Wednesday, 05 December 2007 at 21:09, Peter Arrenbrecht wrote:
> Hi all
> 
> This patch adds a UI to the existing option to have "hg export" style
> headers in mq patches. These headers can include the user and date,
> which is what seems interesting in mq patches. Adding the user, in
> particular, allows for proper change attribution in shared patch
> queues.
> 
> The patch tries to be as non-invasive as possible. One consequence is
> that, even if a patch already contains a user and date, neither of
> each is automatically updated on "qrefresh". You have to explicitly do
> "qrefresh -U -D" (or "qrefresh -H" for short) to force the update.

I think this is the right thing to do -- if the user field were
automatically clobbered it would be annoying to use a shared patch queue.

> The patch (hopefully) ensures that "qnew", "qrefresh", and "qpush"
> write the correct user and/or date into the log.
> 
> Comments welcome.

I think this is a great feature. I wonder about two things though:

1. Why not just use the export machinery instead of writing the header by
hand?

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.


More information about the Mercurial-devel mailing list