Commit Graph

10 Commits

Author SHA1 Message Date
Matt Harbison
46014de55c test-diffstat: add a glob the test runner wants on Windows
The test gets a '~' status without it.
2015-03-28 23:57:16 -04:00
Sean Farley
a0d78a3107 diff: rename --relative option to --root
The diff output format is unable to express files outside the directory so it
makes sense to name this option --root instead of --relative.
2015-03-25 11:55:15 -07:00
Siddharth Agarwal
8b07d14666 commands.diff: add support for diffs relative to a subdirectory
Previous patches added all the backend support for this. This exposes this
option in the UI.
2015-03-17 15:46:30 -07:00
Mads Kiilerich
cdcad9a14c check-code: fix check for trailing whitespace on empty lines
It seems like the intention with c4ecbbd282fe was to catch lines with only
one whitespace too.
2012-08-08 18:10:30 +02: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
Jim Hague
78a686772b tests: tighten checks for octal escapes in shell printf.
printf on AIX default shell ksh (89) says \1 is an invalid escape. It insists
on at least 2 digits. This causes failures in test-keyword.t and test-status.t.

check-code.py already looks out for \NNN and recommends using Python
for outputting octal values. Extend the check to \NN and \N and fix up
resulting failures.
2012-02-08 16:56:00 +00:00
Patrick Mezard
1e1f58f358 diffstat: be more picky when marking file as 'binary' (issue2816)
The 'Bin' marker was added to every changed file for which we could not find
any diff changes. This included binary files but also copy/renames and mode
changes. Since Mercurial regular diff format emits a 'Binary file XXX has
changed' line when fed with binary files, we use that and the usual git marker
to tell them from other cases. In particular, new empty files are no longer
reported as binary.

Still, this fix is not complete since copy/renames/mode changes are now
reported as '0' lines changes, instead of 'Bin'.
2011-10-24 13:41:19 +02:00
Steven Brown
b13eee65a4 patch: restore the previous output of 'diff --stat'
Restore the previous diffstat behaviour of scaling by the maximum number of
changes to a single file. Changeset 7bb0e22a7988 modified the diffstat to be
scaled by the total number of changes. This seems to have been unintentional.
2011-05-26 22:51:02 +08:00
Gastón Kleiman
f4afcea9fa diffstat: fix parsing of filenames with spaces
The patch changes the output of "hg diff --stat" when one file whose filename
has spaces has changed, making it get the full filename instead of just the
substring between the last space and the end of the filename.

It also changes the diffstat generated by "hg email -d" when one of the commit
messages starts with "diff". Because of the regex used to parse the filename,
the diffstat generated by "hg email -d" will still be not correct if a commit
message starts with "diff -r ".

Before the patch Mercurial has the following behavior:

$ echo "foobar">"file with spaces"
$ hg add "file with spaces"
$ hg diff --stat
 spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
$ hg diff --git --stat
 file with spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

After the patch:

$ echo "foobar">"file with spaces"
$ hg add "file with spaces"
$ hg diff --stat
 file with spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
$ hg diff --git --stat
 file with spaces |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Before the patch:

$ hg add mercurial/patch.py tests/tests-diffstat.t
$ hg commit -m "diffstat: fix parsing of filenames"

$ hg email -d --test tip
This patch series consists of 1 patches.

diffstat: fix parsing of filenames
[...]

 filenames             |    0
 mercurial/patch.py    |    6 ++++--
 tests/test-diffstat.t |   17 +++++++++++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
[...]

After the patch:

$ hg email -d --test tip
This patch series consists of 1 patches.

diffstat: fix parsing of filenames

[...]

 mercurial/patch.py    |    6 ++++--
 tests/test-diffstat.t |   17 +++++++++++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
[...]
2011-02-04 16:32:14 -03:00
Adrian Buehlmann
6a17e48e91 tests: unify test-diffstat 2010-09-02 16:29:04 +02:00