Commit Graph

8 Commits

Author SHA1 Message Date
Steve Losh
eea597d740 mq: add parent node IDs to MQ patches on qrefresh/qnew
The goal of this patch is to add the IDs of the parents of applied MQ patches
into the patch file headers whenever qnew or qrefresh are run.

This will serve as a reminder of when the patches last applied cleanly and
will let us do more intelligent things in the future, such as:

    * Resolve conflicts found when qpushing to a new location by merging
      instead of simply showing rejects.

    * Display better diffs of versioned MQ patches because we can tell how the
      patched files have changed in the meantime.

Here are the new rules this patch introduces.  They are checked in this order:

    * If a patch currently has old, plain-style patch headers ("From:" and
      "Date:") do not change the style or add any new headers.

    * If the 'mq.plain' configuration setting is true, only plain-style
      headers will be used for all MQ patches.

    * qnew will initialize new patches with HG-style headers and fill in the
      "# Parent" header with the appropriate parent node.

    * qrefresh will refresh the "# Parent" header with the current parent of
      the current patch.
2010-02-07 10:47:54 -05:00
Yann E. MORIN
b58fccf06d mq: add the date with qrefresh, even if missing (issue1768)
When setting the date with qrefresh (-d|-D), and the patch does have
neither a 'Date:' nor a '# Date' header, add the date field as such:

- if the patch has a 'From:' header, add a 'Date:' header
- otherwise, upgrade to Mercurial extended patch format and add '# Date'
2009-08-12 10:57:27 +02:00
Yann E. MORIN
ac0ee93ebf mq: upgrade the patch to HG format when adding the author name with qrefresh
When setting the author field with qrefresh (-u|-U), and the patch does have
neither a 'From:' nor a '# User' header, add the author name as such:

- if the patch has a 'Date:' header, add a 'From:' header
- otherwise, upgrade to Mercurial extended patch format and add # From
2009-08-12 10:48:18 +02:00
Mads Kiilerich
b3ac6d2456 mq: qpop now tells which patches are popped
When navigating through a patch series by qpushing and qpopping it was easy to
get lost because qpop was silent. I found myself often running qnext after qpop
to see which patch I just dropped - especially if I was about to qrm it. This
patch makes qpop more symmetric to qpush by showing which patches are
applied/"unapplied".

I think it is a good change even though it changes output by adding a new line
of output.
2009-07-09 23:59:03 +02:00
Martin Geisler
dc4fd3bf46 mq: lowercase output
This extension produces quite a lot of informational messages during
its normal operation and it is hard to say which strings can be
changed and which cannot.
2009-01-03 17:15:21 +01:00
Bernhard Leiner
bf4052120f mq: make qnew patch format consistent with qrefresh (issue1457) 2009-01-12 09:12:35 +01:00
Maxim Dounin
690088d7ef test-mq-header: don't fail with different patch(1)
At least under FreeBSD patch(1) won't fail on empty patch and will print
'Hmm...' warning instead. Sanitize output so tests won't fail unexpectedly.
2008-01-08 06:56:21 +03:00
Peter Arrenbrecht
30621bccda mq: add --currentdate and --date options to qnew and qrefresh
These options make qnew add and qrefresh update a "# Date "-style
header line. This allows proper recording of creation / last
modification dates of patches in patch queues.

Note that `qrefresh -D` only updates existing header lines. It never
adds them, and does not warn about this. This is because I expect
people to have `[default] qrefresh -D` in their .hgrc so patches with
tracked dates get updated, others are left unchanged. The suggested
setup in .hgrc is, in fact,

  [default]
  qnew = -D -U
  qrefresh = -D

I tried to not mix header styles, so `qnew -D -U` now writes the user in
"# User "-style, while `qnew -U` still writes it "From: "-style. Also, if
`qrefresh -U` must add the user, it does so in "# User "-style if the
header contains a "# HG changeset patch" line. (This is caused by mq
not supporting the "Date: "-style header line at all - a reasonable choice
given its standard date format.)
2008-01-02 16:24:13 +01:00