Commit Graph

48 Commits

Author SHA1 Message Date
Patrick Mezard
d775dd04bb mq: backup local changes in qpush --force
qpush help says the following about --force:
1- When -f/--force is applied, all local changes in patched files will
   be lost.
2- Apply on top of local changes

In practice, qpush --force will attempt to apply the patch on top of
local changes, and on success will merge them in the pushed patch. On
failure, patched files will contain a mix of local changes (where the
patch could not apply) and a mix of patch changes (were it applied). So,
local changes are less lost than entangled with a mass of other changes.

This patch makes qpush --force backup all locally modified files touched
by the next patch being applied. When multiple patches are being pushed,
this logic is repeated for each patch. Note that modified but
successfully patched files are preserved as well.
2012-05-11 16:18:47 +02:00
Matt Mackall
309ca70823 merge stable 2012-04-01 15:34:22 -05:00
FUJIWARA Katsunori
18786dc9ad tests: fix portability of sed usage in test-mq
on some platform (Mac OS X and Solaris, at least), to insert new text
line, sed function 'i' should be followed by:

  - backslash('\'),
  - new-line,
  - text to be inserted and
  - new-line

GNU sed on Linux can recognize both previous and new ones as same
modification request.

in addition to it, this patch avoids to use '-i' option for sed,
because it is not so portable, as noted in WritingTests wiki page.
2012-04-01 18:18:48 +09:00
Matt Mackall
73319d495a merge with stable 2012-03-31 14:05:10 -05:00
Matt Mackall
bd79d24af7 tests: fix portability of sed expression in test-mq 2012-03-31 13:46:46 -05:00
Matt Mackall
5a705b3a5d merge with stable 2012-03-30 14:35:06 -05:00
Mads Kiilerich
08bbe3eb2b mq: fix qpush --move with comments in series file between applied patches
The 'start' variable pointed to qtip in self.series, but it was used for
indexing self.fullseries.

When fullseries had holes and the patch was moved to self.fullseries[start]
it would end up too early in self.series and it could thus not be
found in self.series[start:] and it would crash.

Now the 'fullstart' index in fullseries is found used instead.
2012-03-29 00:35:00 +02:00
Matt Mackall
7f2dc15daf merge with stable 2012-03-27 14:37:17 -05:00
Pierre-Yves David
a6a8d8d05e qfinish: comply with the phases.new-commit option in secret mode (issue3335)
In secret mode qfinished changeset were move to the draft phase in all case[1]
without regard to phases.new-commit value

This changeset ensure qfinish does not automatically promote a changeset
further than the phases.new-commit value.

Note: This may also result in qfinished changeset made public if
phases.new-commit is set to public.

[1] "In all case" where parent have a compatible phase. Qfinish keep never
    altering phases of changeset not involved in the qfinish.
2012-03-24 12:06:49 +01:00
Patrick Mezard
9d058db6bd mq: fix qapplied --last and qprev documentation (issue3282)
qapplied --last is qprev not qtop.

v2:
- Replace "previous" with "preceding" as suggested here and there
2012-02-27 18:23:18 +01:00
Matt Mackall
38ab0032cb merge with stable 2012-02-28 21:17:53 -06:00
Matt Mackall
272058d456 mq: expand qimport summary 2012-02-22 17:41:22 -06:00
Patrick Mezard
b7f936bb8a mq: make qprev return the previous applied patch (issue3245)
The current behaviour is to return the previous one in the series but at the
same time the implementation is buggy because it does not take guarded patches
in account.
2012-02-03 19:47:09 +01:00
Patrick Mezard
0b8c39f5e8 mq: fix qnext when all remaining patches are guarded
When all remaining patches are guarded, qnext used to return the last of the
queue anyway.
2012-02-03 19:38:31 +01:00
Patrick Mezard
33314514c3 test-mq: fix sed call on OSX
- The regular sed on OSX wants: -i "" not -i""
- GNU sed wants: -i"" not -i ""

Backups are fine.
2012-02-03 19:23:13 +01:00
Matt Mackall
94245d0910 mq: fix secret description in help 2012-01-30 16:04:14 -06:00
Pierre-Yves David
13fe947391 qfinish: do not set secret changeset to draft if mq.secret=false
If mq.secret=false, mq should not touch phase
2012-01-30 15:17:08 +01:00
Pierre-Yves David
24ebf577e2 mq: take mq.secret configuration into account when picking the default phase 2012-01-30 17:39:05 +01:00
Matt Mackall
f549014354 mq: add secret setting 2012-01-29 12:59:21 -06:00
Pierre-Yves David
f813e53446 mq-safety: don't apply safety on non-outgoing changeset
When mq changeset are secret, they don't appear in outgoing and won't be
pushed. So it's not necessary to abort the push.

The checkpush call is protected by lock to prevent race on phase.
2012-01-20 18:45:29 +01:00
Pierre-Yves David
3025e16875 mq: have mq create secret changeset only 2012-01-18 16:53:49 +01:00
Olav Reinert
c5f1adceef help: fix column alignment in "hg help" output
The output of "hg help" is changed to ensure that the column containing
descriptions of commands, extensions, and other topics is correctly alignmened.
2012-01-11 18:14:55 +01:00
FUJIWARA Katsunori
8a4c96d3b4 icasefs: add test for case preservation on case insensitive filesystem
"hg qpush" causes unexpected behavior, if case preservation on case
insensitive filesystem is not enough.

this patch adds the test using mixed-case filenames to reproduce this
problem on any case insensitive filesystems.
2011-12-24 19:16:36 +09:00
Mads Kiilerich
8c22a0ec28 tests: make (glob) on windows accept \ instead of /
Globbing is usually used for filenames, so on windows it is reasonable and very
convenient that glob patterns accepts '\' or '/' when the pattern specifies
'/'.
2011-11-07 03:25:10 +01:00
Mads Kiilerich
adfff587c7 tests: use 'hghave execbit' for tests that manipulate x bit in file system 2011-11-07 03:14:54 +01:00
Idan Kamara
73a82e0b84 backout of a52e14fe37fb: allow to qpop/push with a dirty working copy
The new behavior was breaking existing tools that relied on a sequence such as
this:

1) start with a dirty working copy
2) qimport some patch
3) try to qpush it
4) old behavior would fail at this point due to outstanding changes.
   (new behavior would only fail if the outstanding changes and the patches
   changes intersect)
