##// END OF EJS Templates
tests: accept output changes by 33350debb480...
Sushil khanchi -
r47350:04920025 stable
parent child Browse files
Show More
@@ -1,290 +1,290 b''
1 #require execbit
1 #require execbit
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > autodiff = $TESTDIR/autodiff.py
5 > autodiff = $TESTDIR/autodiff.py
6 > [diff]
6 > [diff]
7 > nodates = 1
7 > nodates = 1
8 > EOF
8 > EOF
9
9
10 $ hg init repo
10 $ hg init repo
11 $ cd repo
11 $ cd repo
12
12
13
13
14
14
15 make a combination of new, changed and deleted file
15 make a combination of new, changed and deleted file
16
16
17 $ echo regular > regular
17 $ echo regular > regular
18 $ echo rmregular > rmregular
18 $ echo rmregular > rmregular
19 $ "$PYTHON" -c "open('bintoregular', 'wb').write(b'\0')"
19 $ "$PYTHON" -c "open('bintoregular', 'wb').write(b'\0')"
20 $ touch rmempty
20 $ touch rmempty
21 $ echo exec > exec
21 $ echo exec > exec
22 $ chmod +x exec
22 $ chmod +x exec
23 $ echo rmexec > rmexec
23 $ echo rmexec > rmexec
24 $ chmod +x rmexec
24 $ chmod +x rmexec
25 $ echo setexec > setexec
25 $ echo setexec > setexec
26 $ echo unsetexec > unsetexec
26 $ echo unsetexec > unsetexec
27 $ chmod +x unsetexec
27 $ chmod +x unsetexec
28 $ echo binary > binary
28 $ echo binary > binary
29 $ "$PYTHON" -c "open('rmbinary', 'wb').write(b'\0')"
29 $ "$PYTHON" -c "open('rmbinary', 'wb').write(b'\0')"
30 $ hg ci -Am addfiles
30 $ hg ci -Am addfiles
31 adding binary
31 adding binary
32 adding bintoregular
32 adding bintoregular
33 adding exec
33 adding exec
34 adding regular
34 adding regular
35 adding rmbinary
35 adding rmbinary
36 adding rmempty
36 adding rmempty
37 adding rmexec
37 adding rmexec
38 adding rmregular
38 adding rmregular
39 adding setexec
39 adding setexec
40 adding unsetexec
40 adding unsetexec
41 $ echo regular >> regular
41 $ echo regular >> regular
42 $ echo newregular >> newregular
42 $ echo newregular >> newregular
43 $ rm rmempty
43 $ rm rmempty
44 $ touch newempty
44 $ touch newempty
45 $ rm rmregular
45 $ rm rmregular
46 $ echo exec >> exec
46 $ echo exec >> exec
47 $ echo newexec > newexec
47 $ echo newexec > newexec
48 $ echo bintoregular > bintoregular
48 $ echo bintoregular > bintoregular
49 $ chmod +x newexec
49 $ chmod +x newexec
50 $ rm rmexec
50 $ rm rmexec
51 $ chmod +x setexec
51 $ chmod +x setexec
52 $ chmod -x unsetexec
52 $ chmod -x unsetexec
53 $ "$PYTHON" -c "open('binary', 'wb').write(b'\0\0')"
53 $ "$PYTHON" -c "open('binary', 'wb').write(b'\0\0')"
54 $ "$PYTHON" -c "open('newbinary', 'wb').write(b'\0')"
54 $ "$PYTHON" -c "open('newbinary', 'wb').write(b'\0')"
55 $ rm rmbinary
55 $ rm rmbinary
56 $ hg addremove -s 0
56 $ hg addremove -s 0
57 adding newbinary
57 adding newbinary
58 adding newempty
58 adding newempty
59 adding newexec
59 adding newexec
60 adding newregular
60 adding newregular
61 removing rmbinary
61 removing rmbinary
62 removing rmempty
62 removing rmempty
63 removing rmexec
63 removing rmexec
64 removing rmregular
64 removing rmregular
65
65
66 git=no: regular diff for all files
66 git=no: regular diff for all files
67
67
68 $ hg autodiff --git=no
68 $ hg autodiff --git=no
69 diff -r a66d19b9302d binary
69 diff -r a66d19b9302d binary
70 Binary file binary has changed
70 Binary file binary has changed
71 diff -r a66d19b9302d bintoregular
71 diff -r a66d19b9302d bintoregular
72 Binary file bintoregular has changed
72 Binary file bintoregular has changed
73 diff -r a66d19b9302d exec
73 diff -r a66d19b9302d exec
74 --- a/exec
74 --- a/exec
75 +++ b/exec
75 +++ b/exec
76 @@ -1,1 +1,2 @@
76 @@ -1,1 +1,2 @@
77 exec
77 exec
78 +exec
78 +exec
79 diff -r a66d19b9302d newbinary
79 diff -r a66d19b9302d newbinary
80 Binary file newbinary has changed
80 Binary file newbinary has changed
81 diff -r a66d19b9302d newexec
81 diff -r a66d19b9302d newexec
82 --- /dev/null
82 --- /dev/null
83 +++ b/newexec
83 +++ b/newexec
84 @@ -0,0 +1,1 @@
84 @@ -0,0 +1,1 @@
85 +newexec
85 +newexec
86 diff -r a66d19b9302d newregular
86 diff -r a66d19b9302d newregular
87 --- /dev/null
87 --- /dev/null
88 +++ b/newregular
88 +++ b/newregular
89 @@ -0,0 +1,1 @@
89 @@ -0,0 +1,1 @@
90 +newregular
90 +newregular
91 diff -r a66d19b9302d regular
91 diff -r a66d19b9302d regular
92 --- a/regular
92 --- a/regular
93 +++ b/regular
93 +++ b/regular
94 @@ -1,1 +1,2 @@
94 @@ -1,1 +1,2 @@
95 regular
95 regular
96 +regular
96 +regular
97 diff -r a66d19b9302d rmbinary
97 diff -r a66d19b9302d rmbinary
98 Binary file rmbinary has changed
98 Binary file rmbinary has changed
99 diff -r a66d19b9302d rmexec
99 diff -r a66d19b9302d rmexec
100 --- a/rmexec
100 --- a/rmexec
101 +++ /dev/null
101 +++ /dev/null
102 @@ -1,1 +0,0 @@
102 @@ -1,1 +0,0 @@
103 -rmexec
103 -rmexec
104 diff -r a66d19b9302d rmregular
104 diff -r a66d19b9302d rmregular
105 --- a/rmregular
105 --- a/rmregular
106 +++ /dev/null
106 +++ /dev/null
107 @@ -1,1 +0,0 @@
107 @@ -1,1 +0,0 @@
108 -rmregular
108 -rmregular
109
109
110 git=yes: git diff for single regular file
110 git=yes: git diff for single regular file
111
111
112 $ hg autodiff --git=yes regular
112 $ hg autodiff --git=yes regular
113 diff --git a/regular b/regular
113 diff --git a/regular b/regular
114 --- a/regular
114 --- a/regular
115 +++ b/regular
115 +++ b/regular
116 @@ -1,1 +1,2 @@
116 @@ -1,1 +1,2 @@
117 regular
117 regular
118 +regular
118 +regular
119
119
120 git=auto: regular diff for regular files and non-binary removals
120 git=auto: regular diff for regular files and non-binary removals
121
121
122 $ hg autodiff --git=auto regular newregular rmregular rmexec
122 $ hg autodiff --git=auto regular newregular rmregular rmexec
123 diff -r a66d19b9302d newregular
123 diff -r a66d19b9302d newregular
124 --- /dev/null
124 --- /dev/null
125 +++ b/newregular
125 +++ b/newregular
126 @@ -0,0 +1,1 @@
126 @@ -0,0 +1,1 @@
127 +newregular
127 +newregular
128 diff -r a66d19b9302d regular
128 diff -r a66d19b9302d regular
129 --- a/regular
129 --- a/regular
130 +++ b/regular
130 +++ b/regular
131 @@ -1,1 +1,2 @@
131 @@ -1,1 +1,2 @@
132 regular
132 regular
133 +regular
133 +regular
134 diff -r a66d19b9302d rmexec
134 diff -r a66d19b9302d rmexec
135 --- a/rmexec
135 --- a/rmexec
136 +++ /dev/null
136 +++ /dev/null
137 @@ -1,1 +0,0 @@
137 @@ -1,1 +0,0 @@
138 -rmexec
138 -rmexec
139 diff -r a66d19b9302d rmregular
139 diff -r a66d19b9302d rmregular
140 --- a/rmregular
140 --- a/rmregular
141 +++ /dev/null
141 +++ /dev/null
142 @@ -1,1 +0,0 @@
142 @@ -1,1 +0,0 @@
143 -rmregular
143 -rmregular
144
144
145 $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty rmbinary bintoregular; do
145 $ for f in exec newexec setexec unsetexec binary newbinary newempty rmempty rmbinary bintoregular; do
146 > echo
146 > echo
147 > echo '% git=auto: git diff for' $f
147 > echo '% git=auto: git diff for' $f
148 > hg autodiff --git=auto $f
148 > hg autodiff --git=auto $f
149 > done
149 > done
150
150
151 % git=auto: git diff for exec
151 % git=auto: git diff for exec
152 diff -r a66d19b9302d exec
152 diff -r a66d19b9302d exec
153 --- a/exec
153 --- a/exec
154 +++ b/exec
154 +++ b/exec
155 @@ -1,1 +1,2 @@
155 @@ -1,1 +1,2 @@
156 exec
156 exec
157 +exec
157 +exec
158
158
159 % git=auto: git diff for newexec
159 % git=auto: git diff for newexec
160 diff --git a/newexec b/newexec
160 diff --git a/newexec b/newexec
161 new file mode 100755
161 new file mode 100755
162 --- /dev/null
162 --- /dev/null
163 +++ b/newexec
163 +++ b/newexec
164 @@ -0,0 +1,1 @@
164 @@ -0,0 +1,1 @@
165 +newexec
165 +newexec
166
166
167 % git=auto: git diff for setexec
167 % git=auto: git diff for setexec
168 diff --git a/setexec b/setexec
168 diff --git a/setexec b/setexec
169 old mode 100644
169 old mode 100644
170 new mode 100755
170 new mode 100755
171
171
172 % git=auto: git diff for unsetexec
172 % git=auto: git diff for unsetexec
173 diff --git a/unsetexec b/unsetexec
173 diff --git a/unsetexec b/unsetexec
174 old mode 100755
174 old mode 100755
175 new mode 100644
175 new mode 100644
176
176
177 % git=auto: git diff for binary
177 % git=auto: git diff for binary
178 diff --git a/binary b/binary
178 diff --git a/binary b/binary
179 index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
179 index a9128c283485202893f5af379dd9beccb6e79486..09f370e38f498a462e1ca0faa724559b6630c04f
180 GIT binary patch
180 GIT binary patch
181 literal 2
181 literal 2
182 Jc${Nk0000200961
182 Jc${Nk0000200961
183
183
184
184
185 % git=auto: git diff for newbinary
185 % git=auto: git diff for newbinary
186 diff --git a/newbinary b/newbinary
186 diff --git a/newbinary b/newbinary
187 new file mode 100644
187 new file mode 100644
188 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d
188 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
189 GIT binary patch
189 GIT binary patch
190 literal 1
190 literal 1
191 Ic${MZ000310RR91
191 Ic${MZ000310RR91
192
192
193
193
194 % git=auto: git diff for newempty
194 % git=auto: git diff for newempty
195 diff --git a/newempty b/newempty
195 diff --git a/newempty b/newempty
196 new file mode 100644
196 new file mode 100644
197
197
198 % git=auto: git diff for rmempty
198 % git=auto: git diff for rmempty
199 diff --git a/rmempty b/rmempty
199 diff --git a/rmempty b/rmempty
200 deleted file mode 100644
200 deleted file mode 100644
201
201
202 % git=auto: git diff for rmbinary
202 % git=auto: git diff for rmbinary
203 diff --git a/rmbinary b/rmbinary
203 diff --git a/rmbinary b/rmbinary
204 deleted file mode 100644
204 deleted file mode 100644
205 index f76dd238ade08917e6712764a16a22005a50573d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
205 index f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000
206 GIT binary patch
206 GIT binary patch
207 literal 0
207 literal 0
208 Hc$@<O00001
208 Hc$@<O00001
209
209
210
210
211 % git=auto: git diff for bintoregular
211 % git=auto: git diff for bintoregular
212 diff --git a/bintoregular b/bintoregular
212 diff --git a/bintoregular b/bintoregular
213 index f76dd238ade08917e6712764a16a22005a50573d..9c42f2b6427d8bf034b7bc23986152dc01bfd3ab
213 index f76dd238ade08917e6712764a16a22005a50573d..9c42f2b6427d8bf034b7bc23986152dc01bfd3ab
214 GIT binary patch
214 GIT binary patch
215 literal 13
215 literal 13
216 Uc$`bh%qz(+N=+}#Ni5<5043uE82|tP
216 Uc$`bh%qz(+N=+}#Ni5<5043uE82|tP
217
217
218
218
219
219
220 git=warn: regular diff with data loss warnings
220 git=warn: regular diff with data loss warnings
221
221
222 $ hg autodiff --git=warn
222 $ hg autodiff --git=warn
223 diff -r a66d19b9302d binary
223 diff -r a66d19b9302d binary
224 Binary file binary has changed
224 Binary file binary has changed
225 diff -r a66d19b9302d bintoregular
225 diff -r a66d19b9302d bintoregular
226 Binary file bintoregular has changed
226 Binary file bintoregular has changed
227 diff -r a66d19b9302d exec
227 diff -r a66d19b9302d exec
228 --- a/exec
228 --- a/exec
229 +++ b/exec
229 +++ b/exec
230 @@ -1,1 +1,2 @@
230 @@ -1,1 +1,2 @@
231 exec
231 exec
232 +exec
232 +exec
233 diff -r a66d19b9302d newbinary
233 diff -r a66d19b9302d newbinary
234 Binary file newbinary has changed
234 Binary file newbinary has changed
235 diff -r a66d19b9302d newexec
235 diff -r a66d19b9302d newexec
236 --- /dev/null
236 --- /dev/null
237 +++ b/newexec
237 +++ b/newexec
238 @@ -0,0 +1,1 @@
238 @@ -0,0 +1,1 @@
239 +newexec
239 +newexec
240 diff -r a66d19b9302d newregular
240 diff -r a66d19b9302d newregular
241 --- /dev/null
241 --- /dev/null
242 +++ b/newregular
242 +++ b/newregular
243 @@ -0,0 +1,1 @@
243 @@ -0,0 +1,1 @@
244 +newregular
244 +newregular
245 diff -r a66d19b9302d regular
245 diff -r a66d19b9302d regular
246 --- a/regular
246 --- a/regular
247 +++ b/regular
247 +++ b/regular
248 @@ -1,1 +1,2 @@
248 @@ -1,1 +1,2 @@
249 regular
249 regular
250 +regular
250 +regular
251 diff -r a66d19b9302d rmbinary
251 diff -r a66d19b9302d rmbinary
252 Binary file rmbinary has changed
252 Binary file rmbinary has changed
253 diff -r a66d19b9302d rmexec
253 diff -r a66d19b9302d rmexec
254 --- a/rmexec
254 --- a/rmexec
255 +++ /dev/null
255 +++ /dev/null
256 @@ -1,1 +0,0 @@
256 @@ -1,1 +0,0 @@
257 -rmexec
257 -rmexec
258 diff -r a66d19b9302d rmregular
258 diff -r a66d19b9302d rmregular
259 --- a/rmregular
259 --- a/rmregular
260 +++ /dev/null
260 +++ /dev/null
261 @@ -1,1 +0,0 @@
261 @@ -1,1 +0,0 @@
262 -rmregular
262 -rmregular
263 data lost for: binary
263 data lost for: binary
264 data lost for: bintoregular
264 data lost for: bintoregular
265 data lost for: newbinary
265 data lost for: newbinary
266 data lost for: newempty
266 data lost for: newempty
267 data lost for: newexec
267 data lost for: newexec
268 data lost for: rmbinary
268 data lost for: rmbinary
269 data lost for: rmempty
269 data lost for: rmempty
270 data lost for: setexec
270 data lost for: setexec
271 data lost for: unsetexec
271 data lost for: unsetexec
272
272
273 git=abort: fail on execute bit change
273 git=abort: fail on execute bit change
274
274
275 $ hg autodiff --git=abort regular setexec
275 $ hg autodiff --git=abort regular setexec
276 abort: losing data for setexec
276 abort: losing data for setexec
277 [255]
277 [255]
278
278
279 git=abort: succeed on regular file
279 git=abort: succeed on regular file
280
280
281 $ hg autodiff --git=abort regular
281 $ hg autodiff --git=abort regular
282 diff -r a66d19b9302d regular
282 diff -r a66d19b9302d regular
283 --- a/regular
283 --- a/regular
284 +++ b/regular
284 +++ b/regular
285 @@ -1,1 +1,2 @@
285 @@ -1,1 +1,2 @@
286 regular
286 regular
287 +regular
287 +regular
288
288
289 $ cd ..
289 $ cd ..
290
290
@@ -1,294 +1,294 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
3 $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
4 $ hg add a
4 $ hg add a
5 $ cp a b
5 $ cp a b
6 $ hg add b
6 $ hg add b
7
7
8 Wide diffstat:
8 Wide diffstat:
9
9
10 $ hg diff --stat
10 $ hg diff --stat
11 a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11 a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 b | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 b | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13 2 files changed, 426 insertions(+), 0 deletions(-)
13 2 files changed, 426 insertions(+), 0 deletions(-)
14
14
15 diffstat width:
15 diffstat width:
16
16
17 $ COLUMNS=24 hg diff --config ui.interactive=true --stat
17 $ COLUMNS=24 hg diff --config ui.interactive=true --stat
18 a | 213 ++++++++++++++
18 a | 213 ++++++++++++++
19 b | 213 ++++++++++++++
19 b | 213 ++++++++++++++
20 2 files changed, 426 insertions(+), 0 deletions(-)
20 2 files changed, 426 insertions(+), 0 deletions(-)
21
21
22 $ hg ci -m adda
22 $ hg ci -m adda
23
23
24 $ cat >> a <<EOF
24 $ cat >> a <<EOF
25 > a
25 > a
26 > a
26 > a
27 > a
27 > a
28 > EOF
28 > EOF
29
29
30 Narrow diffstat:
30 Narrow diffstat:
31
31
32 $ hg diff --stat
32 $ hg diff --stat
33 a | 3 +++
33 a | 3 +++
34 1 files changed, 3 insertions(+), 0 deletions(-)
34 1 files changed, 3 insertions(+), 0 deletions(-)
35
35
36 $ hg ci -m appenda
36 $ hg ci -m appenda
37
37
38 >>> open("c", "wb").write(b"\0") and None
38 >>> open("c", "wb").write(b"\0") and None
39 $ touch d
39 $ touch d
40 $ hg add c d
40 $ hg add c d
41
41
42 Binary diffstat:
42 Binary diffstat:
43
43
44 $ hg diff --stat
44 $ hg diff --stat
45 c | Bin
45 c | Bin
46 1 files changed, 0 insertions(+), 0 deletions(-)
46 1 files changed, 0 insertions(+), 0 deletions(-)
47
47
48 Binary git diffstat:
48 Binary git diffstat:
49
49
50 $ hg diff --stat --git
50 $ hg diff --stat --git
51 c | Bin
51 c | Bin
52 d | 0
52 d | 0
53 2 files changed, 0 insertions(+), 0 deletions(-)
53 2 files changed, 0 insertions(+), 0 deletions(-)
54
54
55 $ hg ci -m createb
55 $ hg ci -m createb
56
56
57 >>> open("file with spaces", "wb").write(b"\0") and None
57 >>> open("file with spaces", "wb").write(b"\0") and None
58 $ hg add "file with spaces"
58 $ hg add "file with spaces"
59
59
60 Filename with spaces diffstat:
60 Filename with spaces diffstat:
61
61
62 $ hg diff --stat
62 $ hg diff --stat
63 file with spaces | Bin
63 file with spaces | Bin
64 1 files changed, 0 insertions(+), 0 deletions(-)
64 1 files changed, 0 insertions(+), 0 deletions(-)
65
65
66 Filename with spaces git diffstat:
66 Filename with spaces git diffstat:
67
67
68 $ hg diff --stat --git
68 $ hg diff --stat --git
69 file with spaces | Bin
69 file with spaces | Bin
70 1 files changed, 0 insertions(+), 0 deletions(-)
70 1 files changed, 0 insertions(+), 0 deletions(-)
71
71
72 Filename without "a/" or "b/" (issue5759):
72 Filename without "a/" or "b/" (issue5759):
73
73
74 $ hg diff --config 'diff.noprefix=1' -c1 --stat --git
74 $ hg diff --config 'diff.noprefix=1' -c1 --stat --git
75 a | 3 +++
75 a | 3 +++
76 1 files changed, 3 insertions(+), 0 deletions(-)
76 1 files changed, 3 insertions(+), 0 deletions(-)
77 $ hg diff --config 'diff.noprefix=1' -c2 --stat --git
77 $ hg diff --config 'diff.noprefix=1' -c2 --stat --git
78 c | Bin
78 c | Bin
79 d | 0
79 d | 0
80 2 files changed, 0 insertions(+), 0 deletions(-)
80 2 files changed, 0 insertions(+), 0 deletions(-)
81
81
82 $ hg log --config 'diff.noprefix=1' -r '1:' -p --stat --git
82 $ hg log --config 'diff.noprefix=1' -r '1:' -p --stat --git
83 changeset: 1:3a95b07bb77f
83 changeset: 1:3a95b07bb77f
84 user: test
84 user: test
85 date: Thu Jan 01 00:00:00 1970 +0000
85 date: Thu Jan 01 00:00:00 1970 +0000
86 summary: appenda
86 summary: appenda
87
87
88 a | 3 +++
88 a | 3 +++
89 1 files changed, 3 insertions(+), 0 deletions(-)
89 1 files changed, 3 insertions(+), 0 deletions(-)
90
90
91 diff --git a a
91 diff --git a a
92 --- a
92 --- a
93 +++ a
93 +++ a
94 @@ -211,3 +211,6 @@
94 @@ -211,3 +211,6 @@
95 a
95 a
96 a
96 a
97 a
97 a
98 +a
98 +a
99 +a
99 +a
100 +a
100 +a
101
101
102 changeset: 2:c60a6c753773
102 changeset: 2:c60a6c753773
103 tag: tip
103 tag: tip
104 user: test
104 user: test
105 date: Thu Jan 01 00:00:00 1970 +0000
105 date: Thu Jan 01 00:00:00 1970 +0000
106 summary: createb
106 summary: createb
107
107
108 c | Bin
108 c | Bin
109 d | 0
109 d | 0
110 2 files changed, 0 insertions(+), 0 deletions(-)
110 2 files changed, 0 insertions(+), 0 deletions(-)
111
111
112 diff --git c c
112 diff --git c c
113 new file mode 100644
113 new file mode 100644
114 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f76dd238ade08917e6712764a16a22005a50573d
114 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d
115 GIT binary patch
115 GIT binary patch
116 literal 1
116 literal 1
117 Ic${MZ000310RR91
117 Ic${MZ000310RR91
118
118
119 diff --git d d
119 diff --git d d
120 new file mode 100644
120 new file mode 100644
121
121
122
122
123 diffstat within directories:
123 diffstat within directories:
124
124
125 $ hg rm -f 'file with spaces'
125 $ hg rm -f 'file with spaces'
126
126
127 $ mkdir dir1 dir2
127 $ mkdir dir1 dir2
128 $ echo new1 > dir1/new
128 $ echo new1 > dir1/new
129 $ echo new2 > dir2/new
129 $ echo new2 > dir2/new
130 $ hg add dir1/new dir2/new
130 $ hg add dir1/new dir2/new
131 $ hg diff --stat
131 $ hg diff --stat
132 dir1/new | 1 +
132 dir1/new | 1 +
133 dir2/new | 1 +
133 dir2/new | 1 +
134 2 files changed, 2 insertions(+), 0 deletions(-)
134 2 files changed, 2 insertions(+), 0 deletions(-)
135
135
136 $ hg diff --stat --root dir1
136 $ hg diff --stat --root dir1
137 new | 1 +
137 new | 1 +
138 1 files changed, 1 insertions(+), 0 deletions(-)
138 1 files changed, 1 insertions(+), 0 deletions(-)
139
139
140 $ hg diff --stat --root dir1 dir2
140 $ hg diff --stat --root dir1 dir2
141 warning: dir2 not inside relative root dir1
141 warning: dir2 not inside relative root dir1
142
142
143 $ hg diff --stat --root dir1 -I dir1/old
143 $ hg diff --stat --root dir1 -I dir1/old
144
144
145 $ cd dir1
145 $ cd dir1
146 $ hg diff --stat .
146 $ hg diff --stat .
147 dir1/new | 1 +
147 dir1/new | 1 +
148 1 files changed, 1 insertions(+), 0 deletions(-)
148 1 files changed, 1 insertions(+), 0 deletions(-)
149 $ hg diff --stat . --config ui.relative-paths=yes
149 $ hg diff --stat . --config ui.relative-paths=yes
150 new | 1 +
150 new | 1 +
151 1 files changed, 1 insertions(+), 0 deletions(-)
151 1 files changed, 1 insertions(+), 0 deletions(-)
152 $ hg diff --stat --root .
152 $ hg diff --stat --root .
153 new | 1 +
153 new | 1 +
154 1 files changed, 1 insertions(+), 0 deletions(-)
154 1 files changed, 1 insertions(+), 0 deletions(-)
155
155
156 $ hg diff --stat --root . --config ui.relative-paths=yes
156 $ hg diff --stat --root . --config ui.relative-paths=yes
157 new | 1 +
157 new | 1 +
158 1 files changed, 1 insertions(+), 0 deletions(-)
158 1 files changed, 1 insertions(+), 0 deletions(-)
159 --root trumps ui.relative-paths
159 --root trumps ui.relative-paths
160 $ hg diff --stat --root .. --config ui.relative-paths=yes
160 $ hg diff --stat --root .. --config ui.relative-paths=yes
161 new | 1 +
161 new | 1 +
162 ../dir2/new | 1 +
162 ../dir2/new | 1 +
163 2 files changed, 2 insertions(+), 0 deletions(-)
163 2 files changed, 2 insertions(+), 0 deletions(-)
164 $ hg diff --stat --root ../dir1 ../dir2
164 $ hg diff --stat --root ../dir1 ../dir2
165 warning: ../dir2 not inside relative root .
165 warning: ../dir2 not inside relative root .
166
166
167 $ hg diff --stat --root . -I old
167 $ hg diff --stat --root . -I old
168
168
169 $ cd ..
169 $ cd ..
170
170
171 Files with lines beginning with '--' or '++' should be properly counted in diffstat
171 Files with lines beginning with '--' or '++' should be properly counted in diffstat
172
172
173 $ hg up -Cr tip
173 $ hg up -Cr tip
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 $ rm dir1/new
175 $ rm dir1/new
176 $ rm dir2/new
176 $ rm dir2/new
177 $ rm "file with spaces"
177 $ rm "file with spaces"
178 $ cat > file << EOF
178 $ cat > file << EOF
179 > line 1
179 > line 1
180 > line 2
180 > line 2
181 > line 3
181 > line 3
182 > EOF
182 > EOF
183 $ hg commit -Am file
183 $ hg commit -Am file
184 adding file
184 adding file
185
185
186 Lines added starting with '--' should count as additions
186 Lines added starting with '--' should count as additions
187 $ cat > file << EOF
187 $ cat > file << EOF
188 > line 1
188 > line 1
189 > -- line 2, with dashes
189 > -- line 2, with dashes
190 > line 3
190 > line 3
191 > EOF
191 > EOF
192
192
193 $ hg diff --root .
193 $ hg diff --root .
194 diff -r be1569354b24 file
194 diff -r be1569354b24 file
195 --- a/file Thu Jan 01 00:00:00 1970 +0000
195 --- a/file Thu Jan 01 00:00:00 1970 +0000
196 +++ b/file * (glob)
196 +++ b/file * (glob)
197 @@ -1,3 +1,3 @@
197 @@ -1,3 +1,3 @@
198 line 1
198 line 1
199 -line 2
199 -line 2
200 +-- line 2, with dashes
200 +-- line 2, with dashes
201 line 3
201 line 3
202
202
203 $ hg diff --root . --stat
203 $ hg diff --root . --stat
204 file | 2 +-
204 file | 2 +-
205 1 files changed, 1 insertions(+), 1 deletions(-)
205 1 files changed, 1 insertions(+), 1 deletions(-)
206
206
207 Lines changed starting with '--' should count as deletions
207 Lines changed starting with '--' should count as deletions
208 $ hg commit -m filev2
208 $ hg commit -m filev2
209 $ cat > file << EOF
209 $ cat > file << EOF
210 > line 1
210 > line 1
211 > -- line 2, with dashes, changed again
211 > -- line 2, with dashes, changed again
212 > line 3
212 > line 3
213 > EOF
213 > EOF
214
214
215 $ hg diff --root .
215 $ hg diff --root .
216 diff -r 160f7c034df6 file
216 diff -r 160f7c034df6 file
217 --- a/file Thu Jan 01 00:00:00 1970 +0000
217 --- a/file Thu Jan 01 00:00:00 1970 +0000
218 +++ b/file * (glob)
218 +++ b/file * (glob)
219 @@ -1,3 +1,3 @@
219 @@ -1,3 +1,3 @@
220 line 1
220 line 1
221 --- line 2, with dashes
221 --- line 2, with dashes
222 +-- line 2, with dashes, changed again
222 +-- line 2, with dashes, changed again
223 line 3
223 line 3
224
224
225 $ hg diff --root . --stat
225 $ hg diff --root . --stat
226 file | 2 +-
226 file | 2 +-
227 1 files changed, 1 insertions(+), 1 deletions(-)
227 1 files changed, 1 insertions(+), 1 deletions(-)
228
228
229 Lines changed starting with '--' should count as deletions
229 Lines changed starting with '--' should count as deletions
230 and starting with '++' should count as additions
230 and starting with '++' should count as additions
231 $ cat > file << EOF
231 $ cat > file << EOF
232 > line 1
232 > line 1
233 > ++ line 2, switched dashes to plusses
233 > ++ line 2, switched dashes to plusses
234 > line 3
234 > line 3
235 > EOF
235 > EOF
236
236
237 $ hg diff --root .
237 $ hg diff --root .
238 diff -r 160f7c034df6 file
238 diff -r 160f7c034df6 file
239 --- a/file Thu Jan 01 00:00:00 1970 +0000
239 --- a/file Thu Jan 01 00:00:00 1970 +0000
240 +++ b/file * (glob)
240 +++ b/file * (glob)
241 @@ -1,3 +1,3 @@
241 @@ -1,3 +1,3 @@
242 line 1
242 line 1
243 --- line 2, with dashes
243 --- line 2, with dashes
244 +++ line 2, switched dashes to plusses
244 +++ line 2, switched dashes to plusses
245 line 3
245 line 3
246
246
247 $ hg diff --root . --stat
247 $ hg diff --root . --stat
248 file | 2 +-
248 file | 2 +-
249 1 files changed, 1 insertions(+), 1 deletions(-)
249 1 files changed, 1 insertions(+), 1 deletions(-)
250
250
251 When a file is renamed, --git shouldn't loss the info about old file
251 When a file is renamed, --git shouldn't loss the info about old file
252 $ hg init issue6025
252 $ hg init issue6025
253 $ cd issue6025
253 $ cd issue6025
254 $ echo > a
254 $ echo > a
255 $ hg ci -Am 'add a'
255 $ hg ci -Am 'add a'
256 adding a
256 adding a
257 $ hg mv a b
257 $ hg mv a b
258 $ hg diff --git
258 $ hg diff --git
259 diff --git a/a b/b
259 diff --git a/a b/b
260 rename from a
260 rename from a
261 rename to b
261 rename to b
262 $ hg diff --stat
262 $ hg diff --stat
263 a | 1 -
263 a | 1 -
264 b | 1 +
264 b | 1 +
265 2 files changed, 1 insertions(+), 1 deletions(-)
265 2 files changed, 1 insertions(+), 1 deletions(-)
266 $ hg diff --stat --git
266 $ hg diff --stat --git
267 a => b | 0
267 a => b | 0
268 1 files changed, 0 insertions(+), 0 deletions(-)
268 1 files changed, 0 insertions(+), 0 deletions(-)
269 -- filename may contain whitespaces
269 -- filename may contain whitespaces
270 $ echo > c
270 $ echo > c
271 $ hg ci -Am 'add c'
271 $ hg ci -Am 'add c'
272 adding c
272 adding c
273 $ hg mv c 'new c'
273 $ hg mv c 'new c'
274 $ hg diff --git
274 $ hg diff --git
275 diff --git a/c b/new c
275 diff --git a/c b/new c
276 rename from c
276 rename from c
277 rename to new c
277 rename to new c
278 $ hg diff --stat
278 $ hg diff --stat
279 c | 1 -
279 c | 1 -
280 new c | 1 +
280 new c | 1 +
281 2 files changed, 1 insertions(+), 1 deletions(-)
281 2 files changed, 1 insertions(+), 1 deletions(-)
282 $ hg diff --stat --git
282 $ hg diff --stat --git
283 c => new c | 0
283 c => new c | 0
284 1 files changed, 0 insertions(+), 0 deletions(-)
284 1 files changed, 0 insertions(+), 0 deletions(-)
285
285
286 Make sure `diff --stat -q --config diff.git-0` shows stat (issue4037)
286 Make sure `diff --stat -q --config diff.git-0` shows stat (issue4037)
287
287
288 $ hg status
288 $ hg status
289 A new c
289 A new c
290 R c
290 R c
291 $ hg diff --stat -q
291 $ hg diff --stat -q
292 c | 1 -
292 c | 1 -
293 new c | 1 +
293 new c | 1 +
294 2 files changed, 1 insertions(+), 1 deletions(-)
294 2 files changed, 1 insertions(+), 1 deletions(-)
@@ -1,615 +1,615 b''
1 $ hg init
1 $ hg init
2 $ echo start > start
2 $ echo start > start
3 $ hg ci -Amstart
3 $ hg ci -Amstart
4 adding start
4 adding start
5
5
6 New file:
6 New file:
7
7
8 $ mkdir dir1
8 $ mkdir dir1
9 $ echo new > dir1/new
9 $ echo new > dir1/new
10 $ hg ci -Amnew
10 $ hg ci -Amnew
11 adding dir1/new
11 adding dir1/new
12 $ hg diff --git -r 0
12 $ hg diff --git -r 0
13 diff --git a/dir1/new b/dir1/new
13 diff --git a/dir1/new b/dir1/new
14 new file mode 100644
14 new file mode 100644
15 --- /dev/null
15 --- /dev/null
16 +++ b/dir1/new
16 +++ b/dir1/new
17 @@ -0,0 +1,1 @@
17 @@ -0,0 +1,1 @@
18 +new
18 +new
19
19
20 Copy:
20 Copy:
21
21
22 $ mkdir dir2
22 $ mkdir dir2
23 $ hg cp dir1/new dir1/copy
23 $ hg cp dir1/new dir1/copy
24 $ echo copy1 >> dir1/copy
24 $ echo copy1 >> dir1/copy
25 $ hg cp dir1/new dir2/copy
25 $ hg cp dir1/new dir2/copy
26 $ echo copy2 >> dir2/copy
26 $ echo copy2 >> dir2/copy
27 $ hg ci -mcopy
27 $ hg ci -mcopy
28 $ hg diff --git -r 1:tip
28 $ hg diff --git -r 1:tip
29 diff --git a/dir1/new b/dir1/copy
29 diff --git a/dir1/new b/dir1/copy
30 copy from dir1/new
30 copy from dir1/new
31 copy to dir1/copy
31 copy to dir1/copy
32 --- a/dir1/new
32 --- a/dir1/new
33 +++ b/dir1/copy
33 +++ b/dir1/copy
34 @@ -1,1 +1,2 @@
34 @@ -1,1 +1,2 @@
35 new
35 new
36 +copy1
36 +copy1
37 diff --git a/dir1/new b/dir2/copy
37 diff --git a/dir1/new b/dir2/copy
38 copy from dir1/new
38 copy from dir1/new
39 copy to dir2/copy
39 copy to dir2/copy
40 --- a/dir1/new
40 --- a/dir1/new
41 +++ b/dir2/copy
41 +++ b/dir2/copy
42 @@ -1,1 +1,2 @@
42 @@ -1,1 +1,2 @@
43 new
43 new
44 +copy2
44 +copy2
45
45
46 Cross and same-directory copies with a relative root:
46 Cross and same-directory copies with a relative root:
47
47
48 $ hg diff --git --root .. -r 1:tip
48 $ hg diff --git --root .. -r 1:tip
49 abort: .. not under root '$TESTTMP'
49 abort: .. not under root '$TESTTMP'
50 [255]
50 [255]
51 $ hg diff --git --root doesnotexist -r 1:tip
51 $ hg diff --git --root doesnotexist -r 1:tip
52 $ hg diff --git --root . -r 1:tip
52 $ hg diff --git --root . -r 1:tip
53 diff --git a/dir1/new b/dir1/copy
53 diff --git a/dir1/new b/dir1/copy
54 copy from dir1/new
54 copy from dir1/new
55 copy to dir1/copy
55 copy to dir1/copy
56 --- a/dir1/new
56 --- a/dir1/new
57 +++ b/dir1/copy
57 +++ b/dir1/copy
58 @@ -1,1 +1,2 @@
58 @@ -1,1 +1,2 @@
59 new
59 new
60 +copy1
60 +copy1
61 diff --git a/dir1/new b/dir2/copy
61 diff --git a/dir1/new b/dir2/copy
62 copy from dir1/new
62 copy from dir1/new
63 copy to dir2/copy
63 copy to dir2/copy
64 --- a/dir1/new
64 --- a/dir1/new
65 +++ b/dir2/copy
65 +++ b/dir2/copy
66 @@ -1,1 +1,2 @@
66 @@ -1,1 +1,2 @@
67 new
67 new
68 +copy2
68 +copy2
69 $ hg diff --git --root dir1 -r 1:tip
69 $ hg diff --git --root dir1 -r 1:tip
70 diff --git a/new b/copy
70 diff --git a/new b/copy
71 copy from new
71 copy from new
72 copy to copy
72 copy to copy
73 --- a/new
73 --- a/new
74 +++ b/copy
74 +++ b/copy
75 @@ -1,1 +1,2 @@
75 @@ -1,1 +1,2 @@
76 new
76 new
77 +copy1
77 +copy1
78
78
79 $ hg diff --git --root dir2/ -r 1:tip
79 $ hg diff --git --root dir2/ -r 1:tip
80 diff --git a/copy b/copy
80 diff --git a/copy b/copy
81 new file mode 100644
81 new file mode 100644
82 --- /dev/null
82 --- /dev/null
83 +++ b/copy
83 +++ b/copy
84 @@ -0,0 +1,2 @@
84 @@ -0,0 +1,2 @@
85 +new
85 +new
86 +copy2
86 +copy2
87
87
88 $ hg diff --git --root dir1 -r 1:tip -I '**/copy'
88 $ hg diff --git --root dir1 -r 1:tip -I '**/copy'
89 diff --git a/new b/copy
89 diff --git a/new b/copy
90 copy from new
90 copy from new
91 copy to copy
91 copy to copy
92 --- a/new
92 --- a/new
93 +++ b/copy
93 +++ b/copy
94 @@ -1,1 +1,2 @@
94 @@ -1,1 +1,2 @@
95 new
95 new
96 +copy1
96 +copy1
97
97
98 $ hg diff --git --root dir1 -r 1:tip dir2
98 $ hg diff --git --root dir1 -r 1:tip dir2
99 warning: dir2 not inside relative root dir1
99 warning: dir2 not inside relative root dir1
100
100
101 $ hg diff --git --root dir1 -r 1:tip 'dir2/{copy}'
101 $ hg diff --git --root dir1 -r 1:tip 'dir2/{copy}'
102 warning: dir2/{copy} not inside relative root dir1
102 warning: dir2/{copy} not inside relative root dir1
103
103
104 $ cd dir1
104 $ cd dir1
105 $ hg diff --git --root .. -r 1:tip
105 $ hg diff --git --root .. -r 1:tip
106 diff --git a/dir1/new b/dir1/copy
106 diff --git a/dir1/new b/dir1/copy
107 copy from dir1/new
107 copy from dir1/new
108 copy to dir1/copy
108 copy to dir1/copy
109 --- a/dir1/new
109 --- a/dir1/new
110 +++ b/dir1/copy
110 +++ b/dir1/copy
111 @@ -1,1 +1,2 @@
111 @@ -1,1 +1,2 @@
112 new
112 new
113 +copy1
113 +copy1
114 diff --git a/dir1/new b/dir2/copy
114 diff --git a/dir1/new b/dir2/copy
115 copy from dir1/new
115 copy from dir1/new
116 copy to dir2/copy
116 copy to dir2/copy
117 --- a/dir1/new
117 --- a/dir1/new
118 +++ b/dir2/copy
118 +++ b/dir2/copy
119 @@ -1,1 +1,2 @@
119 @@ -1,1 +1,2 @@
120 new
120 new
121 +copy2
121 +copy2
122
122
123 $ hg diff --git --root ../.. -r 1:tip
123 $ hg diff --git --root ../.. -r 1:tip
124 abort: ../.. not under root '$TESTTMP'
124 abort: ../.. not under root '$TESTTMP'
125 [255]
125 [255]
126 $ hg diff --git --root ../doesnotexist -r 1:tip
126 $ hg diff --git --root ../doesnotexist -r 1:tip
127 $ hg diff --git --root .. -r 1:tip
127 $ hg diff --git --root .. -r 1:tip
128 diff --git a/dir1/new b/dir1/copy
128 diff --git a/dir1/new b/dir1/copy
129 copy from dir1/new
129 copy from dir1/new
130 copy to dir1/copy
130 copy to dir1/copy
131 --- a/dir1/new
131 --- a/dir1/new
132 +++ b/dir1/copy
132 +++ b/dir1/copy
133 @@ -1,1 +1,2 @@
133 @@ -1,1 +1,2 @@
134 new
134 new
135 +copy1
135 +copy1
136 diff --git a/dir1/new b/dir2/copy
136 diff --git a/dir1/new b/dir2/copy
137 copy from dir1/new
137 copy from dir1/new
138 copy to dir2/copy
138 copy to dir2/copy
139 --- a/dir1/new
139 --- a/dir1/new
140 +++ b/dir2/copy
140 +++ b/dir2/copy
141 @@ -1,1 +1,2 @@
141 @@ -1,1 +1,2 @@
142 new
142 new
143 +copy2
143 +copy2
144
144
145 $ hg diff --git --root . -r 1:tip
145 $ hg diff --git --root . -r 1:tip
146 diff --git a/new b/copy
146 diff --git a/new b/copy
147 copy from new
147 copy from new
148 copy to copy
148 copy to copy
149 --- a/new
149 --- a/new
150 +++ b/copy
150 +++ b/copy
151 @@ -1,1 +1,2 @@
151 @@ -1,1 +1,2 @@
152 new
152 new
153 +copy1
153 +copy1
154 $ hg diff --git --root . -r 1:tip copy
154 $ hg diff --git --root . -r 1:tip copy
155 diff --git a/new b/copy
155 diff --git a/new b/copy
156 copy from new
156 copy from new
157 copy to copy
157 copy to copy
158 --- a/new
158 --- a/new
159 +++ b/copy
159 +++ b/copy
160 @@ -1,1 +1,2 @@
160 @@ -1,1 +1,2 @@
161 new
161 new
162 +copy1
162 +copy1
163 $ hg diff --git --root . -r 1:tip ../dir2
163 $ hg diff --git --root . -r 1:tip ../dir2
164 warning: ../dir2 not inside relative root .
164 warning: ../dir2 not inside relative root .
165 $ hg diff --git --root . -r 1:tip '../dir2/*'
165 $ hg diff --git --root . -r 1:tip '../dir2/*'
166 warning: ../dir2/* not inside relative root . (glob)
166 warning: ../dir2/* not inside relative root . (glob)
167 $ cd ..
167 $ cd ..
168
168
169 Rename:
169 Rename:
170
170
171 $ hg mv dir1/copy dir1/rename1
171 $ hg mv dir1/copy dir1/rename1
172 $ echo rename1 >> dir1/rename1
172 $ echo rename1 >> dir1/rename1
173 $ hg mv dir2/copy dir1/rename2
173 $ hg mv dir2/copy dir1/rename2
174 $ echo rename2 >> dir1/rename2
174 $ echo rename2 >> dir1/rename2
175 $ hg ci -mrename
175 $ hg ci -mrename
176 $ hg diff --git -r 2:tip
176 $ hg diff --git -r 2:tip
177 diff --git a/dir1/copy b/dir1/rename1
177 diff --git a/dir1/copy b/dir1/rename1
178 rename from dir1/copy
178 rename from dir1/copy
179 rename to dir1/rename1
179 rename to dir1/rename1
180 --- a/dir1/copy
180 --- a/dir1/copy
181 +++ b/dir1/rename1
181 +++ b/dir1/rename1
182 @@ -1,2 +1,3 @@
182 @@ -1,2 +1,3 @@
183 new
183 new
184 copy1
184 copy1
185 +rename1
185 +rename1
186 diff --git a/dir2/copy b/dir1/rename2
186 diff --git a/dir2/copy b/dir1/rename2
187 rename from dir2/copy
187 rename from dir2/copy
188 rename to dir1/rename2
188 rename to dir1/rename2
189 --- a/dir2/copy
189 --- a/dir2/copy
190 +++ b/dir1/rename2
190 +++ b/dir1/rename2
191 @@ -1,2 +1,3 @@
191 @@ -1,2 +1,3 @@
192 new
192 new
193 copy2
193 copy2
194 +rename2
194 +rename2
195
195
196 Cross and same-directory renames with a relative root:
196 Cross and same-directory renames with a relative root:
197
197
198 $ hg diff --root dir1 --git -r 2:tip
198 $ hg diff --root dir1 --git -r 2:tip
199 diff --git a/copy b/rename1
199 diff --git a/copy b/rename1
200 rename from copy
200 rename from copy
201 rename to rename1
201 rename to rename1
202 --- a/copy
202 --- a/copy
203 +++ b/rename1
203 +++ b/rename1
204 @@ -1,2 +1,3 @@
204 @@ -1,2 +1,3 @@
205 new
205 new
206 copy1
206 copy1
207 +rename1
207 +rename1
208 diff --git a/rename2 b/rename2
208 diff --git a/rename2 b/rename2
209 new file mode 100644
209 new file mode 100644
210 --- /dev/null
210 --- /dev/null
211 +++ b/rename2
211 +++ b/rename2
212 @@ -0,0 +1,3 @@
212 @@ -0,0 +1,3 @@
213 +new
213 +new
214 +copy2
214 +copy2
215 +rename2
215 +rename2
216
216
217 $ hg diff --root dir2 --git -r 2:tip
217 $ hg diff --root dir2 --git -r 2:tip
218 diff --git a/copy b/copy
218 diff --git a/copy b/copy
219 deleted file mode 100644
219 deleted file mode 100644
220 --- a/copy
220 --- a/copy
221 +++ /dev/null
221 +++ /dev/null
222 @@ -1,2 +0,0 @@
222 @@ -1,2 +0,0 @@
223 -new
223 -new
224 -copy2
224 -copy2
225
225
226 $ hg diff --root dir1 --git -r 2:tip -I '**/copy'
226 $ hg diff --root dir1 --git -r 2:tip -I '**/copy'
227 diff --git a/copy b/copy
227 diff --git a/copy b/copy
228 deleted file mode 100644
228 deleted file mode 100644
229 --- a/copy
229 --- a/copy
230 +++ /dev/null
230 +++ /dev/null
231 @@ -1,2 +0,0 @@
231 @@ -1,2 +0,0 @@
232 -new
232 -new
233 -copy1
233 -copy1
234
234
235 $ hg diff --root dir1 --git -r 2:tip -I '**/rename*'
235 $ hg diff --root dir1 --git -r 2:tip -I '**/rename*'
236 diff --git a/copy b/rename1
236 diff --git a/copy b/rename1
237 copy from copy
237 copy from copy
238 copy to rename1
238 copy to rename1
239 --- a/copy
239 --- a/copy
240 +++ b/rename1
240 +++ b/rename1
241 @@ -1,2 +1,3 @@
241 @@ -1,2 +1,3 @@
242 new
242 new
243 copy1
243 copy1
244 +rename1
244 +rename1
245 diff --git a/rename2 b/rename2
245 diff --git a/rename2 b/rename2
246 new file mode 100644
246 new file mode 100644
247 --- /dev/null
247 --- /dev/null
248 +++ b/rename2
248 +++ b/rename2
249 @@ -0,0 +1,3 @@
249 @@ -0,0 +1,3 @@
250 +new
250 +new
251 +copy2
251 +copy2
252 +rename2
252 +rename2
253
253
254 Delete:
254 Delete:
255
255
256 $ hg rm dir1/*
256 $ hg rm dir1/*
257 $ hg ci -mdelete
257 $ hg ci -mdelete
258 $ hg diff --git -r 3:tip
258 $ hg diff --git -r 3:tip
259 diff --git a/dir1/new b/dir1/new
259 diff --git a/dir1/new b/dir1/new
260 deleted file mode 100644
260 deleted file mode 100644
261 --- a/dir1/new
261 --- a/dir1/new
262 +++ /dev/null
262 +++ /dev/null
263 @@ -1,1 +0,0 @@
263 @@ -1,1 +0,0 @@
264 -new
264 -new
265 diff --git a/dir1/rename1 b/dir1/rename1
265 diff --git a/dir1/rename1 b/dir1/rename1
266 deleted file mode 100644
266 deleted file mode 100644
267 --- a/dir1/rename1
267 --- a/dir1/rename1
268 +++ /dev/null
268 +++ /dev/null
269 @@ -1,3 +0,0 @@
269 @@ -1,3 +0,0 @@
270 -new
270 -new
271 -copy1
271 -copy1
272 -rename1
272 -rename1
273 diff --git a/dir1/rename2 b/dir1/rename2
273 diff --git a/dir1/rename2 b/dir1/rename2
274 deleted file mode 100644
274 deleted file mode 100644
275 --- a/dir1/rename2
275 --- a/dir1/rename2
276 +++ /dev/null
276 +++ /dev/null
277 @@ -1,3 +0,0 @@
277 @@ -1,3 +0,0 @@
278 -new
278 -new
279 -copy2
279 -copy2
280 -rename2
280 -rename2
281
281
282 $ cat > src <<EOF
282 $ cat > src <<EOF
283 > 1
283 > 1
284 > 2
284 > 2
285 > 3
285 > 3
286 > 4
286 > 4
287 > 5
287 > 5
288 > EOF
288 > EOF
289 $ hg ci -Amsrc
289 $ hg ci -Amsrc
290 adding src
290 adding src
291
291
292 #if execbit
292 #if execbit
293
293
294 chmod 644:
294 chmod 644:
295
295
296 $ chmod +x src
296 $ chmod +x src
297 $ hg ci -munexec
297 $ hg ci -munexec
298 $ hg diff --git -r 5:tip
298 $ hg diff --git -r 5:tip
299 diff --git a/src b/src
299 diff --git a/src b/src
300 old mode 100644
300 old mode 100644
301 new mode 100755
301 new mode 100755
302
302
303 Rename+mod+chmod:
303 Rename+mod+chmod:
304
304
305 $ hg mv src dst
305 $ hg mv src dst
306 $ chmod -x dst
306 $ chmod -x dst
307 $ echo a >> dst
307 $ echo a >> dst
308 $ hg ci -mrenamemod
308 $ hg ci -mrenamemod
309 $ hg diff --git -r 6:tip
309 $ hg diff --git -r 6:tip
310 diff --git a/src b/dst
310 diff --git a/src b/dst
311 old mode 100755
311 old mode 100755
312 new mode 100644
312 new mode 100644
313 rename from src
313 rename from src
314 rename to dst
314 rename to dst
315 --- a/src
315 --- a/src
316 +++ b/dst
316 +++ b/dst
317 @@ -3,3 +3,4 @@
317 @@ -3,3 +3,4 @@
318 3
318 3
319 4
319 4
320 5
320 5
321 +a
321 +a
322
322
323 Nonexistent in tip+chmod:
323 Nonexistent in tip+chmod:
324
324
325 $ hg diff --git -r 5:6
325 $ hg diff --git -r 5:6
326 diff --git a/src b/src
326 diff --git a/src b/src
327 old mode 100644
327 old mode 100644
328 new mode 100755
328 new mode 100755
329
329
330 #else
330 #else
331
331
332 Dummy changes when no exec bit, mocking the execbit commit structure
332 Dummy changes when no exec bit, mocking the execbit commit structure
333
333
334 $ echo change >> src
334 $ echo change >> src
335 $ hg ci -munexec
335 $ hg ci -munexec
336 $ hg mv src dst
336 $ hg mv src dst
337 $ hg ci -mrenamemod
337 $ hg ci -mrenamemod
338
338
339 #endif
339 #endif
340
340
341 Binary diff:
341 Binary diff:
342
342
343 $ cp "$TESTDIR/binfile.bin" .
343 $ cp "$TESTDIR/binfile.bin" .
344 $ hg add binfile.bin
344 $ hg add binfile.bin
345 $ hg diff --git > b.diff
345 $ hg diff --git > b.diff
346 $ cat b.diff
346 $ cat b.diff
347 diff --git a/binfile.bin b/binfile.bin
347 diff --git a/binfile.bin b/binfile.bin
348 new file mode 100644
348 new file mode 100644
349 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
349 index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
350 GIT binary patch
350 GIT binary patch
351 literal 593
351 literal 593
352 zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
352 zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
353 z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
353 z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
354 zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
354 zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
355 z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
355 z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
356 zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
356 zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
357 ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
357 ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
358 zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
358 zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
359 z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
359 z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
360 zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
360 zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
361 z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
361 z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
362 zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
362 zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
363 fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
363 fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
364
364
365
365
366 Import binary diff:
366 Import binary diff:
367
367
368 $ hg revert binfile.bin
368 $ hg revert binfile.bin
369 $ rm binfile.bin
369 $ rm binfile.bin
370 $ hg import -mfoo b.diff
370 $ hg import -mfoo b.diff
371 applying b.diff
371 applying b.diff
372 $ cmp binfile.bin "$TESTDIR/binfile.bin"
372 $ cmp binfile.bin "$TESTDIR/binfile.bin"
373
373
374 Rename binary file:
374 Rename binary file:
375
375
376 $ hg mv binfile.bin renamed.bin
376 $ hg mv binfile.bin renamed.bin
377 $ hg diff --git
377 $ hg diff --git
378 diff --git a/binfile.bin b/renamed.bin
378 diff --git a/binfile.bin b/renamed.bin
379 rename from binfile.bin
379 rename from binfile.bin
380 rename to renamed.bin
380 rename to renamed.bin
381
381
382 Diff across many revisions:
382 Diff across many revisions:
383
383
384 $ hg mv dst dst2
384 $ hg mv dst dst2
385 $ hg ci -m 'mv dst dst2'
385 $ hg ci -m 'mv dst dst2'
386
386
387 $ echo >> start
387 $ echo >> start
388 $ hg ci -m 'change start'
388 $ hg ci -m 'change start'
389
389
390 $ hg revert -r -2 start
390 $ hg revert -r -2 start
391 $ hg mv dst2 dst3
391 $ hg mv dst2 dst3
392 $ hg ci -m 'mv dst2 dst3; revert start'
392 $ hg ci -m 'mv dst2 dst3; revert start'
393
393
394 $ hg diff --git -r 9:11
394 $ hg diff --git -r 9:11
395 diff --git a/dst2 b/dst3
395 diff --git a/dst2 b/dst3
396 rename from dst2
396 rename from dst2
397 rename to dst3
397 rename to dst3
398
398
399 Reversed:
399 Reversed:
400
400
401 $ hg diff --git -r 11:9
401 $ hg diff --git -r 11:9
402 diff --git a/dst3 b/dst2
402 diff --git a/dst3 b/dst2
403 rename from dst3
403 rename from dst3
404 rename to dst2
404 rename to dst2
405
405
406
406
407 $ echo a >> foo
407 $ echo a >> foo
408 $ hg add foo
408 $ hg add foo
409 $ hg ci -m 'add foo'
409 $ hg ci -m 'add foo'
410 $ echo b >> foo
410 $ echo b >> foo
411 $ hg ci -m 'change foo'
411 $ hg ci -m 'change foo'
412 $ hg mv foo bar
412 $ hg mv foo bar
413 $ hg ci -m 'mv foo bar'
413 $ hg ci -m 'mv foo bar'
414 $ echo c >> bar
414 $ echo c >> bar
415 $ hg ci -m 'change bar'
415 $ hg ci -m 'change bar'
416
416
417 File created before r1 and renamed before r2:
417 File created before r1 and renamed before r2:
418
418
419 $ hg diff --git -r -3:-1
419 $ hg diff --git -r -3:-1
420 diff --git a/foo b/bar
420 diff --git a/foo b/bar
421 rename from foo
421 rename from foo
422 rename to bar
422 rename to bar
423 --- a/foo
423 --- a/foo
424 +++ b/bar
424 +++ b/bar
425 @@ -1,2 +1,3 @@
425 @@ -1,2 +1,3 @@
426 a
426 a
427 b
427 b
428 +c
428 +c
429
429
430 Reversed:
430 Reversed:
431
431
432 $ hg diff --git -r -1:-3
432 $ hg diff --git -r -1:-3
433 diff --git a/bar b/foo
433 diff --git a/bar b/foo
434 rename from bar
434 rename from bar
435 rename to foo
435 rename to foo
436 --- a/bar
436 --- a/bar
437 +++ b/foo
437 +++ b/foo
438 @@ -1,3 +1,2 @@
438 @@ -1,3 +1,2 @@
439 a
439 a
440 b
440 b
441 -c
441 -c
442
442
443 File created in r1 and renamed before r2:
443 File created in r1 and renamed before r2:
444
444
445 $ hg diff --git -r -4:-1
445 $ hg diff --git -r -4:-1
446 diff --git a/foo b/bar
446 diff --git a/foo b/bar
447 rename from foo
447 rename from foo
448 rename to bar
448 rename to bar
449 --- a/foo
449 --- a/foo
450 +++ b/bar
450 +++ b/bar
451 @@ -1,1 +1,3 @@
451 @@ -1,1 +1,3 @@
452 a
452 a
453 +b
453 +b
454 +c
454 +c
455
455
456 Reversed:
456 Reversed:
457
457
458 $ hg diff --git -r -1:-4
458 $ hg diff --git -r -1:-4
459 diff --git a/bar b/foo
459 diff --git a/bar b/foo
460 rename from bar
460 rename from bar
461 rename to foo
461 rename to foo
462 --- a/bar
462 --- a/bar
463 +++ b/foo
463 +++ b/foo
464 @@ -1,3 +1,1 @@
464 @@ -1,3 +1,1 @@
465 a
465 a
466 -b
466 -b
467 -c
467 -c
468
468
469 File created after r1 and renamed before r2:
469 File created after r1 and renamed before r2:
470
470
471 $ hg diff --git -r -5:-1
471 $ hg diff --git -r -5:-1
472 diff --git a/bar b/bar
472 diff --git a/bar b/bar
473 new file mode 100644
473 new file mode 100644
474 --- /dev/null
474 --- /dev/null
475 +++ b/bar
475 +++ b/bar
476 @@ -0,0 +1,3 @@
476 @@ -0,0 +1,3 @@
477 +a
477 +a
478 +b
478 +b
479 +c
479 +c
480
480
481 Reversed:
481 Reversed:
482
482
483 $ hg diff --git -r -1:-5
483 $ hg diff --git -r -1:-5
484 diff --git a/bar b/bar
484 diff --git a/bar b/bar
485 deleted file mode 100644
485 deleted file mode 100644
486 --- a/bar
486 --- a/bar
487 +++ /dev/null
487 +++ /dev/null
488 @@ -1,3 +0,0 @@
488 @@ -1,3 +0,0 @@
489 -a
489 -a
490 -b
490 -b
491 -c
491 -c
492
492
493
493
494 Comparing with the working dir:
494 Comparing with the working dir:
495
495
496 $ echo >> start
496 $ echo >> start
497 $ hg ci -m 'change start again'
497 $ hg ci -m 'change start again'
498
498
499 $ echo > created
499 $ echo > created
500 $ hg add created
500 $ hg add created
501 $ hg ci -m 'add created'
501 $ hg ci -m 'add created'
502
502
503 $ hg mv created created2
503 $ hg mv created created2
504 $ hg ci -m 'mv created created2'
504 $ hg ci -m 'mv created created2'
505
505
506 $ hg mv created2 created3
506 $ hg mv created2 created3
507
507
508 There's a copy in the working dir:
508 There's a copy in the working dir:
509
509
510 $ hg diff --git
510 $ hg diff --git
511 diff --git a/created2 b/created3
511 diff --git a/created2 b/created3
512 rename from created2
512 rename from created2
513 rename to created3
513 rename to created3
514
514
515 There's another copy between the original rev and the wd:
515 There's another copy between the original rev and the wd:
516
516
517 $ hg diff --git -r -2
517 $ hg diff --git -r -2
518 diff --git a/created b/created3
518 diff --git a/created b/created3
519 rename from created
519 rename from created
520 rename to created3
520 rename to created3
521
521
522 The source of the copy was created after the original rev:
522 The source of the copy was created after the original rev:
523
523
524 $ hg diff --git -r -3
524 $ hg diff --git -r -3
525 diff --git a/created3 b/created3
525 diff --git a/created3 b/created3
526 new file mode 100644
526 new file mode 100644
527 --- /dev/null
527 --- /dev/null
528 +++ b/created3
528 +++ b/created3
529 @@ -0,0 +1,1 @@
529 @@ -0,0 +1,1 @@
530 +
530 +
531 $ hg ci -m 'mv created2 created3'
531 $ hg ci -m 'mv created2 created3'
532
532
533
533
534 $ echo > brand-new
534 $ echo > brand-new
535 $ hg add brand-new
535 $ hg add brand-new
536 $ hg ci -m 'add brand-new'
536 $ hg ci -m 'add brand-new'
537 $ hg mv brand-new brand-new2
537 $ hg mv brand-new brand-new2
538
538
539 Created in parent of wd; renamed in the wd:
539 Created in parent of wd; renamed in the wd:
540
540
541 $ hg diff --git
541 $ hg diff --git
542 diff --git a/brand-new b/brand-new2
542 diff --git a/brand-new b/brand-new2
543 rename from brand-new
543 rename from brand-new
544 rename to brand-new2
544 rename to brand-new2
545
545
546 Created between r1 and parent of wd; renamed in the wd:
546 Created between r1 and parent of wd; renamed in the wd:
547
547
548 $ hg diff --git -r -2
548 $ hg diff --git -r -2
549 diff --git a/brand-new2 b/brand-new2
549 diff --git a/brand-new2 b/brand-new2
550 new file mode 100644
550 new file mode 100644
551 --- /dev/null
551 --- /dev/null
552 +++ b/brand-new2
552 +++ b/brand-new2
553 @@ -0,0 +1,1 @@
553 @@ -0,0 +1,1 @@
554 +
554 +
555 $ hg ci -m 'mv brand-new brand-new2'
555 $ hg ci -m 'mv brand-new brand-new2'
556
556
557 One file is copied to many destinations and removed:
557 One file is copied to many destinations and removed:
558
558
559 $ hg cp brand-new2 brand-new3
559 $ hg cp brand-new2 brand-new3
560 $ hg mv brand-new2 brand-new3-2
560 $ hg mv brand-new2 brand-new3-2
561 $ hg ci -m 'multiple renames/copies'
561 $ hg ci -m 'multiple renames/copies'
562 $ hg diff --git -r -2 -r -1
562 $ hg diff --git -r -2 -r -1
563 diff --git a/brand-new2 b/brand-new3
563 diff --git a/brand-new2 b/brand-new3
564 rename from brand-new2
564 rename from brand-new2
565 rename to brand-new3
565 rename to brand-new3
566 diff --git a/brand-new2 b/brand-new3-2
566 diff --git a/brand-new2 b/brand-new3-2
567 copy from brand-new2
567 copy from brand-new2
568 copy to brand-new3-2
568 copy to brand-new3-2
569
569
570 Reversed:
570 Reversed:
571
571
572 $ hg diff --git -r -1 -r -2
572 $ hg diff --git -r -1 -r -2
573 diff --git a/brand-new3-2 b/brand-new2
573 diff --git a/brand-new3-2 b/brand-new2
574 rename from brand-new3-2
574 rename from brand-new3-2
575 rename to brand-new2
575 rename to brand-new2
576 diff --git a/brand-new3 b/brand-new3
576 diff --git a/brand-new3 b/brand-new3
577 deleted file mode 100644
577 deleted file mode 100644
578 --- a/brand-new3
578 --- a/brand-new3
579 +++ /dev/null
579 +++ /dev/null
580 @@ -1,1 +0,0 @@
580 @@ -1,1 +0,0 @@
581 -
581 -
582
582
583 There should be a trailing TAB if there are spaces in the file name:
583 There should be a trailing TAB if there are spaces in the file name:
584
584
585 $ echo foo > 'with spaces'
585 $ echo foo > 'with spaces'
586 $ hg add 'with spaces'
586 $ hg add 'with spaces'
587 $ hg diff --git
587 $ hg diff --git
588 diff --git a/with spaces b/with spaces
588 diff --git a/with spaces b/with spaces
589 new file mode 100644
589 new file mode 100644
590 --- /dev/null
590 --- /dev/null
591 +++ b/with spaces
591 +++ b/with spaces
592 @@ -0,0 +1,1 @@
592 @@ -0,0 +1,1 @@
593 +foo
593 +foo
594 $ hg ci -m 'add filename with spaces'
594 $ hg ci -m 'add filename with spaces'
595
595
596 Additions should be properly marked even in the middle of a merge
596 Additions should be properly marked even in the middle of a merge
597
597
598 $ hg up -r -2
598 $ hg up -r -2
599 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
599 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
600 $ echo "New File" >> inmerge
600 $ echo "New File" >> inmerge
601 $ hg add inmerge
601 $ hg add inmerge
602 $ hg ci -m "file in merge"
602 $ hg ci -m "file in merge"
603 created new head
603 created new head
604 $ hg up 23
604 $ hg up 23
605 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
605 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
606 $ hg merge
606 $ hg merge
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 (branch merge, don't forget to commit)
608 (branch merge, don't forget to commit)
609 $ hg diff -g
609 $ hg diff -g
610 diff --git a/inmerge b/inmerge
610 diff --git a/inmerge b/inmerge
611 new file mode 100644
611 new file mode 100644
612 --- /dev/null
612 --- /dev/null
613 +++ b/inmerge
613 +++ b/inmerge
614 @@ -0,0 +1,1 @@
614 @@ -0,0 +1,1 @@
615 +New File
615 +New File
@@ -1,1153 +1,1153 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [diff]
2 > [diff]
3 > git = true
3 > git = true
4 > EOF
4 > EOF
5
5
6 $ hg init
6 $ hg init
7 $ cat > foo << EOF
7 $ cat > foo << EOF
8 > 0
8 > 0
9 > 1
9 > 1
10 > 2
10 > 2
11 > 3
11 > 3
12 > 4
12 > 4
13 > EOF
13 > EOF
14 $ hg ci -Am init
14 $ hg ci -Am init
15 adding foo
15 adding foo
16 $ cat > foo << EOF
16 $ cat > foo << EOF
17 > 0
17 > 0
18 > 0
18 > 0
19 > 0
19 > 0
20 > 0
20 > 0
21 > 1
21 > 1
22 > 2
22 > 2
23 > 3
23 > 3
24 > 4
24 > 4
25 > EOF
25 > EOF
26 $ hg ci -m 'more 0'
26 $ hg ci -m 'more 0'
27 $ sed 's/2/2+/' foo > foo.new
27 $ sed 's/2/2+/' foo > foo.new
28 $ mv foo.new foo
28 $ mv foo.new foo
29 $ cat > bar << EOF
29 $ cat > bar << EOF
30 > a
30 > a
31 > b
31 > b
32 > c
32 > c
33 > d
33 > d
34 > e
34 > e
35 > EOF
35 > EOF
36 $ hg add bar
36 $ hg add bar
37 $ hg ci -Am "2 -> 2+; added bar"
37 $ hg ci -Am "2 -> 2+; added bar"
38 $ cat >> foo << EOF
38 $ cat >> foo << EOF
39 > 5
39 > 5
40 > 6
40 > 6
41 > 7
41 > 7
42 > 8
42 > 8
43 > 9
43 > 9
44 > 10
44 > 10
45 > 11
45 > 11
46 > EOF
46 > EOF
47 $ hg ci -m "to 11"
47 $ hg ci -m "to 11"
48
48
49 Add some changes with two diff hunks
49 Add some changes with two diff hunks
50
50
51 $ sed 's/^1$/ 1/' foo > foo.new
51 $ sed 's/^1$/ 1/' foo > foo.new
52 $ mv foo.new foo
52 $ mv foo.new foo
53 $ sed 's/^11$/11+/' foo > foo.new
53 $ sed 's/^11$/11+/' foo > foo.new
54 $ mv foo.new foo
54 $ mv foo.new foo
55 $ hg ci -m '11 -> 11+; leading space before "1"'
55 $ hg ci -m '11 -> 11+; leading space before "1"'
56 (make sure there are two hunks in "foo")
56 (make sure there are two hunks in "foo")
57 $ hg diff -c .
57 $ hg diff -c .
58 diff --git a/foo b/foo
58 diff --git a/foo b/foo
59 --- a/foo
59 --- a/foo
60 +++ b/foo
60 +++ b/foo
61 @@ -2,7 +2,7 @@
61 @@ -2,7 +2,7 @@
62 0
62 0
63 0
63 0
64 0
64 0
65 -1
65 -1
66 + 1
66 + 1
67 2+
67 2+
68 3
68 3
69 4
69 4
70 @@ -12,4 +12,4 @@
70 @@ -12,4 +12,4 @@
71 8
71 8
72 9
72 9
73 10
73 10
74 -11
74 -11
75 +11+
75 +11+
76 $ sed 's/3/3+/' foo > foo.new
76 $ sed 's/3/3+/' foo > foo.new
77 $ mv foo.new foo
77 $ mv foo.new foo
78 $ sed 's/^11+$/11-/' foo > foo.new
78 $ sed 's/^11+$/11-/' foo > foo.new
79 $ mv foo.new foo
79 $ mv foo.new foo
80 $ sed 's/a/a+/' bar > bar.new
80 $ sed 's/a/a+/' bar > bar.new
81 $ mv bar.new bar
81 $ mv bar.new bar
82 $ hg ci -m 'foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+'
82 $ hg ci -m 'foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+'
83 (make sure there are two hunks in "foo")
83 (make sure there are two hunks in "foo")
84 $ hg diff -c . foo
84 $ hg diff -c . foo
85 diff --git a/foo b/foo
85 diff --git a/foo b/foo
86 --- a/foo
86 --- a/foo
87 +++ b/foo
87 +++ b/foo
88 @@ -4,7 +4,7 @@
88 @@ -4,7 +4,7 @@
89 0
89 0
90 1
90 1
91 2+
91 2+
92 -3
92 -3
93 +3+
93 +3+
94 4
94 4
95 5
95 5
96 6
96 6
97 @@ -12,4 +12,4 @@
97 @@ -12,4 +12,4 @@
98 8
98 8
99 9
99 9
100 10
100 10
101 -11+
101 -11+
102 +11-
102 +11-
103
103
104 $ hg log -f -L foo,5:7 -p
104 $ hg log -f -L foo,5:7 -p
105 changeset: 5:cfdf972b3971
105 changeset: 5:cfdf972b3971
106 tag: tip
106 tag: tip
107 user: test
107 user: test
108 date: Thu Jan 01 00:00:00 1970 +0000
108 date: Thu Jan 01 00:00:00 1970 +0000
109 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
109 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
110
110
111 diff --git a/foo b/foo
111 diff --git a/foo b/foo
112 --- a/foo
112 --- a/foo
113 +++ b/foo
113 +++ b/foo
114 @@ -4,7 +4,7 @@
114 @@ -4,7 +4,7 @@
115 0
115 0
116 1
116 1
117 2+
117 2+
118 -3
118 -3
119 +3+
119 +3+
120 4
120 4
121 5
121 5
122 6
122 6
123
123
124 changeset: 4:eaec41c1a0c9
124 changeset: 4:eaec41c1a0c9
125 user: test
125 user: test
126 date: Thu Jan 01 00:00:00 1970 +0000
126 date: Thu Jan 01 00:00:00 1970 +0000
127 summary: 11 -> 11+; leading space before "1"
127 summary: 11 -> 11+; leading space before "1"
128
128
129 diff --git a/foo b/foo
129 diff --git a/foo b/foo
130 --- a/foo
130 --- a/foo
131 +++ b/foo
131 +++ b/foo
132 @@ -2,7 +2,7 @@
132 @@ -2,7 +2,7 @@
133 0
133 0
134 0
134 0
135 0
135 0
136 -1
136 -1
137 + 1
137 + 1
138 2+
138 2+
139 3
139 3
140 4
140 4
141
141
142 changeset: 2:63a884426fd0
142 changeset: 2:63a884426fd0
143 user: test
143 user: test
144 date: Thu Jan 01 00:00:00 1970 +0000
144 date: Thu Jan 01 00:00:00 1970 +0000
145 summary: 2 -> 2+; added bar
145 summary: 2 -> 2+; added bar
146
146
147 diff --git a/foo b/foo
147 diff --git a/foo b/foo
148 --- a/foo
148 --- a/foo
149 +++ b/foo
149 +++ b/foo
150 @@ -3,6 +3,6 @@
150 @@ -3,6 +3,6 @@
151 0
151 0
152 0
152 0
153 1
153 1
154 -2
154 -2
155 +2+
155 +2+
156 3
156 3
157 4
157 4
158
158
159 changeset: 0:5ae1f82b9a00
159 changeset: 0:5ae1f82b9a00
160 user: test
160 user: test
161 date: Thu Jan 01 00:00:00 1970 +0000
161 date: Thu Jan 01 00:00:00 1970 +0000
162 summary: init
162 summary: init
163
163
164 diff --git a/foo b/foo
164 diff --git a/foo b/foo
165 new file mode 100644
165 new file mode 100644
166 --- /dev/null
166 --- /dev/null
167 +++ b/foo
167 +++ b/foo
168 @@ -0,0 +1,5 @@
168 @@ -0,0 +1,5 @@
169 +0
169 +0
170 +1
170 +1
171 +2
171 +2
172 +3
172 +3
173 +4
173 +4
174
174
175 $ hg log -f --graph -L foo,5:7 -p
175 $ hg log -f --graph -L foo,5:7 -p
176 @ changeset: 5:cfdf972b3971
176 @ changeset: 5:cfdf972b3971
177 | tag: tip
177 | tag: tip
178 | user: test
178 | user: test
179 | date: Thu Jan 01 00:00:00 1970 +0000
179 | date: Thu Jan 01 00:00:00 1970 +0000
180 | summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
180 | summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
181 |
181 |
182 | diff --git a/foo b/foo
182 | diff --git a/foo b/foo
183 | --- a/foo
183 | --- a/foo
184 | +++ b/foo
184 | +++ b/foo
185 | @@ -4,7 +4,7 @@
185 | @@ -4,7 +4,7 @@
186 | 0
186 | 0
187 | 1
187 | 1
188 | 2+
188 | 2+
189 | -3
189 | -3
190 | +3+
190 | +3+
191 | 4
191 | 4
192 | 5
192 | 5
193 | 6
193 | 6
194 |
194 |
195 o changeset: 4:eaec41c1a0c9
195 o changeset: 4:eaec41c1a0c9
196 : user: test
196 : user: test
197 : date: Thu Jan 01 00:00:00 1970 +0000
197 : date: Thu Jan 01 00:00:00 1970 +0000
198 : summary: 11 -> 11+; leading space before "1"
198 : summary: 11 -> 11+; leading space before "1"
199 :
199 :
200 : diff --git a/foo b/foo
200 : diff --git a/foo b/foo
201 : --- a/foo
201 : --- a/foo
202 : +++ b/foo
202 : +++ b/foo
203 : @@ -2,7 +2,7 @@
203 : @@ -2,7 +2,7 @@
204 : 0
204 : 0
205 : 0
205 : 0
206 : 0
206 : 0
207 : -1
207 : -1
208 : + 1
208 : + 1
209 : 2+
209 : 2+
210 : 3
210 : 3
211 : 4
211 : 4
212 :
212 :
213 o changeset: 2:63a884426fd0
213 o changeset: 2:63a884426fd0
214 : user: test
214 : user: test
215 : date: Thu Jan 01 00:00:00 1970 +0000
215 : date: Thu Jan 01 00:00:00 1970 +0000
216 : summary: 2 -> 2+; added bar
216 : summary: 2 -> 2+; added bar
217 :
217 :
218 : diff --git a/foo b/foo
218 : diff --git a/foo b/foo
219 : --- a/foo
219 : --- a/foo
220 : +++ b/foo
220 : +++ b/foo
221 : @@ -3,6 +3,6 @@
221 : @@ -3,6 +3,6 @@
222 : 0
222 : 0
223 : 0
223 : 0
224 : 1
224 : 1
225 : -2
225 : -2
226 : +2+
226 : +2+
227 : 3
227 : 3
228 : 4
228 : 4
229 :
229 :
230 o changeset: 0:5ae1f82b9a00
230 o changeset: 0:5ae1f82b9a00
231 user: test
231 user: test
232 date: Thu Jan 01 00:00:00 1970 +0000
232 date: Thu Jan 01 00:00:00 1970 +0000
233 summary: init
233 summary: init
234
234
235 diff --git a/foo b/foo
235 diff --git a/foo b/foo
236 new file mode 100644
236 new file mode 100644
237 --- /dev/null
237 --- /dev/null
238 +++ b/foo
238 +++ b/foo
239 @@ -0,0 +1,5 @@
239 @@ -0,0 +1,5 @@
240 +0
240 +0
241 +1
241 +1
242 +2
242 +2
243 +3
243 +3
244 +4
244 +4
245
245
246
246
247 With --template.
247 With --template.
248
248
249 $ hg log -f -L foo,5:7 -T '{rev}:{node|short} {desc|firstline}\n'
249 $ hg log -f -L foo,5:7 -T '{rev}:{node|short} {desc|firstline}\n'
250 5:cfdf972b3971 foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
250 5:cfdf972b3971 foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
251 4:eaec41c1a0c9 11 -> 11+; leading space before "1"
251 4:eaec41c1a0c9 11 -> 11+; leading space before "1"
252 2:63a884426fd0 2 -> 2+; added bar
252 2:63a884426fd0 2 -> 2+; added bar
253 0:5ae1f82b9a00 init
253 0:5ae1f82b9a00 init
254 $ hg log -f -L foo,5:7 -T json
254 $ hg log -f -L foo,5:7 -T json
255 [
255 [
256 {
256 {
257 "bookmarks": [],
257 "bookmarks": [],
258 "branch": "default",
258 "branch": "default",
259 "date": [0, 0],
259 "date": [0, 0],
260 "desc": "foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+",
260 "desc": "foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+",
261 "node": "cfdf972b3971a2a59638bf9583c0debbffee5404",
261 "node": "cfdf972b3971a2a59638bf9583c0debbffee5404",
262 "parents": ["eaec41c1a0c9ad0a5e999611d0149d171beffb8c"],
262 "parents": ["eaec41c1a0c9ad0a5e999611d0149d171beffb8c"],
263 "phase": "draft",
263 "phase": "draft",
264 "rev": 5,
264 "rev": 5,
265 "tags": ["tip"],
265 "tags": ["tip"],
266 "user": "test"
266 "user": "test"
267 },
267 },
268 {
268 {
269 "bookmarks": [],
269 "bookmarks": [],
270 "branch": "default",
270 "branch": "default",
271 "date": [0, 0],
271 "date": [0, 0],
272 "desc": "11 -> 11+; leading space before \"1\"",
272 "desc": "11 -> 11+; leading space before \"1\"",
273 "node": "eaec41c1a0c9ad0a5e999611d0149d171beffb8c",
273 "node": "eaec41c1a0c9ad0a5e999611d0149d171beffb8c",
274 "parents": ["730a61fbaecf426c17c2c66bc42d195b5d5b0ba8"],
274 "parents": ["730a61fbaecf426c17c2c66bc42d195b5d5b0ba8"],
275 "phase": "draft",
275 "phase": "draft",
276 "rev": 4,
276 "rev": 4,
277 "tags": [],
277 "tags": [],
278 "user": "test"
278 "user": "test"
279 },
279 },
280 {
280 {
281 "bookmarks": [],
281 "bookmarks": [],
282 "branch": "default",
282 "branch": "default",
283 "date": [0, 0],
283 "date": [0, 0],
284 "desc": "2 -> 2+; added bar",
284 "desc": "2 -> 2+; added bar",
285 "node": "63a884426fd0b277fcd55895bbb2f230434576eb",
285 "node": "63a884426fd0b277fcd55895bbb2f230434576eb",
286 "parents": ["29a1e7c6b80024f63f310a2d71de979e9d2996d7"],
286 "parents": ["29a1e7c6b80024f63f310a2d71de979e9d2996d7"],
287 "phase": "draft",
287 "phase": "draft",
288 "rev": 2,
288 "rev": 2,
289 "tags": [],
289 "tags": [],
290 "user": "test"
290 "user": "test"
291 },
291 },
292 {
292 {
293 "bookmarks": [],
293 "bookmarks": [],
294 "branch": "default",
294 "branch": "default",
295 "date": [0, 0],
295 "date": [0, 0],
296 "desc": "init",
296 "desc": "init",
297 "node": "5ae1f82b9a000ff1e0967d0dac1c58b9d796e1b4",
297 "node": "5ae1f82b9a000ff1e0967d0dac1c58b9d796e1b4",
298 "parents": ["0000000000000000000000000000000000000000"],
298 "parents": ["0000000000000000000000000000000000000000"],
299 "phase": "draft",
299 "phase": "draft",
300 "rev": 0,
300 "rev": 0,
301 "tags": [],
301 "tags": [],
302 "user": "test"
302 "user": "test"
303 }
303 }
304 ]
304 ]
305
305
306 With some white-space diff option, respective revisions are skipped.
306 With some white-space diff option, respective revisions are skipped.
307
307
308 $ hg log -f -L foo,5:7 -p --config diff.ignorews=true
308 $ hg log -f -L foo,5:7 -p --config diff.ignorews=true
309 changeset: 5:cfdf972b3971
309 changeset: 5:cfdf972b3971
310 tag: tip
310 tag: tip
311 user: test
311 user: test
312 date: Thu Jan 01 00:00:00 1970 +0000
312 date: Thu Jan 01 00:00:00 1970 +0000
313 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
313 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
314
314
315 diff --git a/foo b/foo
315 diff --git a/foo b/foo
316 --- a/foo
316 --- a/foo
317 +++ b/foo
317 +++ b/foo
318 @@ -4,7 +4,7 @@
318 @@ -4,7 +4,7 @@
319 0
319 0
320 1
320 1
321 2+
321 2+
322 -3
322 -3
323 +3+
323 +3+
324 4
324 4
325 5
325 5
326 6
326 6
327
327
328 changeset: 2:63a884426fd0
328 changeset: 2:63a884426fd0
329 user: test
329 user: test
330 date: Thu Jan 01 00:00:00 1970 +0000
330 date: Thu Jan 01 00:00:00 1970 +0000
331 summary: 2 -> 2+; added bar
331 summary: 2 -> 2+; added bar
332
332
333 diff --git a/foo b/foo
333 diff --git a/foo b/foo
334 --- a/foo
334 --- a/foo
335 +++ b/foo
335 +++ b/foo
336 @@ -3,6 +3,6 @@
336 @@ -3,6 +3,6 @@
337 0
337 0
338 0
338 0
339 1
339 1
340 -2
340 -2
341 +2+
341 +2+
342 3
342 3
343 4
343 4
344
344
345 changeset: 0:5ae1f82b9a00
345 changeset: 0:5ae1f82b9a00
346 user: test
346 user: test
347 date: Thu Jan 01 00:00:00 1970 +0000
347 date: Thu Jan 01 00:00:00 1970 +0000
348 summary: init
348 summary: init
349
349
350 diff --git a/foo b/foo
350 diff --git a/foo b/foo
351 new file mode 100644
351 new file mode 100644
352 --- /dev/null
352 --- /dev/null
353 +++ b/foo
353 +++ b/foo
354 @@ -0,0 +1,5 @@
354 @@ -0,0 +1,5 @@
355 +0
355 +0
356 +1
356 +1
357 +2
357 +2
358 +3
358 +3
359 +4
359 +4
360
360
361
361
362 Regular file patterns are not allowed.
362 Regular file patterns are not allowed.
363
363
364 $ hg log -f -L foo,5:7 -p bar
364 $ hg log -f -L foo,5:7 -p bar
365 abort: FILE arguments are not compatible with --line-range option
365 abort: FILE arguments are not compatible with --line-range option
366 [10]
366 [10]
367
367
368 Option --rev acts as a restriction.
368 Option --rev acts as a restriction.
369
369
370 $ hg log -f -L foo,5:7 -p -r 'desc(2)'
370 $ hg log -f -L foo,5:7 -p -r 'desc(2)'
371 changeset: 2:63a884426fd0
371 changeset: 2:63a884426fd0
372 user: test
372 user: test
373 date: Thu Jan 01 00:00:00 1970 +0000
373 date: Thu Jan 01 00:00:00 1970 +0000
374 summary: 2 -> 2+; added bar
374 summary: 2 -> 2+; added bar
375
375
376 diff --git a/foo b/foo
376 diff --git a/foo b/foo
377 --- a/foo
377 --- a/foo
378 +++ b/foo
378 +++ b/foo
379 @@ -3,6 +3,6 @@
379 @@ -3,6 +3,6 @@
380 0
380 0
381 0
381 0
382 1
382 1
383 -2
383 -2
384 +2+
384 +2+
385 3
385 3
386 4
386 4
387
387
388 changeset: 0:5ae1f82b9a00
388 changeset: 0:5ae1f82b9a00
389 user: test
389 user: test
390 date: Thu Jan 01 00:00:00 1970 +0000
390 date: Thu Jan 01 00:00:00 1970 +0000
391 summary: init
391 summary: init
392
392
393 diff --git a/foo b/foo
393 diff --git a/foo b/foo
394 new file mode 100644
394 new file mode 100644
395 --- /dev/null
395 --- /dev/null
396 +++ b/foo
396 +++ b/foo
397 @@ -0,0 +1,5 @@
397 @@ -0,0 +1,5 @@
398 +0
398 +0
399 +1
399 +1
400 +2
400 +2
401 +3
401 +3
402 +4
402 +4
403
403
404
404
405 With several -L patterns, changes touching any files in their respective line
405 With several -L patterns, changes touching any files in their respective line
406 range are show.
406 range are show.
407
407
408 $ hg log -f -L foo,5:7 -L bar,1:2 -p
408 $ hg log -f -L foo,5:7 -L bar,1:2 -p
409 changeset: 5:cfdf972b3971
409 changeset: 5:cfdf972b3971
410 tag: tip
410 tag: tip
411 user: test
411 user: test
412 date: Thu Jan 01 00:00:00 1970 +0000
412 date: Thu Jan 01 00:00:00 1970 +0000
413 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
413 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
414
414
415 diff --git a/bar b/bar
415 diff --git a/bar b/bar
416 --- a/bar
416 --- a/bar
417 +++ b/bar
417 +++ b/bar
418 @@ -1,4 +1,4 @@
418 @@ -1,4 +1,4 @@
419 -a
419 -a
420 +a+
420 +a+
421 b
421 b
422 c
422 c
423 d
423 d
424 diff --git a/foo b/foo
424 diff --git a/foo b/foo
425 --- a/foo
425 --- a/foo
426 +++ b/foo
426 +++ b/foo
427 @@ -4,7 +4,7 @@
427 @@ -4,7 +4,7 @@
428 0
428 0
429 1
429 1
430 2+
430 2+
431 -3
431 -3
432 +3+
432 +3+
433 4
433 4
434 5
434 5
435 6
435 6
436
436
437 changeset: 4:eaec41c1a0c9
437 changeset: 4:eaec41c1a0c9
438 user: test
438 user: test
439 date: Thu Jan 01 00:00:00 1970 +0000
439 date: Thu Jan 01 00:00:00 1970 +0000
440 summary: 11 -> 11+; leading space before "1"
440 summary: 11 -> 11+; leading space before "1"
441
441
442 diff --git a/foo b/foo
442 diff --git a/foo b/foo
443 --- a/foo
443 --- a/foo
444 +++ b/foo
444 +++ b/foo
445 @@ -2,7 +2,7 @@
445 @@ -2,7 +2,7 @@
446 0
446 0
447 0
447 0
448 0
448 0
449 -1
449 -1
450 + 1
450 + 1
451 2+
451 2+
452 3
452 3
453 4
453 4
454
454
455 changeset: 2:63a884426fd0
455 changeset: 2:63a884426fd0
456 user: test
456 user: test
457 date: Thu Jan 01 00:00:00 1970 +0000
457 date: Thu Jan 01 00:00:00 1970 +0000
458 summary: 2 -> 2+; added bar
458 summary: 2 -> 2+; added bar
459
459
460 diff --git a/bar b/bar
460 diff --git a/bar b/bar
461 new file mode 100644
461 new file mode 100644
462 --- /dev/null
462 --- /dev/null
463 +++ b/bar
463 +++ b/bar
464 @@ -0,0 +1,5 @@
464 @@ -0,0 +1,5 @@
465 +a
465 +a
466 +b
466 +b
467 +c
467 +c
468 +d
468 +d
469 +e
469 +e
470 diff --git a/foo b/foo
470 diff --git a/foo b/foo
471 --- a/foo
471 --- a/foo
472 +++ b/foo
472 +++ b/foo
473 @@ -3,6 +3,6 @@
473 @@ -3,6 +3,6 @@
474 0
474 0
475 0
475 0
476 1
476 1
477 -2
477 -2
478 +2+
478 +2+
479 3
479 3
480 4
480 4
481
481
482 changeset: 0:5ae1f82b9a00
482 changeset: 0:5ae1f82b9a00
483 user: test
483 user: test
484 date: Thu Jan 01 00:00:00 1970 +0000
484 date: Thu Jan 01 00:00:00 1970 +0000
485 summary: init
485 summary: init
486
486
487 diff --git a/foo b/foo
487 diff --git a/foo b/foo
488 new file mode 100644
488 new file mode 100644
489 --- /dev/null
489 --- /dev/null
490 +++ b/foo
490 +++ b/foo
491 @@ -0,0 +1,5 @@
491 @@ -0,0 +1,5 @@
492 +0
492 +0
493 +1
493 +1
494 +2
494 +2
495 +3
495 +3
496 +4
496 +4
497
497
498
498
499 Multiple -L options with the same file yields changes touching any of
499 Multiple -L options with the same file yields changes touching any of
500 specified line ranges.
500 specified line ranges.
501
501
502 $ hg log -f -L foo,5:7 -L foo,14:15 -p
502 $ hg log -f -L foo,5:7 -L foo,14:15 -p
503 changeset: 5:cfdf972b3971
503 changeset: 5:cfdf972b3971
504 tag: tip
504 tag: tip
505 user: test
505 user: test
506 date: Thu Jan 01 00:00:00 1970 +0000
506 date: Thu Jan 01 00:00:00 1970 +0000
507 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
507 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
508
508
509 diff --git a/foo b/foo
509 diff --git a/foo b/foo
510 --- a/foo
510 --- a/foo
511 +++ b/foo
511 +++ b/foo
512 @@ -4,7 +4,7 @@
512 @@ -4,7 +4,7 @@
513 0
513 0
514 1
514 1
515 2+
515 2+
516 -3
516 -3
517 +3+
517 +3+
518 4
518 4
519 5
519 5
520 6
520 6
521 @@ -12,4 +12,4 @@
521 @@ -12,4 +12,4 @@
522 8
522 8
523 9
523 9
524 10
524 10
525 -11+
525 -11+
526 +11-
526 +11-
527
527
528 changeset: 4:eaec41c1a0c9
528 changeset: 4:eaec41c1a0c9
529 user: test
529 user: test
530 date: Thu Jan 01 00:00:00 1970 +0000
530 date: Thu Jan 01 00:00:00 1970 +0000
531 summary: 11 -> 11+; leading space before "1"
531 summary: 11 -> 11+; leading space before "1"
532
532
533 diff --git a/foo b/foo
533 diff --git a/foo b/foo
534 --- a/foo
534 --- a/foo
535 +++ b/foo
535 +++ b/foo
536 @@ -2,7 +2,7 @@
536 @@ -2,7 +2,7 @@
537 0
537 0
538 0
538 0
539 0
539 0
540 -1
540 -1
541 + 1
541 + 1
542 2+
542 2+
543 3
543 3
544 4
544 4
545 @@ -12,4 +12,4 @@
545 @@ -12,4 +12,4 @@
546 8
546 8
547 9
547 9
548 10
548 10
549 -11
549 -11
550 +11+
550 +11+
551
551
552 changeset: 3:730a61fbaecf
552 changeset: 3:730a61fbaecf
553 user: test
553 user: test
554 date: Thu Jan 01 00:00:00 1970 +0000
554 date: Thu Jan 01 00:00:00 1970 +0000
555 summary: to 11
555 summary: to 11
556
556
557 diff --git a/foo b/foo
557 diff --git a/foo b/foo
558 --- a/foo
558 --- a/foo
559 +++ b/foo
559 +++ b/foo
560 @@ -6,3 +6,10 @@
560 @@ -6,3 +6,10 @@
561 2+
561 2+
562 3
562 3
563 4
563 4
564 +5
564 +5
565 +6
565 +6
566 +7
566 +7
567 +8
567 +8
568 +9
568 +9
569 +10
569 +10
570 +11
570 +11
571
571
572 changeset: 2:63a884426fd0
572 changeset: 2:63a884426fd0
573 user: test
573 user: test
574 date: Thu Jan 01 00:00:00 1970 +0000
574 date: Thu Jan 01 00:00:00 1970 +0000
575 summary: 2 -> 2+; added bar
575 summary: 2 -> 2+; added bar
576
576
577 diff --git a/foo b/foo
577 diff --git a/foo b/foo
578 --- a/foo
578 --- a/foo
579 +++ b/foo
579 +++ b/foo
580 @@ -3,6 +3,6 @@
580 @@ -3,6 +3,6 @@
581 0
581 0
582 0
582 0
583 1
583 1
584 -2
584 -2
585 +2+
585 +2+
586 3
586 3
587 4
587 4
588
588
589 changeset: 0:5ae1f82b9a00
589 changeset: 0:5ae1f82b9a00
590 user: test
590 user: test
591 date: Thu Jan 01 00:00:00 1970 +0000
591 date: Thu Jan 01 00:00:00 1970 +0000
592 summary: init
592 summary: init
593
593
594 diff --git a/foo b/foo
594 diff --git a/foo b/foo
595 new file mode 100644
595 new file mode 100644
596 --- /dev/null
596 --- /dev/null
597 +++ b/foo
597 +++ b/foo
598 @@ -0,0 +1,5 @@
598 @@ -0,0 +1,5 @@
599 +0
599 +0
600 +1
600 +1
601 +2
601 +2
602 +3
602 +3
603 +4
603 +4
604
604
605
605
606 A file with a comma in its name.
606 A file with a comma in its name.
607
607
608 $ cat > ba,z << EOF
608 $ cat > ba,z << EOF
609 > q
609 > q
610 > w
610 > w
611 > e
611 > e
612 > r
612 > r
613 > t
613 > t
614 > y
614 > y
615 > EOF
615 > EOF
616 $ hg ci -Am 'querty'
616 $ hg ci -Am 'querty'
617 adding ba,z
617 adding ba,z
618 $ cat >> ba,z << EOF
618 $ cat >> ba,z << EOF
619 > u
619 > u
620 > i
620 > i
621 > o
621 > o
622 > p
622 > p
623 > EOF
623 > EOF
624 $ hg ci -m 'more keys'
624 $ hg ci -m 'more keys'
625 $ cat > ba,z << EOF
625 $ cat > ba,z << EOF
626 > a
626 > a
627 > z
627 > z
628 > e
628 > e
629 > r
629 > r
630 > t
630 > t
631 > y
631 > y
632 > u
632 > u
633 > i
633 > i
634 > o
634 > o
635 > p
635 > p
636 > EOF
636 > EOF
637 $ hg ci -m 'azerty'
637 $ hg ci -m 'azerty'
638 $ hg log -f -L ba,z,1:2 -p
638 $ hg log -f -L ba,z,1:2 -p
639 changeset: 8:52373265138b
639 changeset: 8:52373265138b
640 tag: tip
640 tag: tip
641 user: test
641 user: test
642 date: Thu Jan 01 00:00:00 1970 +0000
642 date: Thu Jan 01 00:00:00 1970 +0000
643 summary: azerty
643 summary: azerty
644
644
645 diff --git a/ba,z b/ba,z
645 diff --git a/ba,z b/ba,z
646 --- a/ba,z
646 --- a/ba,z
647 +++ b/ba,z
647 +++ b/ba,z
648 @@ -1,5 +1,5 @@
648 @@ -1,5 +1,5 @@
649 -q
649 -q
650 -w
650 -w
651 +a
651 +a
652 +z
652 +z
653 e
653 e
654 r
654 r
655 t
655 t
656
656
657 changeset: 6:96ba8850f316
657 changeset: 6:96ba8850f316
658 user: test
658 user: test
659 date: Thu Jan 01 00:00:00 1970 +0000
659 date: Thu Jan 01 00:00:00 1970 +0000
660 summary: querty
660 summary: querty
661
661
662 diff --git a/ba,z b/ba,z
662 diff --git a/ba,z b/ba,z
663 new file mode 100644
663 new file mode 100644
664 --- /dev/null
664 --- /dev/null
665 +++ b/ba,z
665 +++ b/ba,z
666 @@ -0,0 +1,6 @@
666 @@ -0,0 +1,6 @@
667 +q
667 +q
668 +w
668 +w
669 +e
669 +e
670 +r
670 +r
671 +t
671 +t
672 +y
672 +y
673
673
674
674
675 Exact prefix kinds work in -L options.
675 Exact prefix kinds work in -L options.
676
676
677 $ mkdir dir
677 $ mkdir dir
678 $ cd dir
678 $ cd dir
679 $ hg log -f -L path:foo,5:7 -p
679 $ hg log -f -L path:foo,5:7 -p
680 changeset: 5:cfdf972b3971
680 changeset: 5:cfdf972b3971
681 user: test
681 user: test
682 date: Thu Jan 01 00:00:00 1970 +0000
682 date: Thu Jan 01 00:00:00 1970 +0000
683 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
683 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
684
684
685 diff --git a/foo b/foo
685 diff --git a/foo b/foo
686 --- a/foo
686 --- a/foo
687 +++ b/foo
687 +++ b/foo
688 @@ -4,7 +4,7 @@
688 @@ -4,7 +4,7 @@
689 0
689 0
690 1
690 1
691 2+
691 2+
692 -3
692 -3
693 +3+
693 +3+
694 4
694 4
695 5
695 5
696 6
696 6
697
697
698 changeset: 4:eaec41c1a0c9
698 changeset: 4:eaec41c1a0c9
699 user: test
699 user: test
700 date: Thu Jan 01 00:00:00 1970 +0000
700 date: Thu Jan 01 00:00:00 1970 +0000
701 summary: 11 -> 11+; leading space before "1"
701 summary: 11 -> 11+; leading space before "1"
702
702
703 diff --git a/foo b/foo
703 diff --git a/foo b/foo
704 --- a/foo
704 --- a/foo
705 +++ b/foo
705 +++ b/foo
706 @@ -2,7 +2,7 @@
706 @@ -2,7 +2,7 @@
707 0
707 0
708 0
708 0
709 0
709 0
710 -1
710 -1
711 + 1
711 + 1
712 2+
712 2+
713 3
713 3
714 4
714 4
715
715
716 changeset: 2:63a884426fd0
716 changeset: 2:63a884426fd0
717 user: test
717 user: test
718 date: Thu Jan 01 00:00:00 1970 +0000
718 date: Thu Jan 01 00:00:00 1970 +0000
719 summary: 2 -> 2+; added bar
719 summary: 2 -> 2+; added bar
720
720
721 diff --git a/foo b/foo
721 diff --git a/foo b/foo
722 --- a/foo
722 --- a/foo
723 +++ b/foo
723 +++ b/foo
724 @@ -3,6 +3,6 @@
724 @@ -3,6 +3,6 @@
725 0
725 0
726 0
726 0
727 1
727 1
728 -2
728 -2
729 +2+
729 +2+
730 3
730 3
731 4
731 4
732
732
733 changeset: 0:5ae1f82b9a00
733 changeset: 0:5ae1f82b9a00
734 user: test
734 user: test
735 date: Thu Jan 01 00:00:00 1970 +0000
735 date: Thu Jan 01 00:00:00 1970 +0000
736 summary: init
736 summary: init
737
737
738 diff --git a/foo b/foo
738 diff --git a/foo b/foo
739 new file mode 100644
739 new file mode 100644
740 --- /dev/null
740 --- /dev/null
741 +++ b/foo
741 +++ b/foo
742 @@ -0,0 +1,5 @@
742 @@ -0,0 +1,5 @@
743 +0
743 +0
744 +1
744 +1
745 +2
745 +2
746 +3
746 +3
747 +4
747 +4
748
748
749
749
750 Renames are followed.
750 Renames are followed.
751
751
752 $ hg mv ../foo baz
752 $ hg mv ../foo baz
753 $ sed 's/1/1+/' baz > baz.new
753 $ sed 's/1/1+/' baz > baz.new
754 $ mv baz.new baz
754 $ mv baz.new baz
755 $ hg ci -m 'foo -> dir/baz; 1-1+'
755 $ hg ci -m 'foo -> dir/baz; 1-1+'
756 $ hg diff -c .
756 $ hg diff -c .
757 diff --git a/foo b/dir/baz
757 diff --git a/foo b/dir/baz
758 rename from foo
758 rename from foo
759 rename to dir/baz
759 rename to dir/baz
760 --- a/foo
760 --- a/foo
761 +++ b/dir/baz
761 +++ b/dir/baz
762 @@ -2,7 +2,7 @@
762 @@ -2,7 +2,7 @@
763 0
763 0
764 0
764 0
765 0
765 0
766 - 1
766 - 1
767 + 1+
767 + 1+
768 2+
768 2+
769 3+
769 3+
770 4
770 4
771 @@ -11,5 +11,5 @@
771 @@ -11,5 +11,5 @@
772 7
772 7
773 8
773 8
774 9
774 9
775 -10
775 -10
776 -11-
776 -11-
777 +1+0
777 +1+0
778 +1+1-
778 +1+1-
779 $ hg log -f -L relpath:baz,5:7 -p
779 $ hg log -f -L relpath:baz,5:7 -p
780 changeset: 9:6af29c3a778f
780 changeset: 9:6af29c3a778f
781 tag: tip
781 tag: tip
782 user: test
782 user: test
783 date: Thu Jan 01 00:00:00 1970 +0000
783 date: Thu Jan 01 00:00:00 1970 +0000
784 summary: foo -> dir/baz; 1-1+
784 summary: foo -> dir/baz; 1-1+
785
785
786 diff --git a/foo b/dir/baz
786 diff --git a/foo b/dir/baz
787 copy from foo
787 copy from foo
788 copy to dir/baz
788 copy to dir/baz
789 --- a/foo
789 --- a/foo
790 +++ b/dir/baz
790 +++ b/dir/baz
791 @@ -2,7 +2,7 @@
791 @@ -2,7 +2,7 @@
792 0
792 0
793 0
793 0
794 0
794 0
795 - 1
795 - 1
796 + 1+
796 + 1+
797 2+
797 2+
798 3+
798 3+
799 4
799 4
800
800
801 changeset: 5:cfdf972b3971
801 changeset: 5:cfdf972b3971
802 user: test
802 user: test
803 date: Thu Jan 01 00:00:00 1970 +0000
803 date: Thu Jan 01 00:00:00 1970 +0000
804 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
804 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
805
805
806 diff --git a/foo b/foo
806 diff --git a/foo b/foo
807 --- a/foo
807 --- a/foo
808 +++ b/foo
808 +++ b/foo
809 @@ -4,7 +4,7 @@
809 @@ -4,7 +4,7 @@
810 0
810 0
811 1
811 1
812 2+
812 2+
813 -3
813 -3
814 +3+
814 +3+
815 4
815 4
816 5
816 5
817 6
817 6
818
818
819 changeset: 4:eaec41c1a0c9
819 changeset: 4:eaec41c1a0c9
820 user: test
820 user: test
821 date: Thu Jan 01 00:00:00 1970 +0000
821 date: Thu Jan 01 00:00:00 1970 +0000
822 summary: 11 -> 11+; leading space before "1"
822 summary: 11 -> 11+; leading space before "1"
823
823
824 diff --git a/foo b/foo
824 diff --git a/foo b/foo
825 --- a/foo
825 --- a/foo
826 +++ b/foo
826 +++ b/foo
827 @@ -2,7 +2,7 @@
827 @@ -2,7 +2,7 @@
828 0
828 0
829 0
829 0
830 0
830 0
831 -1
831 -1
832 + 1
832 + 1
833 2+
833 2+
834 3
834 3
835 4
835 4
836
836
837 changeset: 2:63a884426fd0
837 changeset: 2:63a884426fd0
838 user: test
838 user: test
839 date: Thu Jan 01 00:00:00 1970 +0000
839 date: Thu Jan 01 00:00:00 1970 +0000
840 summary: 2 -> 2+; added bar
840 summary: 2 -> 2+; added bar
841
841
842 diff --git a/foo b/foo
842 diff --git a/foo b/foo
843 --- a/foo
843 --- a/foo
844 +++ b/foo
844 +++ b/foo
845 @@ -3,6 +3,6 @@
845 @@ -3,6 +3,6 @@
846 0
846 0
847 0
847 0
848 1
848 1
849 -2
849 -2
850 +2+
850 +2+
851 3
851 3
852 4
852 4
853
853
854 changeset: 0:5ae1f82b9a00
854 changeset: 0:5ae1f82b9a00
855 user: test
855 user: test
856 date: Thu Jan 01 00:00:00 1970 +0000
856 date: Thu Jan 01 00:00:00 1970 +0000
857 summary: init
857 summary: init
858
858
859 diff --git a/foo b/foo
859 diff --git a/foo b/foo
860 new file mode 100644
860 new file mode 100644
861 --- /dev/null
861 --- /dev/null
862 +++ b/foo
862 +++ b/foo
863 @@ -0,0 +1,5 @@
863 @@ -0,0 +1,5 @@
864 +0
864 +0
865 +1
865 +1
866 +2
866 +2
867 +3
867 +3
868 +4
868 +4
869
869
870
870
871 Uncommitted changes with a rename
871 Uncommitted changes with a rename
872
872
873 $ hg mv baz bazn
873 $ hg mv baz bazn
874 $ hg log -f -L bazn,5:7
874 $ hg log -f -L bazn,5:7
875 changeset: 9:6af29c3a778f
875 changeset: 9:6af29c3a778f
876 tag: tip
876 tag: tip
877 user: test
877 user: test
878 date: Thu Jan 01 00:00:00 1970 +0000
878 date: Thu Jan 01 00:00:00 1970 +0000
879 summary: foo -> dir/baz; 1-1+
879 summary: foo -> dir/baz; 1-1+
880
880
881 changeset: 5:cfdf972b3971
881 changeset: 5:cfdf972b3971
882 user: test
882 user: test
883 date: Thu Jan 01 00:00:00 1970 +0000
883 date: Thu Jan 01 00:00:00 1970 +0000
884 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
884 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
885
885
886 changeset: 4:eaec41c1a0c9
886 changeset: 4:eaec41c1a0c9
887 user: test
887 user: test
888 date: Thu Jan 01 00:00:00 1970 +0000
888 date: Thu Jan 01 00:00:00 1970 +0000
889 summary: 11 -> 11+; leading space before "1"
889 summary: 11 -> 11+; leading space before "1"
890
890
891 changeset: 2:63a884426fd0
891 changeset: 2:63a884426fd0
892 user: test
892 user: test
893 date: Thu Jan 01 00:00:00 1970 +0000
893 date: Thu Jan 01 00:00:00 1970 +0000
894 summary: 2 -> 2+; added bar
894 summary: 2 -> 2+; added bar
895
895
896 changeset: 0:5ae1f82b9a00
896 changeset: 0:5ae1f82b9a00
897 user: test
897 user: test
898 date: Thu Jan 01 00:00:00 1970 +0000
898 date: Thu Jan 01 00:00:00 1970 +0000
899 summary: init
899 summary: init
900
900
901
901
902 Uncommitted changes in requested line range
902 Uncommitted changes in requested line range
903
903
904 $ sed 's/2/ /' bazn > bazn.new
904 $ sed 's/2/ /' bazn > bazn.new
905 $ mv bazn.new bazn
905 $ mv bazn.new bazn
906 $ hg diff
906 $ hg diff
907 diff --git a/dir/baz b/dir/bazn
907 diff --git a/dir/baz b/dir/bazn
908 rename from dir/baz
908 rename from dir/baz
909 rename to dir/bazn
909 rename to dir/bazn
910 --- a/dir/baz
910 --- a/dir/baz
911 +++ b/dir/bazn
911 +++ b/dir/bazn
912 @@ -3,7 +3,7 @@
912 @@ -3,7 +3,7 @@
913 0
913 0
914 0
914 0
915 1+
915 1+
916 -2+
916 -2+
917 + +
917 + +
918 3+
918 3+
919 4
919 4
920 5
920 5
921 $ hg log -f -L bazn,5:7
921 $ hg log -f -L bazn,5:7
922 changeset: 9:6af29c3a778f
922 changeset: 9:6af29c3a778f
923 tag: tip
923 tag: tip
924 user: test
924 user: test
925 date: Thu Jan 01 00:00:00 1970 +0000
925 date: Thu Jan 01 00:00:00 1970 +0000
926 summary: foo -> dir/baz; 1-1+
926 summary: foo -> dir/baz; 1-1+
927
927
928 changeset: 5:cfdf972b3971
928 changeset: 5:cfdf972b3971
929 user: test
929 user: test
930 date: Thu Jan 01 00:00:00 1970 +0000
930 date: Thu Jan 01 00:00:00 1970 +0000
931 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
931 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
932
932
933 changeset: 4:eaec41c1a0c9
933 changeset: 4:eaec41c1a0c9
934 user: test
934 user: test
935 date: Thu Jan 01 00:00:00 1970 +0000
935 date: Thu Jan 01 00:00:00 1970 +0000
936 summary: 11 -> 11+; leading space before "1"
936 summary: 11 -> 11+; leading space before "1"
937
937
938 changeset: 2:63a884426fd0
938 changeset: 2:63a884426fd0
939 user: test
939 user: test
940 date: Thu Jan 01 00:00:00 1970 +0000
940 date: Thu Jan 01 00:00:00 1970 +0000
941 summary: 2 -> 2+; added bar
941 summary: 2 -> 2+; added bar
942
942
943 changeset: 0:5ae1f82b9a00
943 changeset: 0:5ae1f82b9a00
944 user: test
944 user: test
945 date: Thu Jan 01 00:00:00 1970 +0000
945 date: Thu Jan 01 00:00:00 1970 +0000
946 summary: init
946 summary: init
947
947
948
948
949 Uncommitted changes in line-range + wdir()
949 Uncommitted changes in line-range + wdir()
950
950
951 $ hg log -r 'wdir()' -f -L bazn,5:7 --limit 2 -p
951 $ hg log -r 'wdir()' -f -L bazn,5:7 --limit 2 -p
952 changeset: 2147483647:ffffffffffff
952 changeset: 2147483647:ffffffffffff
953 parent: 9:6af29c3a778f
953 parent: 9:6af29c3a778f
954 user: test
954 user: test
955 date: Thu Jan 01 00:00:00 1970 +0000
955 date: Thu Jan 01 00:00:00 1970 +0000
956
956
957 diff --git a/dir/baz b/dir/bazn
957 diff --git a/dir/baz b/dir/bazn
958 copy from dir/baz
958 copy from dir/baz
959 copy to dir/bazn
959 copy to dir/bazn
960 --- a/dir/baz
960 --- a/dir/baz
961 +++ b/dir/bazn
961 +++ b/dir/bazn
962 @@ -3,7 +3,7 @@
962 @@ -3,7 +3,7 @@
963 0
963 0
964 0
964 0
965 1+
965 1+
966 -2+
966 -2+
967 + +
967 + +
968 3+
968 3+
969 4
969 4
970 5
970 5
971
971
972 changeset: 9:6af29c3a778f
972 changeset: 9:6af29c3a778f
973 tag: tip
973 tag: tip
974 user: test
974 user: test
975 date: Thu Jan 01 00:00:00 1970 +0000
975 date: Thu Jan 01 00:00:00 1970 +0000
976 summary: foo -> dir/baz; 1-1+
976 summary: foo -> dir/baz; 1-1+
977
977
978 diff --git a/foo b/dir/baz
978 diff --git a/foo b/dir/baz
979 copy from foo
979 copy from foo
980 copy to dir/baz
980 copy to dir/baz
981 --- a/foo
981 --- a/foo
982 +++ b/dir/baz
982 +++ b/dir/baz
983 @@ -2,7 +2,7 @@
983 @@ -2,7 +2,7 @@
984 0
984 0
985 0
985 0
986 0
986 0
987 - 1
987 - 1
988 + 1+
988 + 1+
989 2+
989 2+
990 3+
990 3+
991 4
991 4
992
992
993
993
994 $ hg revert -a -C -q
994 $ hg revert -a -C -q
995
995
996 Copies.
996 Copies.
997
997
998 $ hg copy baz bbaz
998 $ hg copy baz bbaz
999 $ sed 's/6/6+/' bbaz > bbaz.new
999 $ sed 's/6/6+/' bbaz > bbaz.new
1000 $ mv bbaz.new bbaz
1000 $ mv bbaz.new bbaz
1001 $ hg commit -m 'cp baz bbaz; 6-6+'
1001 $ hg commit -m 'cp baz bbaz; 6-6+'
1002 $ hg diff -c .
1002 $ hg diff -c .
1003 diff --git a/dir/baz b/dir/bbaz
1003 diff --git a/dir/baz b/dir/bbaz
1004 copy from dir/baz
1004 copy from dir/baz
1005 copy to dir/bbaz
1005 copy to dir/bbaz
1006 --- a/dir/baz
1006 --- a/dir/baz
1007 +++ b/dir/bbaz
1007 +++ b/dir/bbaz
1008 @@ -7,7 +7,7 @@
1008 @@ -7,7 +7,7 @@
1009 3+
1009 3+
1010 4
1010 4
1011 5
1011 5
1012 -6
1012 -6
1013 +6+
1013 +6+
1014 7
1014 7
1015 8
1015 8
1016 9
1016 9
1017 $ hg log --copies -f -L bbaz,10:11 -p
1017 $ hg log --copies -f -L bbaz,10:11 -p
1018 changeset: 10:91a3d3b6c546
1018 changeset: 10:91a3d3b6c546
1019 tag: tip
1019 tag: tip
1020 user: test
1020 user: test
1021 date: Thu Jan 01 00:00:00 1970 +0000
1021 date: Thu Jan 01 00:00:00 1970 +0000
1022 summary: cp baz bbaz; 6-6+
1022 summary: cp baz bbaz; 6-6+
1023
1023
1024 diff --git a/dir/baz b/dir/bbaz
1024 diff --git a/dir/baz b/dir/bbaz
1025 copy from dir/baz
1025 copy from dir/baz
1026 copy to dir/bbaz
1026 copy to dir/bbaz
1027 --- a/dir/baz
1027 --- a/dir/baz
1028 +++ b/dir/bbaz
1028 +++ b/dir/bbaz
1029 @@ -7,7 +7,7 @@
1029 @@ -7,7 +7,7 @@
1030 3+
1030 3+
1031 4
1031 4
1032 5
1032 5
1033 -6
1033 -6
1034 +6+
1034 +6+
1035 7
1035 7
1036 8
1036 8
1037 9
1037 9
1038
1038
1039 changeset: 3:730a61fbaecf
1039 changeset: 3:730a61fbaecf
1040 user: test
1040 user: test
1041 date: Thu Jan 01 00:00:00 1970 +0000
1041 date: Thu Jan 01 00:00:00 1970 +0000
1042 summary: to 11
1042 summary: to 11
1043
1043
1044 diff --git a/foo b/foo
1044 diff --git a/foo b/foo
1045 --- a/foo
1045 --- a/foo
1046 +++ b/foo
1046 +++ b/foo
1047 @@ -6,3 +6,10 @@
1047 @@ -6,3 +6,10 @@
1048 2+
1048 2+
1049 3
1049 3
1050 4
1050 4
1051 +5
1051 +5
1052 +6
1052 +6
1053 +7
1053 +7
1054 +8
1054 +8
1055 +9
1055 +9
1056 +10
1056 +10
1057 +11
1057 +11
1058
1058
1059 $ hg log -f -L bbaz,10:11 -p
1059 $ hg log -f -L bbaz,10:11 -p
1060 changeset: 10:91a3d3b6c546
1060 changeset: 10:91a3d3b6c546
1061 tag: tip
1061 tag: tip
1062 user: test
1062 user: test
1063 date: Thu Jan 01 00:00:00 1970 +0000
1063 date: Thu Jan 01 00:00:00 1970 +0000
1064 summary: cp baz bbaz; 6-6+
1064 summary: cp baz bbaz; 6-6+
1065
1065
1066 diff --git a/dir/baz b/dir/bbaz
1066 diff --git a/dir/baz b/dir/bbaz
1067 copy from dir/baz
1067 copy from dir/baz
1068 copy to dir/bbaz
1068 copy to dir/bbaz
1069 --- a/dir/baz
1069 --- a/dir/baz
1070 +++ b/dir/bbaz
1070 +++ b/dir/bbaz
1071 @@ -7,7 +7,7 @@
1071 @@ -7,7 +7,7 @@
1072 3+
1072 3+
1073 4
1073 4
1074 5
1074 5
1075 -6
1075 -6
1076 +6+
1076 +6+
1077 7
1077 7
1078 8
1078 8
1079 9
1079 9
1080
1080
1081 changeset: 3:730a61fbaecf
1081 changeset: 3:730a61fbaecf
1082 user: test
1082 user: test
1083 date: Thu Jan 01 00:00:00 1970 +0000
1083 date: Thu Jan 01 00:00:00 1970 +0000
1084 summary: to 11
1084 summary: to 11
1085
1085
1086 diff --git a/foo b/foo
1086 diff --git a/foo b/foo
1087 --- a/foo
1087 --- a/foo
1088 +++ b/foo
1088 +++ b/foo
1089 @@ -6,3 +6,10 @@
1089 @@ -6,3 +6,10 @@
1090 2+
1090 2+
1091 3
1091 3
1092 4
1092 4
1093 +5
1093 +5
1094 +6
1094 +6
1095 +7
1095 +7
1096 +8
1096 +8
1097 +9
1097 +9
1098 +10
1098 +10
1099 +11
1099 +11
1100
1100
1101
1101
1102 Binary files work but without diff hunks filtering.
1102 Binary files work but without diff hunks filtering.
1103 (Checking w/ and w/o diff.git option.)
1103 (Checking w/ and w/o diff.git option.)
1104
1104
1105 >>> open('binary', 'wb').write(b'this\nis\na\nbinary\0') and None
1105 >>> open('binary', 'wb').write(b'this\nis\na\nbinary\0') and None
1106 $ hg add binary
1106 $ hg add binary
1107 $ hg ci -m 'add a binary file' --quiet
1107 $ hg ci -m 'add a binary file' --quiet
1108 $ hg log -f -L binary,1:2 -p
1108 $ hg log -f -L binary,1:2 -p
1109 changeset: 11:dc865b608edf
1109 changeset: 11:dc865b608edf
1110 tag: tip
1110 tag: tip
1111 user: test
1111 user: test
1112 date: Thu Jan 01 00:00:00 1970 +0000
1112 date: Thu Jan 01 00:00:00 1970 +0000
1113 summary: add a binary file
1113 summary: add a binary file
1114
1114
1115 diff --git a/dir/binary b/dir/binary
1115 diff --git a/dir/binary b/dir/binary
1116 new file mode 100644
1116 new file mode 100644
1117 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c2e1fbed209fe919b3f189a6a31950e9adf61e45
1117 index 0000000000000000000000000000000000000000..c2e1fbed209fe919b3f189a6a31950e9adf61e45
1118 GIT binary patch
1118 GIT binary patch
1119 literal 17
1119 literal 17
1120 Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy
1120 Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy
1121
1121
1122
1122
1123 $ hg log -f -L binary,1:2 -p --config diff.git=false
1123 $ hg log -f -L binary,1:2 -p --config diff.git=false
1124 changeset: 11:dc865b608edf
1124 changeset: 11:dc865b608edf
1125 tag: tip
1125 tag: tip
1126 user: test
1126 user: test
1127 date: Thu Jan 01 00:00:00 1970 +0000
1127 date: Thu Jan 01 00:00:00 1970 +0000
1128 summary: add a binary file
1128 summary: add a binary file
1129
1129
1130 diff -r 91a3d3b6c546 -r dc865b608edf dir/binary
1130 diff -r 91a3d3b6c546 -r dc865b608edf dir/binary
1131 Binary file dir/binary has changed
1131 Binary file dir/binary has changed
1132
1132
1133
1133
1134 Option --follow is required.
1134 Option --follow is required.
1135
1135
1136 $ hg log -L foo,5:7
1136 $ hg log -L foo,5:7
1137 abort: --line-range requires --follow
1137 abort: --line-range requires --follow
1138 [10]
1138 [10]
1139
1139
1140 Non-exact pattern kinds are not allowed.
1140 Non-exact pattern kinds are not allowed.
1141
1141
1142 $ cd ..
1142 $ cd ..
1143 $ hg log -f -L glob:*a*,1:2
1143 $ hg log -f -L glob:*a*,1:2
1144 hg: parse error: line range pattern 'glob:*a*' must match exactly one file
1144 hg: parse error: line range pattern 'glob:*a*' must match exactly one file
1145 [10]
1145 [10]
1146
1146
1147 We get an error for removed files.
1147 We get an error for removed files.
1148
1148
1149 $ hg rm dir/baz
1149 $ hg rm dir/baz
1150 $ hg ci -m 'remove baz' --quiet
1150 $ hg ci -m 'remove baz' --quiet
1151 $ hg log -f -L dir/baz,5:7 -p
1151 $ hg log -f -L dir/baz,5:7 -p
1152 abort: cannot follow file not in parent revision: "dir/baz"
1152 abort: cannot follow file not in parent revision: "dir/baz"
1153 [255]
1153 [255]
General Comments 0
You need to be logged in to leave comments. Login now