Commit Graph

64 Commits

Author SHA1 Message Date
Gilles Moris
6e5b8353f9 qpush --move: move the right patch even with comment lines
9af52509546a caused that we find the index of the moving patch in self.series
but look it up in self.full_series. The difference between these is that
full_series also contains comment lines, and we thus moved the wrong patch.

Use back self.full_series to find the moving patch, but take care of striping
the patch guard markers before comparing the patch name. Test cases have been
added for comments and empty lines in self.full_series, and for the case of
guarded patches.

Original patch contributed by Mads Kiilerich <mads@kiilerich.com>
2010-07-10 21:23:00 +02:00
Brodie Rao
6f58bfc15e color/progress: subclass ui instead of using wrapfunction (issue2096)
This resolves the issue of hg cmd --mq not being colorized. This was due
to color wrapping only the instance of ui passed to dispatch._runcommand(),
which isn't the same ui object that mq.mqcommand() receives. After dispatch
calls extensions.loadall(), it makes sure any changes to ui.__class__ in
uisetup are propagated.

progress is updated to wrap ui in the same manner because wrapfunction
doesn't play well when ui.__class__ has been replaced by another extension
(orig will point to the old class method instead of color's).
2010-07-01 19:23:26 -05:00
Dan Villiom Podlaski Christiansen
de6e2d6afa mq: use ui.formatted() instead of ui.plain(). 2010-06-07 15:33:03 +02:00
Yuya Nishihara
0ed2abe6d5 tests: fix bashism to load helpers.sh
`source` isn't available at POSIX sh.
2010-05-21 20:55:18 +09:00
Matt Mackall
a386dc3529 strip: improve full backup message 2010-05-20 12:15:44 -05:00
Matt Mackall
ba577371b4 mq: fix test 2010-05-07 14:14:41 -05:00
Matt Mackall
7a237857b0 mq: add a line to hg summary 2010-05-05 20:53:45 -05:00
Mads Kiilerich
ee95467b21 mq: qpush --move, reorder patch series and apply only the patch
This makes it less necessary to edit .hg/patches/series manually.
2010-04-30 15:05:51 +02:00
Cédric Duval
130a94036a mq: test for init --mq with a destination argument 2010-03-15 20:52:22 +01:00
Cédric Duval
5526bbffdb mq: fix init with nonexistent or non-local repository 2010-03-14 18:46:38 +01:00
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
Patrick Mezard
1cfbc81f15 test-mq: better tests delimitation 2009-12-29 16:00:24 +01:00
Patrick Mezard
f32df1c921 Make {file_copies} usable as a --template key
Before this, to display file copies in templates, you had to write something
like {file_copies%filecopy}. For some reason, the {file_copy} subtemplate was
used by default but not defined by default in changeset_templater, while styles
were already using it. Here we define {file_copy} in changeset_templater, and
change the templater to handle formatting strings like {file_copies%filecopy}
with already expanded keys (in this case {file_copies}), for backward
compatibility.
2009-12-13 18:06:24 +01:00
Patrick Mezard
46b592cdfa templatekw: change {file_copies} behaviour, add {file_copies_switch}
{file_copies} template now displays file copies with or without the --copies
switch being set. A new {file_copies_switch} template implements the former
behaviour.
2009-12-13 18:06:24 +01:00
Nicolas Dumazet
6afdc121ac mq: qpop: remove added files before re-adding removed files
We need to do this to avoid file/directories conflicts.
This causes patches removing a committed file and replacing it
with a directory to be "unpoppable".
2009-12-11 15:09:52 +09:00
Dan Villiom Podlaski Christiansen
d5e8634932 qseries: don't truncate the patch name (issue1912)
Instead of truncating the entire output line of `qseries', only the
summary is truncated.
2009-11-17 22:16:41 +01:00
Brendan Cully
1ce45ec1c3 Allow import --no-commit over an applied MQ patch.
Since it only changes the working directory, it does not matter whether a patch is
applied. This change makes it easier to use hg import --no-commit instead of patch.
2009-11-16 11:31:08 -08:00
Matt Mackall
77949f88d1 Backed out premature qprev/qnext removal 2009-09-14 16:39:24 -05:00
Dirkjan Ochtman
4fc1177ba0 mq: get rid of qnext, qprev and qtop 2009-08-19 12:51:07 +02:00
Dirkjan Ochtman
d825977cb1 mq: add options to qapplied/qunapplied to act like qprev/qnext 2009-08-19 12:50:46 +02:00
Greg Ward
81e6782a86 tags: implement persistent tag caching (issue548).
- rename findglobaltags() to findglobaltags1() (so the "no cache"
  implementation is still there if we need it)
- add findglobaltags2() and make findglobaltags() an alias for it
  (disabling tag caching is a one-line patch)
- factor out tagcache class with methods readcache() and writecache();
  the expensive part of tag finding (iterate over heads and find
  .hgtags filenode) is now in tagcache.readcache()
2009-07-16 10:39:42 -04:00
Martin Geisler
65537ad291 tests: removed redundant "-d '0 0'" from test scripts
The tests are executed with a .hgrc file which adds "-d '0 0'" by
default.
2009-04-26 14:29:02 +02:00
Dirkjan Ochtman
aabce1d60c mq: allow qpop if popped revisions are not working dir parents 2009-01-12 09:07:02 +01:00
Brendan Cully
636630e1d2 mq: put qnew tests into own file, fold in qnew-twice 2008-10-30 12:31:24 -07:00
Brendan Cully
c935fe6e01 mq: abort qnew -f if any file in an explicit list cannot be read 2008-10-18 20:45:53 -07:00
Brendan Cully
203e3723e8 Prevent import over an applied patch (closes issue795) 2008-10-18 13:22:29 -07:00
Benoit Boissinot
66c79ea6b0 merge with -stable 2008-09-22 14:47:21 +02:00
Mads Kiilerich
b80093e190 tests: fix reported patch tool name in test-mq
Strip any path of the patch executable, which it might return on failure.
2008-09-18 13:45:36 +02:00
Dirkjan Ochtman
7863711fa6 mq: don't commit local changes on pushing empty patch (issue1087) 2008-04-16 16:04:07 +02:00
Dirkjan Ochtman
f70807073f merge from crew-stable 2008-04-16 16:07:15 +02:00
Dirkjan Ochtman
ea3191d104 mq: add --force option to strip 2008-04-04 17:44:31 +02:00
Patrick Mezard
107a228e2f patch: check filename is /dev/null for creation or deletion (issue 1033)
Otherwise, file creation or deletion is ambiguous with file being filled or
emptied.
2008-03-16 00:35:12 +01:00
Alexis S. L. Carvalho
56322c7a24 mq: don't allow patches with some reserved names
The current list of reserved names includes only mq control files.

Also, reserve names starting with ".hg" (to avoid troubles with
e.g. .hgignore and .hgtags), and with ".mq" (to allow future
extensions).

This should fix issue841.
2008-02-03 21:03:46 -02:00
Alexis S. L. Carvalho
d4fc1890f0 mqrepo: don't abort if the status file has an unknown node 2008-02-03 21:03:46 -02:00
Patrick Mezard
8ae803be30 mq: avoid qnew committing everything on invalid paths (issue 803)
If paths are supplied but resolve to nothing, localrepo.commit() is called with an empty set and commits the whole dirstate. Avoid this by passing the match function to commit.
2007-11-20 14:31:58 +01:00
Alexis S. L. Carvalho
0086f97dc7 mq: really remove undo after a qpush (and after a strip)
For qpush, removeundo has to be called after the transaction has finished.

strip may use unbundle, which also leaves an undo file.

Fixes issue780.
2007-11-09 20:21:35 -02:00
Brendan Cully
92a19d3a72 mq: fix regression in c5d80ff6828f
It caused qrefresh; qrefresh -X addedfile to leave the file as normal in dirstate.
It should be marked added on the second pass.
2007-09-10 15:00:05 -07:00
Thomas Arendsen Hein
8778149e15 Fix bashism and remove useless use of cat. 2007-07-29 18:53:09 +02:00
Patrick Mezard
55cd10d565 Test qnew --git 2007-07-28 20:15:54 +02:00
Bryan O'Sullivan
3ab73cd145 mq: autodetect an existing git patch during qrefresh (issue 491) 2007-07-16 16:50:47 -07:00
Brendan Cully
98b8fae908 mq: improve qclone error handling when patch directory is not a repository. 2007-07-10 09:52:32 -07:00
Brendan Cully
c7cf8a52b7 mq: add qparent tag (first parent of qbase) 2007-03-14 10:45:18 -07:00
Brendan Cully
5641becd5a Merge with crew-stable 2007-03-10 17:45:32 -08:00
Alexis S. L. Carvalho
d3e0262e32 fix qrefresh'ing an empty patch
This is not superefficient (the commit will have to walk the whole tree),
but it works.
2007-03-10 22:03:23 -03:00
Alexis S. L. Carvalho
86353c5094 qclone: don't call reposetup manually 2007-02-15 08:44:08 -02:00
Alexis S. L. Carvalho
5357b68523 fix strip'ping the second parent of a merge 2007-02-06 15:54:58 -02:00
Alexis S. L. Carvalho
b380c48d7c add some tests for qpush/qpop error codes 2007-02-17 04:50:06 -02:00
Alexis S. L. Carvalho
d4de823a64 merge with crew-stable 2007-02-16 05:27:37 -02:00
Alexis S. L. Carvalho
d8dc29a091 mq: qinit -c creates a repo even after a regular qinit 2007-02-09 03:48:30 -02:00
Alexis S. L. Carvalho
f6e774dd91 qrefresh: fix handling of copies in the fast path 2006-11-20 19:32:43 -02:00