Commit Graph

17 Commits

Author SHA1 Message Date
Mads Kiilerich
600dadebda mq: write '# Parent ' lines with two spaces like export does (BC)
This aligns "Parent" node IDs with "Node ID" node IDs.
2014-09-24 01:36:44 +02:00
Mads Kiilerich
8c41a3576b mq: correctly make an empty line after description in new patches
There would in some cases be an empty line between headers and the description -
that does not seem right.

There should also be an empty line between description and diff - but that was
missing.

These two mistakes would sometimes make it up for each other so we fix both at
once to just show the improvement.

Instead of writing an extra newline when writing a header line, write an extra
line when it not is written as a part of the description but is necessary
anyway.
2014-09-20 17:06:56 +02:00
Adrian Buehlmann
fcd58e2e2a test-mq-qrefresh: test that the patch at qtip is indeed empty
...after qrefreshing a non-existent file
2012-11-08 11:54:08 +01:00
Adrian Buehlmann
e6900cf097 test-mq-qrefresh: adapt for Windows after 94dce4b70643
Fixes

  @@ -208,7 +208,7 @@
     $ echo 'orphan' > orphanchild
     $ hg add orphanchild
     $ hg qrefresh nonexistentfilename # clear patch
  -  nonexistentfilename: No such file or directory
  +  nonexistentfilename: The system cannot find the file specified
     $ hg qrefresh --short 1/base
     $ hg qrefresh --short 2/base

on Windows
2012-11-02 20:22:09 +01:00
Durham Goode
a2ecd990ef mq: fix qrefresh case sensitivity (issue3271)
When calling qrefresh with filenames, the filenames were being
treated as case-sensistive on case-insensitive file systems.
So 'qrefresh foo' would not match file 'Foo', and it failed silently.
This fix makes it work correctly on case-insensitive file systems.

Previously the matching function was applied directly to the filenames.
Now we apply the matching function through repo.status, which handles
the case logic for us. A side effect of using repo.status is that
if the qrefresh file doesn't exist, there is output stating it
doesn't exist.

Adds a test to an existing mq refresh case test.
2012-10-30 13:19:06 -07:00
timeless@mozdev.org
f029229d67 spelling: nonexistent 2012-08-17 13:58:18 -07:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Pierre-Yves David
d05f57b256 qrefresh: keep changeset phase during refresh 2012-01-30 17:36:30 +01:00
Patrick Mezard
d4b7db6294 patch: use temporary files to handle intermediate copies
git patches may require copies to be handled out-of-order. For instance, take
the following sequence:

  * modify a
  * copy a into b

Here, we have to generate b from a before its modification. To do so,
applydiff() was scanning for copy metadata and performing the copies before
processing the other changes in-order. While smart and efficient, this approach
complicates things by handling file copies and file creations at different
places and times. While a new file must not exist before being patched a copied
file already exists before applying the first hunk.

Instead of copying the files at their final destination before patching, we
store them in a temporary file location and retrieve them when patching. The
filestore always stores file content in real files but nothing prevents adding
a cache layer. The filestore class was kept separate from fsbackend for at
least two reasons:

- This class is likely to be reused as a temporary result store for a future
  repository patching call (entries just have to be extended to contain copy
  sources).

- Delegating this role to backends might be more efficient in a repository
  backend case: the source files are already available in the repository itself
  and do not need to be copied again. It also means that third-parties backend
  would have to implement two other methods. If we ever decide to merge the
  filestore feature into backend, a minimalistic approach would be to compose
  with filestore directly. Keep in mind this copy overhead only applies for
  copy/rename sources, and may even be reduced to copy sources which have to
  handled ahead of time.
2011-05-27 21:50:10 +02:00
Martin Geisler
f881346b4c mq: do not let qrefresh write bad patch 2011-03-13 16:18:46 +01:00
Kevin Bullock
ed11f126c8 backout 0880564992de 2010-12-07 22:14:43 -06:00
Kevin Bullock
27dec28da2 mq: fix failing qrefresh test
Additions to test-mq-qrefresh.t in 0880564992de (mq: ignore subrepos
(issue2499)) were originally based on a version prior to 42fb7ef18fb4
(subrepo: handle missing subrepo spec file as removed). This fixes a
test failure that resulted from the former being applied after the
latter, noticed by abuehl.
2010-11-25 21:50:41 -06:00
Kevin Bullock
79f5039252 mq: ignore subrepos (issue2499)
If MQ allows modifying .hgsub or .hgsubstate in a patch, it can easily
lead to an inconsistent subrepo state. This patch prevents qrefresh from
adding any modifications to .hgsub or .hgsubstate to a patch. The user
is warned that these files are not included in the patch.

The tests test both the slightly irrational and the pathological cases.
2010-11-16 13:06:07 -06: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
Adrian Buehlmann
a8ea57a0d0 tests: unify some of test-mq* 2010-09-19 23:42:18 +02:00