annotate tests/test-diff-unified.t @ 51518:c7e81615b5c4

branchcache: add some blank line in a test This helps each section to stand out.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 27 Feb 2024 15:33:21 +0100
parents 67064c238ae7
children
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'
48365
67064c238ae7 errors: use detailed exit code for non-integer number of diff context lines
Martin von Zweigbergk <martinvonz@google.com>
parents: 46529
diff changeset
49 [10]
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'
48365
67064c238ae7 errors: use detailed exit code for non-integer number of diff context lines
Martin von Zweigbergk <martinvonz@google.com>
parents: 46529
diff changeset
90 [10]
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
30807
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
232 Git diff, adding extended headers
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
233
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
234 $ hg diff --git --config experimental.extendedheader.index=7 --config experimental.extendedheader.similarity=True
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
235 diff --git a/f1 b/f 1
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
236 similarity index 0%
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
237 rename from f1
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
238 rename to f 1
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
239 index 7898192..6178079 100644
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
240 --- a/f1
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
241 +++ b/f 1
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
242 @@ -1,1 +1,1 @@
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
243 -a
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
244 +b
6381a6dbc325 patch: use opt.showsimilarity to calculate and show the similarity
Sean Farley <sean@farley.io>
parents: 29948
diff changeset
245
30819
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
246 $ hg diff --git --config experimental.extendedheader.index=-1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
247 invalid length for extendedheader.index: '-1'
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
248 diff --git a/f1 b/f 1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
249 rename from f1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
250 rename to f 1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
251 --- a/f1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
252 +++ b/f 1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
253 @@ -1,1 +1,1 @@
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
254 -a
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
255 +b
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
256
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
257 $ hg diff --git --config experimental.extendedheader.index=whatever
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
258 invalid value for extendedheader.index: 'whatever'
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
259 diff --git a/f1 b/f 1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
260 rename from f1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
261 rename to f 1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
262 --- a/f1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
263 +++ b/f 1
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
264 @@ -1,1 +1,1 @@
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
265 -a
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
266 +b
897726622877 patch: check length of git index header only if integer is specified
Yuya Nishihara <yuya@tcha.org>
parents: 30807
diff changeset
267
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
268 Git diff with noprefix
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
269
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
270 $ 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
271 diff --git f1 f 1
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
272 rename from f1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
273 rename to f 1
23299
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
274 --- f1
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
275 +++ f 1
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
276 @@ -1,1 +1,1 @@
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
277 -a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
278 +b
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
279
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
280 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
281
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
282 $ 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
283 diff --git a/f1 b/f 1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
284 rename from f1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
285 rename to f 1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
286 --- a/f1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
287 +++ b/f 1
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
288 @@ -1,1 +1,1 @@
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
289 -a
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
290 +b
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
291 $ HGPLAIN=1 hg diff --git --noprefix --nodates
23300
f8b5c3e77d4b patch.trydiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23299
diff changeset
292 diff --git f1 f 1
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
293 rename from f1
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
294 rename to f 1
23299
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
295 --- f1
1f510efcd5f3 mdiff.unidiff: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 23298
diff changeset
296 +++ f 1
23298
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
297 @@ -1,1 +1,1 @@
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
298 -a
dc4d0c7b7d94 diff: add a --noprefix option
Siddharth Agarwal <sid0@fb.com>
parents: 23297
diff changeset
299 +b
23297
d7abae94a7a0 patch.diffopts: add support for noprefix
Siddharth Agarwal <sid0@fb.com>
parents: 16912
diff changeset
300
16362
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
301 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
302
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
303 $ hg ci -m addspace
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
304 $ 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
305 $ echo a > f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
306 $ 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
307 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
308 --- a/f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
309 +++ /dev/null
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
310 @@ -1,1 +0,0 @@
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
311 -b
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
312
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
313 Git diff, removing space
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
314
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
315 $ hg diff --git
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
316 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
317 rename from f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
318 rename to f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
319 --- a/f 1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
320 +++ b/f1
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
321 @@ -1,1 +1,1 @@
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
322 -b
16b75661828e mdiff: fix diff header generation for files with spaces (issue3357)
Patrick Mezard <patrick@mezard.eu>
parents: 16012
diff changeset
323 +a
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16362
diff changeset
324
24496
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
325 showfunc diff
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
326 $ cat > f1 << EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
327 > int main() {
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
328 > int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
329 > int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
330 > int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
331 > int d = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
332 > return a + b + c + d;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
333 > }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
334 > EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
335 $ hg commit -m addfunction
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
336 $ cat > f1 << EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
337 > int main() {
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
338 > int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
339 > int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
340 > int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
341 > int e = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
342 > return a + b + c + e;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
343 > }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
344 > EOF
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
345 $ hg diff --git
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
346 diff --git a/f1 b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
347 --- a/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
348 +++ b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
349 @@ -2,6 +2,6 @@
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
350 int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
351 int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
352 int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
353 - int d = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
354 - return a + b + c + d;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
355 + int e = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
356 + return a + b + c + e;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
357 }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
358 $ 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
359 diff --git a/f1 b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
360 --- a/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
361 +++ b/f1
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
362 @@ -2,6 +2,6 @@ int main() {
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
363 int a = 0;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
364 int b = 1;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
365 int c = 2;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
366 - int d = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
367 - return a + b + c + d;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
368 + int e = 3;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
369 + return a + b + c + e;
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
370 }
9a4ef1b18cae tests: add testing for diff.showfunc
Mathias De Maré <mathias.demare@gmail.com>
parents: 23300
diff changeset
371
29948
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
372 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
373 *not* get git diffs
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
374 $ 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
375 diff -r f2c7c817fa55 f1
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
376 --- a/f1
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
377 +++ b/f1
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
378 @@ -2,6 +2,6 @@
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
379 int a = 0;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
380 int b = 1;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
381 int c = 2;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
382 - int d = 3;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
383 - return a + b + c + d;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
384 + int e = 3;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
385 + return a + b + c + e;
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
386 }
e40343ce9c4c diffopts: notice a negated boolean flag in diffopts
Augie Fackler <augie@google.com>
parents: 24496
diff changeset
387
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16362
diff changeset
388 $ cd ..
36414
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
389
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
390 Long function names should be abbreviated, but multi-byte character shouldn't
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
391 be broken up
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
392
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
393 $ hg init longfunc
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
394 $ cd longfunc
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
395
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
396 >>> with open('a', 'wb') as f:
37369
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
397 ... f.write(b'a' * 39 + b'bb' + b'\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
398 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
399 ... f.write(b' 0 b\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
400 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
401 ... f.write(b'a' * 39 + b'\xc3\xa0' + b'\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
402 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
403 ... f.write(b' 0 a with grave (single code point)\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
404 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
405 ... f.write(b'a' * 39 + b'a\xcc\x80' + b'\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
406 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
407 ... f.write(b' 0 a with grave (composition)\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
408 ... f.write(b' .\n' * 3) and None
36414
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
409 $ hg ci -qAm0
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
410
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
411 >>> with open('a', 'wb') as f:
37369
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
412 ... f.write(b'a' * 39 + b'bb' + b'\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
413 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
414 ... f.write(b' 1 b\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
415 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
416 ... f.write(b'a' * 39 + b'\xc3\xa0' + b'\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
417 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
418 ... f.write(b' 1 a with grave (single code point)\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
419 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
420 ... f.write(b'a' * 39 + b'a\xcc\x80' + b'\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
421 ... f.write(b' .\n' * 3) and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
422 ... f.write(b' 1 a with grave (composition)\n') and None
22f19da5736e py3: suppress output from f.write() function class
Pulkit Goyal <7895pulkit@gmail.com>
parents: 36414
diff changeset
423 ... f.write(b' .\n' * 3) and None
36414
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
424 $ hg ci -m1
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
425
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
426 $ hg diff -c1 --nodates --show-function
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
427 diff -r 3e92dd6fa812 -r a256341606cb a
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
428 --- a/a
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
429 +++ b/a
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
430 @@ -2,7 +2,7 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
431 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
432 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
433 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
434 - 0 b
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
435 + 1 b
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
436 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
437 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
438 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
439 @@ -10,7 +10,7 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\xc3\xa0 (esc)
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
440 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
441 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
442 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
443 - 0 a with grave (single code point)
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
444 + 1 a with grave (single code point)
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
445 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
446 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
447 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
448 @@ -18,7 +18,7 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\xcc\x80 (esc)
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
449 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
450 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
451 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
452 - 0 a with grave (composition)
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
453 + 1 a with grave (composition)
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
454 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
455 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
456 .
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
457
44c4a38bf563 diff: do not split function name if character encoding is unknown
Yuya Nishihara <yuya@tcha.org>
parents: 30819
diff changeset
458 $ cd ..
46528
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
459
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
460 Make sure `hg diff --git` differentiate "file did not exists" and "file is empty"
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
461 for git blob oids
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
462
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
463 $ hg init bloboids
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
464 $ cd bloboids
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
465
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
466 $ touch a
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
467 $ hg ci -Am "empty a"
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
468 adding a
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
469 $ hg diff -c 0 --git --config experimental.extendedheader.index=full | grep index
46529
33350debb480 patch: make diff --git to differentiate b/w file is empty or doesn't exists
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 46528
diff changeset
470 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644
46528
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
471
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
472 Make sure `hg diff --git` differentiate "file was empty" and "file is removed"
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
473 for git blob oids
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
474
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
475 $ rm a
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
476 $ hg ci -Am "removed a"
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
477 removing a
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
478 $ hg diff -c 1 --git --config experimental.extendedheader.index=full | grep index
46529
33350debb480 patch: make diff --git to differentiate b/w file is empty or doesn't exists
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 46528
diff changeset
479 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 100644
46528
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
480
df44bac9413d tests: add a test to demonstrate a bug in `hg diff --git` (issue6486)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 37369
diff changeset
481 $ cd ..