5) innocent user qrefreshes, gets his local changes in the imported patch

It's worth considering if we can move this behavior to -f in the future.
2011-06-24 23:25:42 +03:00
Martin Geisler
57e33178d6 mq: print "'foo' 'bar'", not "['foo', 'bar']" when showing guards
The internal list representation of guards was leaking into the
output. The guards were always printed using repr(guard) and that
style was kept.

When "hg qguard -l" prints several guards for a patch, it does so by
joining the names with " " and that style was used for the error
messages too.
2011-05-31 08:47:16 +02:00
Patrick Mezard
45494955e5 mq: fix qpush changes detection of renamed files
patch.changedfile() was not considering renamed file source as changed.
2011-05-17 23:27:58 +02:00
Idan Kamara
707c7fe40d mq: allow to qpop/push with a dirty working copy (issue2780)
It's safe to do so if the sets of changed files in the
working copy and patches are disjoint.
2011-05-06 19:55:46 +03:00
Idan Kamara
7489f95c93 mq: add a 'mq()' revset predicate that returns applied mq csets 2011-05-06 16:07:35 +03:00
Idan Kamara
64876670a4 mq: don't suggest to refresh when qpushing with no applied patches 2011-05-04 23:12:23 +03:00
Peter Arrenbrecht
5fbc4a50f1 localrepo: reuse parent manifest in commitctx if no files have changed
This speeds up the in-memory version of debugbuilddag that I'm
working on considerably for the case where we want to build just
a 00changelog.i (for discovery tests, for instance).

There are a couple of test changes because node ids in tests
have changed.

The changes to the patch names in test-mq-qdelete.t were required
because they could collide with nodeid abbreviations and newly
actually do (patch "c" collides with id "cafe..." for patch "b").
2011-05-02 19:20:29 +02:00
Danek Duvall
e826f21afa color: add support for terminfo-based attributes and color
Using terminfo instead of hard-coding ECMA-48 control sequences provides a
greater assurance that the terminal codes are correct for the current
terminal type; not everything supports the ANSI escape codes.

