annotate tests/test-diff-unified.t @ 30442:41a8106789ca

util: implement zstd compression engine Now that zstd is vendored and being built (in some configurations), we can implement a compression engine for zstd! The zstd engine is a little different from existing engines. Because it may not always be present, we have to defer load the module in case importing it fails. We facilitate this via a cached property that holds a reference to the module or None. The "available" method is implemented to reflect reality. The zstd engine declares its ability to handle bundles using the "zstd" human name and the "ZS" internal name. The latter was chosen because internal names are 2 characters (by only convention I think) and "ZS" seems reasonable. The engine, like others, supports specifying the compression level. However, there are no consumers of this API that yet pass in that argument. I have plans to change that, so stay tuned. Since all we need to do to support bundle generation with a new compression engine is implement and register the compression engine, bundle generation with zstd "just works!" Tests demonstrating this have been added. How does performance of zstd for bundle generation compare? On the mozilla-unified repo, `hg bundle --all -t <engine>-v2` yields the following on my i7-6700K on Linux: engine CPU time bundle size vs orig size throughput none 97.0s 4,054,405,584 100.0% 41.8 MB/s bzip2 (l=9) 393.6s 975,343,098 24.0% 10.3 MB/s gzip (l=6) 184.0s 1,140,533,074 28.1% 22.0 MB/s zstd (l=1) 108.2s 1,119,434,718 27.6% 37.5 MB/s zstd (l=2) 111.3s 1,078,328,002 26.6% 36.4 MB/s zstd (l=3) 113.7s 1,011,823,727 25.0% 35.7 MB/s zstd (l=4) 116.0s 1,008,965,888 24.9% 35.0 MB/s zstd (l=5) 121.0s 977,203,148 24.1% 33.5 MB/s zstd (l=6) 131.7s 927,360,198 22.9% 30.8 MB/s zstd (l=7) 139.0s 912,808,505 22.5% 29.2 MB/s zstd (l=12) 198.1s 854,527,714 21.1% 20.5 MB/s zstd (l=18) 681.6s 789,750,690 19.5% 5.9 MB/s On compression, zstd for bundle generation delivers: * better compression than gzip with significantly less CPU utilization * better than bzip2 compression ratios while still being significantly faster than gzip * ability to aggressively tune compression level to achieve significantly smaller bundles That last point is important. With clone bundles, a server can pre-generate a bundle file, upload it to a static file server, and redirect clients to transparently download it during clone. The server could choose to produce a zstd bundle with the highest compression settings possible. This would take a very long time - a magnitude longer than a typical zstd bundle generation - but the result would be hundreds of megabytes smaller! For the clone volume we do at Mozilla, this could translate to petabytes of bandwidth savings per year and faster clones (due to smaller transfer size). I don't have detailed numbers to report on decompression. However, zstd decompression is fast: >1 GB/s output throughput on this machine, even through the Python bindings. And it can do that regardless of the compression level of the input. By the time you have enough data to worry about overhead of decompression, you have plenty of other things to worry about performance wise. zstd is wins all around. I can't wait to implement support for it on the wire protocol and in revlogs.
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 11 Nov 2016 01:10:07 -0800
parents e40343ce9c4c
children 6381a6dbc325
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12141
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
1 $ hg init repo
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
2 $ cd repo
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
3 $ cat > a <<EOF
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
4 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
5 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
6 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
7 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
8 > b
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
9 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
10 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
11 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
12 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
13 > EOF
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
14 $ hg ci -Am adda
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
15 adding a
6467
65029a3aafc2 Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16
12141
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
17 $ cat > a <<EOF
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
18 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
19 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
20 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
21 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
22 > dd
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
23 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
24 > a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
25 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
26 > c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
27 > EOF
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
28
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
29 default context
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
30
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
31 $ hg diff --nodates
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
32 diff -r cf9f4ba66af2 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
33 --- a/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
34 +++ b/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
35 @@ -2,7 +2,7 @@
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
36 c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
37 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
38 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
39 -b
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
40 +dd
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
41 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
42 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
43 c
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
44
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
45 invalid --unified
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
46
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
47 $ hg diff --nodates -U foo
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
48 abort: diff context lines count must be an integer, not 'foo'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12141
diff changeset
49 [255]
12141
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
50
6467
65029a3aafc2 Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51
12141
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
52 $ hg diff --nodates -U 2
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
53 diff -r cf9f4ba66af2 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
54 --- a/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
55 +++ b/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
56 @@ -3,5 +3,5 @@
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
57 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
58 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
59 -b
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
60 +dd
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
61 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
62 a
6467
65029a3aafc2 Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
63
12141
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
64 $ hg --config diff.unified=2 diff --nodates
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
65 diff -r cf9f4ba66af2 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
66 --- a/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
67 +++ b/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
68 @@ -3,5 +3,5 @@
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
69 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
70 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
71 -b
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
72 +dd
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
73 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
74 a
6467
65029a3aafc2 Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
75
12141
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
76 $ hg diff --nodates -U 1
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
77 diff -r cf9f4ba66af2 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
78 --- a/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
79 +++ b/a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
80 @@ -4,3 +4,3 @@
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
81 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
82 -b
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
83 +dd
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
84 a
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
85
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
86 invalid diff.unified
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
87
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
88 $ hg --config diff.unified=foo diff --nodates
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
89 abort: diff context lines count must be an integer, not 'foo'
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12141
diff changeset
90 [255]
12141
5f44daa8fbd0 tests: unify test-diff-unified
Adrian Buehlmann <adrian@cadifra.com>
parents: 7440
diff changeset
91
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
92 noprefix config and option
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
93
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
94 $ hg --config diff.noprefix=True diff --nodates
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
95 diff -r cf9f4ba66af2 a
23299
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
96 --- a
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
97 +++ a
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
98 @@ -2,7 +2,7 @@
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
99 c
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
100 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
101 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
102 -b
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
103 +dd
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
104 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
105 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
106 c
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
107 $ hg diff --noprefix --nodates
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
108 diff -r cf9f4ba66af2 a
23299
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
109 --- a
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
110 +++ a
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
111 @@ -2,7 +2,7 @@
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
112 c
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
113 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
114 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
115 -b
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
116 +dd
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
117 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
118 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
119 c
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
120
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
121 noprefix config disabled in plain mode, but option still enabled
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
122
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
123 $ HGPLAIN=1 hg --config diff.noprefix=True diff --nodates
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
124 diff -r cf9f4ba66af2 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
125 --- a/a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
126 +++ b/a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
127 @@ -2,7 +2,7 @@
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
128 c
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
129 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
130 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
131 -b
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
132 +dd
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
133 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
134 a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
135 c
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
136 $ HGPLAIN=1 hg diff --noprefix --nodates
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
137 diff -r cf9f4ba66af2 a
23299
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
138 --- a
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
139 +++ a
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
140 @@ -2,7 +2,7 @@
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
141 c
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
142 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
143 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
144 -b
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
145 +dd
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
146 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
147 a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
148 c
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
149
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16362
diff changeset
150 $ cd ..
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16362
diff changeset
151
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16362
diff changeset
152
15462
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
153 0 lines of context hunk header matches gnu diff hunk header
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
154
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
155 $ hg init diffzero
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
156 $ cd diffzero
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
157 $ cat > f1 << EOF
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
158 > c2
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
159 > c4
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
160 > c5
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
161 > EOF
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
162 $ hg commit -Am0
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
163 adding f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
164
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
165 $ cat > f2 << EOF
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
166 > c1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
167 > c2
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
168 > c3
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
169 > c4
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
170 > EOF
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
171 $ mv f2 f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
172 $ hg diff -U0 --nodates
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
173 diff -r 55d8ff78db23 f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
174 --- a/f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
175 +++ b/f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
176 @@ -0,0 +1,1 @@
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
177 +c1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
178 @@ -1,0 +3,1 @@
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
179 +c3
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
180 @@ -3,1 +4,0 @@
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
181 -c5
6467
65029a3aafc2 Let --unified default to diff.unified (issue 1076)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
182
15462
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
183 $ hg diff -U0 --nodates --git
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
184 diff --git a/f1 b/f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
185 --- a/f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
186 +++ b/f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
187 @@ -0,0 +1,1 @@
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
188 +c1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
189 @@ -1,0 +3,1 @@
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
190 +c3
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
191 @@ -3,1 +4,0 @@
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
192 -c5
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
193
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
194 $ hg diff -U0 --nodates -p
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
195 diff -r 55d8ff78db23 f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
196 --- a/f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
197 +++ b/f1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
198 @@ -0,0 +1,1 @@
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
199 +c1
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
200 @@ -1,0 +3,1 @@ c2
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
201 +c3
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
202 @@ -3,1 +4,0 @@ c4
2b1ec74c961f mdiff/patch: fix bad hunk handling for unified diffs with zero context
Nicolas Venegas <nvenegas@atlassian.com>
parents: 12316
diff changeset
203 -c5
16362
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
204
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
205 $ echo a > f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
206 $ hg ci -m movef2
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
207
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
208 Test diff headers terminating with TAB when necessary (issue3357)
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
209 Regular diff --nodates, file creation
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
210
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
211 $ hg mv f1 'f 1'
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
212 $ echo b > 'f 1'
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
213 $ hg diff --nodates 'f 1'
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
214 diff -r 7574207d0d15 f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
215 --- /dev/null
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
216 +++ b/f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
217 @@ -0,0 +1,1 @@
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
218 +b
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
219
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
220 Git diff, adding space
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
221
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
222 $ hg diff --git
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
223 diff --git a/f1 b/f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
224 rename from f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
225 rename to f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
226 --- a/f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
227 +++ b/f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
228 @@ -1,1 +1,1 @@
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
229 -a
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
230 +b
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
231
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
232 Git diff with noprefix
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
233
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
234 $ hg --config diff.noprefix=True diff --git --nodates
23300
f8b5c3e77d4b patch.trydiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23299
diff changeset
235 diff --git f1 f 1
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
236 rename from f1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
237 rename to f 1
23299
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
238 --- f1
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
239 +++ f 1
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
240 @@ -1,1 +1,1 @@
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
241 -a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
242 +b
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
243
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
244 noprefix config disabled in plain mode, but option still enabled
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
245
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
246 $ HGPLAIN=1 hg --config diff.noprefix=True diff --git --nodates
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
247 diff --git a/f1 b/f 1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
248 rename from f1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
249 rename to f 1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
250 --- a/f1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
251 +++ b/f 1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
252 @@ -1,1 +1,1 @@
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
253 -a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
254 +b
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
255 $ HGPLAIN=1 hg diff --git --noprefix --nodates
23300
f8b5c3e77d4b patch.trydiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23299
diff changeset
256 diff --git f1 f 1
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
257 rename from f1
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
258 rename to f 1
23299
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
259 --- f1
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
260 +++ f 1
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
261 @@ -1,1 +1,1 @@
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
262 -a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
263 +b
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
264
16362
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
265 Regular diff --nodates, file deletion
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
266
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
267 $ hg ci -m addspace
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
268 $ hg mv 'f 1' f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
269 $ echo a > f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
270 $ hg diff --nodates 'f 1'
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
271 diff -r ca50fe67c9c7 f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
272 --- a/f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
273 +++ /dev/null
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
274 @@ -1,1 +0,0 @@
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
275 -b
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
276
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
277 Git diff, removing space
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
278
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
279 $ hg diff --git
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
280 diff --git a/f 1 b/f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
281 rename from f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
282 rename to f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
283 --- a/f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
284 +++ b/f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
285 @@ -1,1 +1,1 @@
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
286 -b
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
287 +a
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16362
diff changeset
288
24496
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
289 showfunc diff
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
290 $ cat > f1 << EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
291 > int main() {
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
292 > int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
293 > int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
294 > int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
295 > int d = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
296 > return a + b + c + d;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
297 > }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
298 > EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
299 $ hg commit -m addfunction
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
300 $ cat > f1 << EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
301 > int main() {
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
302 > int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
303 > int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
304 > int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
305 > int e = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
306 > return a + b + c + e;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
307 > }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
308 > EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
309 $ hg diff --git
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
310 diff --git a/f1 b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
311 --- a/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
312 +++ b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
313 @@ -2,6 +2,6 @@
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
314 int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
315 int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
316 int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
317 - int d = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
318 - return a + b + c + d;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
319 + int e = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
320 + return a + b + c + e;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
321 }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
322 $ hg diff --config diff.showfunc=True --git
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
323 diff --git a/f1 b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
324 --- a/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
325 +++ b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
326 @@ -2,6 +2,6 @@ int main() {
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
327 int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
328 int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
329 int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
330 - int d = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
331 - return a + b + c + d;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
332 + int e = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
333 + return a + b + c + e;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
334 }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
335
29948
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
336 If [diff] git is set to true, but the user says --no-git, we should
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
337 *not* get git diffs
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
338 $ hg diff --nodates --config diff.git=1 --no-git
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
339 diff -r f2c7c817fa55 f1
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
340 --- a/f1
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
341 +++ b/f1
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
342 @@ -2,6 +2,6 @@
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
343 int a = 0;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
344 int b = 1;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
345 int c = 2;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
346 - int d = 3;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
347 - return a + b + c + d;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
348 + int e = 3;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
349 + return a + b + c + e;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
350 }
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
351
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16362
diff changeset
352 $ cd ..