It also allows us to use a wider range of colors when a terminal emulator
supports it (such as 16- or 256-color xterm), and a few more non-color
attributes, such as the ever-popular blink.
2011-04-21 13:47:45 -07:00
Pierre-Yves David
fa5d7584dd mq: gracefully handle malformated status file
This patch prevent mq to crash when .hg/patches/status contains Malformed lines
(without ":"). Blank lines are ignored and other malformed lines issue a
warning.
2011-02-11 13:10:39 +01:00
jfh
a52d7e5744 move tags.cache and branchheads.cache to a collected cache folder .hg/cache/
The generation of cache files like tags.cache and branchheads.cache is not an
actual reflection of things changing in the whole of the .hg directory (like eg
a commit or a rebase or something) but instead these cache files are just part
of bookkeeping. As such its convienant to allow various clients to ignore file
events to do with these cache files which would otherwise cause a double
refresh. Eg one refresh might occur after a commit, but the act of refreshing
after the commit would cause Mercurial to generate a new branchheads.cache which
would then cause a second refresh, for clients.

However if these cache files are moved into a directory like eg .hg/cache/ then
GUI clients on OSX (and possibly other platforms) can happily ignore file events
in this cache directory.
2011-01-04 06:29:08 +01:00
Martin Geisler
d2eec2cbbc commands: clarify which aliases "hg help -v" show (issue2572) 2011-01-05 10:47:35 +01:00
Mads Kiilerich
635406bf76 tests: use (esc) for all non-ASCII test output 2010-11-08 01:41:41 +01:00
Mads Kiilerich
3174ff376b tests: remove redundant globs
Many globs now just match $TESTTMP and is no longer needed.
2010-10-08 22:36:10 -05:00
Martin Geisler
3d112b3042 tests: added a short description to issue numbers
Many tests already had a short line to describe what IssueXXX is
about. I find that quite useful when reading a test.
2010-09-24 10:13:49 +02:00
Brodie Rao
b5fe0d906e tests: add glob matching for unified tests
This adds a " (glob)" marker that works like a simpler version of
(re): "*" is converted to ".*", and "?" is converted to ".".

Both special characters can be escaped using "\", and the backslash
itself can be escaped as well.

Other glob-style syntax, like "**", "[chars]", or "[!chars]", isn't
supported.
2010-09-22 16:06:02 -05:00
Brodie Rao
7d7d96bd74 tests: require regexes in unified tests to be marked with " (re)"
Consider this test:

  $ hg glog --template '{rev}:{node|short} "{desc}"\n'
  @  2:20c4f79fd7ac "3"
  |
  | o  1:38f24201dcab "2"
  |/
  o  0:2a18120dc1c9 "1"

Because each line beginning with "|" can be compiled as a regular
expression (equivalent to ".*|"), they will match any output.

Similarly:

  $ echo foo


The blank output line can be compiled as a regular expression and will
also match any output.

With this patch, none of the above output lines will be matched as
regular expressions. A line must end in " (re)" in order to be matched
as one.

Lines are still matched literally first, so the following will pass:

  $ echo 'foo (re)'
  foo (re)
2010-09-22 16:06:00 -05:00
Matt Mackall
ac660e9f65 tests: cleanup exit code handling in unified tests 2010-09-21 16:00:02 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Nicolas Dumazet
fc08569136 tests: remove useless grep -v in test-mq.t 2010-08-30 13:11:32 +09:00
Martin Geisler
cb36142754 Merge with stable 2010-08-29 22:55:37 +02:00
Dan Villiom Podlaski Christiansen
5e79668de4 mq: extend support for the --mq argument to extension commands
This allows commands like `purge' to accept the --mq option.
2010-08-13 16:05:08 +02:00
Nicolas Dumazet
50e850ed44 tests: use regular expressions instead of helpers 2010-08-16 10:58:03 +09:00
Nicolas Dumazet
b071cff3e6 tests: unify test-mq 2010-08-15 21:41:45 +09:00