##// END OF EJS Templates
test: enforce bundle1 in "test-commit-interactive.t"...
Pierre-Yves David -
r26863:0879bf38 default
parent child Browse files
Show More
@@ -1,1635 +1,1635 b''
1 Set up a repo
1 Set up a repo
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [ui]
4 > [ui]
5 > interactive = true
5 > interactive = true
6 > [extensions]
6 > [extensions]
7 > record =
7 > record =
8 > EOF
8 > EOF
9
9
10 $ hg init a
10 $ hg init a
11 $ cd a
11 $ cd a
12
12
13 Select no files
13 Select no files
14
14
15 $ touch empty-rw
15 $ touch empty-rw
16 $ hg add empty-rw
16 $ hg add empty-rw
17
17
18 $ hg record --config ui.interactive=false
18 $ hg record --config ui.interactive=false
19 abort: running non-interactively, use commit instead
19 abort: running non-interactively, use commit instead
20 [255]
20 [255]
21 $ hg commit -i --config ui.interactive=false
21 $ hg commit -i --config ui.interactive=false
22 abort: running non-interactively
22 abort: running non-interactively
23 [255]
23 [255]
24 $ hg commit -i empty-rw<<EOF
24 $ hg commit -i empty-rw<<EOF
25 > n
25 > n
26 > EOF
26 > EOF
27 diff --git a/empty-rw b/empty-rw
27 diff --git a/empty-rw b/empty-rw
28 new file mode 100644
28 new file mode 100644
29 examine changes to 'empty-rw'? [Ynesfdaq?] n
29 examine changes to 'empty-rw'? [Ynesfdaq?] n
30
30
31 no changes to record
31 no changes to record
32
32
33 $ hg tip -p
33 $ hg tip -p
34 changeset: -1:000000000000
34 changeset: -1:000000000000
35 tag: tip
35 tag: tip
36 user:
36 user:
37 date: Thu Jan 01 00:00:00 1970 +0000
37 date: Thu Jan 01 00:00:00 1970 +0000
38
38
39
39
40
40
41 Select files but no hunks
41 Select files but no hunks
42
42
43 $ hg commit -i empty-rw<<EOF
43 $ hg commit -i empty-rw<<EOF
44 > y
44 > y
45 > n
45 > n
46 > EOF
46 > EOF
47 diff --git a/empty-rw b/empty-rw
47 diff --git a/empty-rw b/empty-rw
48 new file mode 100644
48 new file mode 100644
49 examine changes to 'empty-rw'? [Ynesfdaq?] y
49 examine changes to 'empty-rw'? [Ynesfdaq?] y
50
50
51 abort: empty commit message
51 abort: empty commit message
52 [255]
52 [255]
53
53
54 $ hg tip -p
54 $ hg tip -p
55 changeset: -1:000000000000
55 changeset: -1:000000000000
56 tag: tip
56 tag: tip
57 user:
57 user:
58 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
59
59
60
60
61
61
62 Record empty file
62 Record empty file
63
63
64 $ hg commit -i -d '0 0' -m empty empty-rw<<EOF
64 $ hg commit -i -d '0 0' -m empty empty-rw<<EOF
65 > y
65 > y
66 > y
66 > y
67 > EOF
67 > EOF
68 diff --git a/empty-rw b/empty-rw
68 diff --git a/empty-rw b/empty-rw
69 new file mode 100644
69 new file mode 100644
70 examine changes to 'empty-rw'? [Ynesfdaq?] y
70 examine changes to 'empty-rw'? [Ynesfdaq?] y
71
71
72
72
73 $ hg tip -p
73 $ hg tip -p
74 changeset: 0:c0708cf4e46e
74 changeset: 0:c0708cf4e46e
75 tag: tip
75 tag: tip
76 user: test
76 user: test
77 date: Thu Jan 01 00:00:00 1970 +0000
77 date: Thu Jan 01 00:00:00 1970 +0000
78 summary: empty
78 summary: empty
79
79
80
80
81
81
82 Summary shows we updated to the new cset
82 Summary shows we updated to the new cset
83
83
84 $ hg summary
84 $ hg summary
85 parent: 0:c0708cf4e46e tip
85 parent: 0:c0708cf4e46e tip
86 empty
86 empty
87 branch: default
87 branch: default
88 commit: (clean)
88 commit: (clean)
89 update: (current)
89 update: (current)
90 phases: 1 draft
90 phases: 1 draft
91
91
92 Rename empty file
92 Rename empty file
93
93
94 $ hg mv empty-rw empty-rename
94 $ hg mv empty-rw empty-rename
95 $ hg commit -i -d '1 0' -m rename<<EOF
95 $ hg commit -i -d '1 0' -m rename<<EOF
96 > y
96 > y
97 > EOF
97 > EOF
98 diff --git a/empty-rw b/empty-rename
98 diff --git a/empty-rw b/empty-rename
99 rename from empty-rw
99 rename from empty-rw
100 rename to empty-rename
100 rename to empty-rename
101 examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
101 examine changes to 'empty-rw' and 'empty-rename'? [Ynesfdaq?] y
102
102
103
103
104 $ hg tip -p
104 $ hg tip -p
105 changeset: 1:d695e8dcb197
105 changeset: 1:d695e8dcb197
106 tag: tip
106 tag: tip
107 user: test
107 user: test
108 date: Thu Jan 01 00:00:01 1970 +0000
108 date: Thu Jan 01 00:00:01 1970 +0000
109 summary: rename
109 summary: rename
110
110
111
111
112
112
113 Copy empty file
113 Copy empty file
114
114
115 $ hg cp empty-rename empty-copy
115 $ hg cp empty-rename empty-copy
116 $ hg commit -i -d '2 0' -m copy<<EOF
116 $ hg commit -i -d '2 0' -m copy<<EOF
117 > y
117 > y
118 > EOF
118 > EOF
119 diff --git a/empty-rename b/empty-copy
119 diff --git a/empty-rename b/empty-copy
120 copy from empty-rename
120 copy from empty-rename
121 copy to empty-copy
121 copy to empty-copy
122 examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
122 examine changes to 'empty-rename' and 'empty-copy'? [Ynesfdaq?] y
123
123
124
124
125 $ hg tip -p
125 $ hg tip -p
126 changeset: 2:1d4b90bea524
126 changeset: 2:1d4b90bea524
127 tag: tip
127 tag: tip
128 user: test
128 user: test
129 date: Thu Jan 01 00:00:02 1970 +0000
129 date: Thu Jan 01 00:00:02 1970 +0000
130 summary: copy
130 summary: copy
131
131
132
132
133
133
134 Delete empty file
134 Delete empty file
135
135
136 $ hg rm empty-copy
136 $ hg rm empty-copy
137 $ hg commit -i -d '3 0' -m delete<<EOF
137 $ hg commit -i -d '3 0' -m delete<<EOF
138 > y
138 > y
139 > EOF
139 > EOF
140 diff --git a/empty-copy b/empty-copy
140 diff --git a/empty-copy b/empty-copy
141 deleted file mode 100644
141 deleted file mode 100644
142 examine changes to 'empty-copy'? [Ynesfdaq?] y
142 examine changes to 'empty-copy'? [Ynesfdaq?] y
143
143
144
144
145 $ hg tip -p
145 $ hg tip -p
146 changeset: 3:b39a238f01a1
146 changeset: 3:b39a238f01a1
147 tag: tip
147 tag: tip
148 user: test
148 user: test
149 date: Thu Jan 01 00:00:03 1970 +0000
149 date: Thu Jan 01 00:00:03 1970 +0000
150 summary: delete
150 summary: delete
151
151
152
152
153
153
154 Add binary file
154 Add binary file
155
155
156 $ hg bundle --base -2 tip.bundle
156 $ hg bundle --type v1 --base -2 tip.bundle
157 1 changesets found
157 1 changesets found
158 $ hg add tip.bundle
158 $ hg add tip.bundle
159 $ hg commit -i -d '4 0' -m binary<<EOF
159 $ hg commit -i -d '4 0' -m binary<<EOF
160 > y
160 > y
161 > EOF
161 > EOF
162 diff --git a/tip.bundle b/tip.bundle
162 diff --git a/tip.bundle b/tip.bundle
163 new file mode 100644
163 new file mode 100644
164 this is a binary file
164 this is a binary file
165 examine changes to 'tip.bundle'? [Ynesfdaq?] y
165 examine changes to 'tip.bundle'? [Ynesfdaq?] y
166
166
167
167
168 $ hg tip -p
168 $ hg tip -p
169 changeset: 4:ad816da3711e
169 changeset: 4:ad816da3711e
170 tag: tip
170 tag: tip
171 user: test
171 user: test
172 date: Thu Jan 01 00:00:04 1970 +0000
172 date: Thu Jan 01 00:00:04 1970 +0000
173 summary: binary
173 summary: binary
174
174
175 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
175 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
176 Binary file tip.bundle has changed
176 Binary file tip.bundle has changed
177
177
178
178
179 Change binary file
179 Change binary file
180
180
181 $ hg bundle --base -2 tip.bundle
181 $ hg bundle --base -2 --type v1 tip.bundle
182 1 changesets found
182 1 changesets found
183 $ hg commit -i -d '5 0' -m binary-change<<EOF
183 $ hg commit -i -d '5 0' -m binary-change<<EOF
184 > y
184 > y
185 > EOF
185 > EOF
186 diff --git a/tip.bundle b/tip.bundle
186 diff --git a/tip.bundle b/tip.bundle
187 this modifies a binary file (all or nothing)
187 this modifies a binary file (all or nothing)
188 examine changes to 'tip.bundle'? [Ynesfdaq?] y
188 examine changes to 'tip.bundle'? [Ynesfdaq?] y
189
189
190
190
191 $ hg tip -p
191 $ hg tip -p
192 changeset: 5:dccd6f3eb485
192 changeset: 5:dccd6f3eb485
193 tag: tip
193 tag: tip
194 user: test
194 user: test
195 date: Thu Jan 01 00:00:05 1970 +0000
195 date: Thu Jan 01 00:00:05 1970 +0000
196 summary: binary-change
196 summary: binary-change
197
197
198 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
198 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
199 Binary file tip.bundle has changed
199 Binary file tip.bundle has changed
200
200
201
201
202 Rename and change binary file
202 Rename and change binary file
203
203
204 $ hg mv tip.bundle top.bundle
204 $ hg mv tip.bundle top.bundle
205 $ hg bundle --base -2 top.bundle
205 $ hg bundle --base -2 --type v1 top.bundle
206 1 changesets found
206 1 changesets found
207 $ hg commit -i -d '6 0' -m binary-change-rename<<EOF
207 $ hg commit -i -d '6 0' -m binary-change-rename<<EOF
208 > y
208 > y
209 > EOF
209 > EOF
210 diff --git a/tip.bundle b/top.bundle
210 diff --git a/tip.bundle b/top.bundle
211 rename from tip.bundle
211 rename from tip.bundle
212 rename to top.bundle
212 rename to top.bundle
213 this modifies a binary file (all or nothing)
213 this modifies a binary file (all or nothing)
214 examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
214 examine changes to 'tip.bundle' and 'top.bundle'? [Ynesfdaq?] y
215
215
216
216
217 $ hg tip -p
217 $ hg tip -p
218 changeset: 6:7fa44105f5b3
218 changeset: 6:7fa44105f5b3
219 tag: tip
219 tag: tip
220 user: test
220 user: test
221 date: Thu Jan 01 00:00:06 1970 +0000
221 date: Thu Jan 01 00:00:06 1970 +0000
222 summary: binary-change-rename
222 summary: binary-change-rename
223
223
224 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
224 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
225 Binary file tip.bundle has changed
225 Binary file tip.bundle has changed
226 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
226 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
227 Binary file top.bundle has changed
227 Binary file top.bundle has changed
228
228
229
229
230 Add plain file
230 Add plain file
231
231
232 $ for i in 1 2 3 4 5 6 7 8 9 10; do
232 $ for i in 1 2 3 4 5 6 7 8 9 10; do
233 > echo $i >> plain
233 > echo $i >> plain
234 > done
234 > done
235
235
236 $ hg add plain
236 $ hg add plain
237 $ hg commit -i -d '7 0' -m plain plain<<EOF
237 $ hg commit -i -d '7 0' -m plain plain<<EOF
238 > y
238 > y
239 > y
239 > y
240 > EOF
240 > EOF
241 diff --git a/plain b/plain
241 diff --git a/plain b/plain
242 new file mode 100644
242 new file mode 100644
243 examine changes to 'plain'? [Ynesfdaq?] y
243 examine changes to 'plain'? [Ynesfdaq?] y
244
244
245 @@ -0,0 +1,10 @@
245 @@ -0,0 +1,10 @@
246 +1
246 +1
247 +2
247 +2
248 +3
248 +3
249 +4
249 +4
250 +5
250 +5
251 +6
251 +6
252 +7
252 +7
253 +8
253 +8
254 +9
254 +9
255 +10
255 +10
256 record this change to 'plain'? [Ynesfdaq?] y
256 record this change to 'plain'? [Ynesfdaq?] y
257
257
258 $ hg tip -p
258 $ hg tip -p
259 changeset: 7:11fb457c1be4
259 changeset: 7:11fb457c1be4
260 tag: tip
260 tag: tip
261 user: test
261 user: test
262 date: Thu Jan 01 00:00:07 1970 +0000
262 date: Thu Jan 01 00:00:07 1970 +0000
263 summary: plain
263 summary: plain
264
264
265 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
265 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
266 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
266 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
267 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
267 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
268 @@ -0,0 +1,10 @@
268 @@ -0,0 +1,10 @@
269 +1
269 +1
270 +2
270 +2
271 +3
271 +3
272 +4
272 +4
273 +5
273 +5
274 +6
274 +6
275 +7
275 +7
276 +8
276 +8
277 +9
277 +9
278 +10
278 +10
279
279
280 Modify end of plain file with username unset
280 Modify end of plain file with username unset
281
281
282 $ echo 11 >> plain
282 $ echo 11 >> plain
283 $ unset HGUSER
283 $ unset HGUSER
284 $ hg commit -i --config ui.username= -d '8 0' -m end plain
284 $ hg commit -i --config ui.username= -d '8 0' -m end plain
285 abort: no username supplied
285 abort: no username supplied
286 (use "hg config --edit" to set your username)
286 (use "hg config --edit" to set your username)
287 [255]
287 [255]
288
288
289
289
290 Modify end of plain file, also test that diffopts are accounted for
290 Modify end of plain file, also test that diffopts are accounted for
291
291
292 $ HGUSER="test"
292 $ HGUSER="test"
293 $ export HGUSER
293 $ export HGUSER
294 $ hg commit -i --config diff.showfunc=true -d '8 0' -m end plain <<EOF
294 $ hg commit -i --config diff.showfunc=true -d '8 0' -m end plain <<EOF
295 > y
295 > y
296 > y
296 > y
297 > EOF
297 > EOF
298 diff --git a/plain b/plain
298 diff --git a/plain b/plain
299 1 hunks, 1 lines changed
299 1 hunks, 1 lines changed
300 examine changes to 'plain'? [Ynesfdaq?] y
300 examine changes to 'plain'? [Ynesfdaq?] y
301
301
302 @@ -8,3 +8,4 @@ 7
302 @@ -8,3 +8,4 @@ 7
303 8
303 8
304 9
304 9
305 10
305 10
306 +11
306 +11
307 record this change to 'plain'? [Ynesfdaq?] y
307 record this change to 'plain'? [Ynesfdaq?] y
308
308
309
309
310 Modify end of plain file, no EOL
310 Modify end of plain file, no EOL
311
311
312 $ hg tip --template '{node}' >> plain
312 $ hg tip --template '{node}' >> plain
313 $ hg commit -i -d '9 0' -m noeol plain <<EOF
313 $ hg commit -i -d '9 0' -m noeol plain <<EOF
314 > y
314 > y
315 > y
315 > y
316 > EOF
316 > EOF
317 diff --git a/plain b/plain
317 diff --git a/plain b/plain
318 1 hunks, 1 lines changed
318 1 hunks, 1 lines changed
319 examine changes to 'plain'? [Ynesfdaq?] y
319 examine changes to 'plain'? [Ynesfdaq?] y
320
320
321 @@ -9,3 +9,4 @@
321 @@ -9,3 +9,4 @@
322 9
322 9
323 10
323 10
324 11
324 11
325 +7264f99c5f5ff3261504828afa4fb4d406c3af54
325 +7264f99c5f5ff3261504828afa4fb4d406c3af54
326 \ No newline at end of file
326 \ No newline at end of file
327 record this change to 'plain'? [Ynesfdaq?] y
327 record this change to 'plain'? [Ynesfdaq?] y
328
328
329
329
330 Modify end of plain file, add EOL
330 Modify end of plain file, add EOL
331
331
332 $ echo >> plain
332 $ echo >> plain
333 $ echo 1 > plain2
333 $ echo 1 > plain2
334 $ hg add plain2
334 $ hg add plain2
335 $ hg commit -i -d '10 0' -m eol plain plain2 <<EOF
335 $ hg commit -i -d '10 0' -m eol plain plain2 <<EOF
336 > y
336 > y
337 > y
337 > y
338 > y
338 > y
339 > y
339 > y
340 > EOF
340 > EOF
341 diff --git a/plain b/plain
341 diff --git a/plain b/plain
342 1 hunks, 1 lines changed
342 1 hunks, 1 lines changed
343 examine changes to 'plain'? [Ynesfdaq?] y
343 examine changes to 'plain'? [Ynesfdaq?] y
344
344
345 @@ -9,4 +9,4 @@
345 @@ -9,4 +9,4 @@
346 9
346 9
347 10
347 10
348 11
348 11
349 -7264f99c5f5ff3261504828afa4fb4d406c3af54
349 -7264f99c5f5ff3261504828afa4fb4d406c3af54
350 \ No newline at end of file
350 \ No newline at end of file
351 +7264f99c5f5ff3261504828afa4fb4d406c3af54
351 +7264f99c5f5ff3261504828afa4fb4d406c3af54
352 record change 1/2 to 'plain'? [Ynesfdaq?] y
352 record change 1/2 to 'plain'? [Ynesfdaq?] y
353
353
354 diff --git a/plain2 b/plain2
354 diff --git a/plain2 b/plain2
355 new file mode 100644
355 new file mode 100644
356 examine changes to 'plain2'? [Ynesfdaq?] y
356 examine changes to 'plain2'? [Ynesfdaq?] y
357
357
358 @@ -0,0 +1,1 @@
358 @@ -0,0 +1,1 @@
359 +1
359 +1
360 record change 2/2 to 'plain2'? [Ynesfdaq?] y
360 record change 2/2 to 'plain2'? [Ynesfdaq?] y
361
361
362 Modify beginning, trim end, record both, add another file to test
362 Modify beginning, trim end, record both, add another file to test
363 changes numbering
363 changes numbering
364
364
365 $ rm plain
365 $ rm plain
366 $ for i in 2 2 3 4 5 6 7 8 9 10; do
366 $ for i in 2 2 3 4 5 6 7 8 9 10; do
367 > echo $i >> plain
367 > echo $i >> plain
368 > done
368 > done
369 $ echo 2 >> plain2
369 $ echo 2 >> plain2
370
370
371 $ hg commit -i -d '10 0' -m begin-and-end plain plain2 <<EOF
371 $ hg commit -i -d '10 0' -m begin-and-end plain plain2 <<EOF
372 > y
372 > y
373 > y
373 > y
374 > y
374 > y
375 > y
375 > y
376 > y
376 > y
377 > EOF
377 > EOF
378 diff --git a/plain b/plain
378 diff --git a/plain b/plain
379 2 hunks, 3 lines changed
379 2 hunks, 3 lines changed
380 examine changes to 'plain'? [Ynesfdaq?] y
380 examine changes to 'plain'? [Ynesfdaq?] y
381
381
382 @@ -1,4 +1,4 @@
382 @@ -1,4 +1,4 @@
383 -1
383 -1
384 +2
384 +2
385 2
385 2
386 3
386 3
387 4
387 4
388 record change 1/3 to 'plain'? [Ynesfdaq?] y
388 record change 1/3 to 'plain'? [Ynesfdaq?] y
389
389
390 @@ -8,5 +8,3 @@
390 @@ -8,5 +8,3 @@
391 8
391 8
392 9
392 9
393 10
393 10
394 -11
394 -11
395 -7264f99c5f5ff3261504828afa4fb4d406c3af54
395 -7264f99c5f5ff3261504828afa4fb4d406c3af54
396 record change 2/3 to 'plain'? [Ynesfdaq?] y
396 record change 2/3 to 'plain'? [Ynesfdaq?] y
397
397
398 diff --git a/plain2 b/plain2
398 diff --git a/plain2 b/plain2
399 1 hunks, 1 lines changed
399 1 hunks, 1 lines changed
400 examine changes to 'plain2'? [Ynesfdaq?] y
400 examine changes to 'plain2'? [Ynesfdaq?] y
401
401
402 @@ -1,1 +1,2 @@
402 @@ -1,1 +1,2 @@
403 1
403 1
404 +2
404 +2
405 record change 3/3 to 'plain2'? [Ynesfdaq?] y
405 record change 3/3 to 'plain2'? [Ynesfdaq?] y
406
406
407
407
408 $ hg tip -p
408 $ hg tip -p
409 changeset: 11:21df83db12b8
409 changeset: 11:21df83db12b8
410 tag: tip
410 tag: tip
411 user: test
411 user: test
412 date: Thu Jan 01 00:00:10 1970 +0000
412 date: Thu Jan 01 00:00:10 1970 +0000
413 summary: begin-and-end
413 summary: begin-and-end
414
414
415 diff -r ddb8b281c3ff -r 21df83db12b8 plain
415 diff -r ddb8b281c3ff -r 21df83db12b8 plain
416 --- a/plain Thu Jan 01 00:00:10 1970 +0000
416 --- a/plain Thu Jan 01 00:00:10 1970 +0000
417 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
417 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
418 @@ -1,4 +1,4 @@
418 @@ -1,4 +1,4 @@
419 -1
419 -1
420 +2
420 +2
421 2
421 2
422 3
422 3
423 4
423 4
424 @@ -8,5 +8,3 @@
424 @@ -8,5 +8,3 @@
425 8
425 8
426 9
426 9
427 10
427 10
428 -11
428 -11
429 -7264f99c5f5ff3261504828afa4fb4d406c3af54
429 -7264f99c5f5ff3261504828afa4fb4d406c3af54
430 diff -r ddb8b281c3ff -r 21df83db12b8 plain2
430 diff -r ddb8b281c3ff -r 21df83db12b8 plain2
431 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
431 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
432 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
432 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
433 @@ -1,1 +1,2 @@
433 @@ -1,1 +1,2 @@
434 1
434 1
435 +2
435 +2
436
436
437
437
438 Trim beginning, modify end
438 Trim beginning, modify end
439
439
440 $ rm plain
440 $ rm plain
441 > for i in 4 5 6 7 8 9 10.new; do
441 > for i in 4 5 6 7 8 9 10.new; do
442 > echo $i >> plain
442 > echo $i >> plain
443 > done
443 > done
444
444
445 Record end
445 Record end
446
446
447 $ hg commit -i -d '11 0' -m end-only plain <<EOF
447 $ hg commit -i -d '11 0' -m end-only plain <<EOF
448 > y
448 > y
449 > n
449 > n
450 > y
450 > y
451 > EOF
451 > EOF
452 diff --git a/plain b/plain
452 diff --git a/plain b/plain
453 2 hunks, 4 lines changed
453 2 hunks, 4 lines changed
454 examine changes to 'plain'? [Ynesfdaq?] y
454 examine changes to 'plain'? [Ynesfdaq?] y
455
455
456 @@ -1,9 +1,6 @@
456 @@ -1,9 +1,6 @@
457 -2
457 -2
458 -2
458 -2
459 -3
459 -3
460 4
460 4
461 5
461 5
462 6
462 6
463 7
463 7
464 8
464 8
465 9
465 9
466 record change 1/2 to 'plain'? [Ynesfdaq?] n
466 record change 1/2 to 'plain'? [Ynesfdaq?] n
467
467
468 @@ -4,7 +1,7 @@
468 @@ -4,7 +1,7 @@
469 4
469 4
470 5
470 5
471 6
471 6
472 7
472 7
473 8
473 8
474 9
474 9
475 -10
475 -10
476 +10.new
476 +10.new
477 record change 2/2 to 'plain'? [Ynesfdaq?] y
477 record change 2/2 to 'plain'? [Ynesfdaq?] y
478
478
479
479
480 $ hg tip -p
480 $ hg tip -p
481 changeset: 12:99337501826f
481 changeset: 12:99337501826f
482 tag: tip
482 tag: tip
483 user: test
483 user: test
484 date: Thu Jan 01 00:00:11 1970 +0000
484 date: Thu Jan 01 00:00:11 1970 +0000
485 summary: end-only
485 summary: end-only
486
486
487 diff -r 21df83db12b8 -r 99337501826f plain
487 diff -r 21df83db12b8 -r 99337501826f plain
488 --- a/plain Thu Jan 01 00:00:10 1970 +0000
488 --- a/plain Thu Jan 01 00:00:10 1970 +0000
489 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
489 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
490 @@ -7,4 +7,4 @@
490 @@ -7,4 +7,4 @@
491 7
491 7
492 8
492 8
493 9
493 9
494 -10
494 -10
495 +10.new
495 +10.new
496
496
497
497
498 Record beginning
498 Record beginning
499
499
500 $ hg commit -i -d '12 0' -m begin-only plain <<EOF
500 $ hg commit -i -d '12 0' -m begin-only plain <<EOF
501 > y
501 > y
502 > y
502 > y
503 > EOF
503 > EOF
504 diff --git a/plain b/plain
504 diff --git a/plain b/plain
505 1 hunks, 3 lines changed
505 1 hunks, 3 lines changed
506 examine changes to 'plain'? [Ynesfdaq?] y
506 examine changes to 'plain'? [Ynesfdaq?] y
507
507
508 @@ -1,6 +1,3 @@
508 @@ -1,6 +1,3 @@
509 -2
509 -2
510 -2
510 -2
511 -3
511 -3
512 4
512 4
513 5
513 5
514 6
514 6
515 record this change to 'plain'? [Ynesfdaq?] y
515 record this change to 'plain'? [Ynesfdaq?] y
516
516
517
517
518 $ hg tip -p
518 $ hg tip -p
519 changeset: 13:bbd45465d540
519 changeset: 13:bbd45465d540
520 tag: tip
520 tag: tip
521 user: test
521 user: test
522 date: Thu Jan 01 00:00:12 1970 +0000
522 date: Thu Jan 01 00:00:12 1970 +0000
523 summary: begin-only
523 summary: begin-only
524
524
525 diff -r 99337501826f -r bbd45465d540 plain
525 diff -r 99337501826f -r bbd45465d540 plain
526 --- a/plain Thu Jan 01 00:00:11 1970 +0000
526 --- a/plain Thu Jan 01 00:00:11 1970 +0000
527 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
527 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
528 @@ -1,6 +1,3 @@
528 @@ -1,6 +1,3 @@
529 -2
529 -2
530 -2
530 -2
531 -3
531 -3
532 4
532 4
533 5
533 5
534 6
534 6
535
535
536
536
537 Add to beginning, trim from end
537 Add to beginning, trim from end
538
538
539 $ rm plain
539 $ rm plain
540 $ for i in 1 2 3 4 5 6 7 8 9; do
540 $ for i in 1 2 3 4 5 6 7 8 9; do
541 > echo $i >> plain
541 > echo $i >> plain
542 > done
542 > done
543
543
544 Record end
544 Record end
545
545
546 $ hg commit -i --traceback -d '13 0' -m end-again plain<<EOF
546 $ hg commit -i --traceback -d '13 0' -m end-again plain<<EOF
547 > y
547 > y
548 > n
548 > n
549 > y
549 > y
550 > EOF
550 > EOF
551 diff --git a/plain b/plain
551 diff --git a/plain b/plain
552 2 hunks, 4 lines changed
552 2 hunks, 4 lines changed
553 examine changes to 'plain'? [Ynesfdaq?] y
553 examine changes to 'plain'? [Ynesfdaq?] y
554
554
555 @@ -1,6 +1,9 @@
555 @@ -1,6 +1,9 @@
556 +1
556 +1
557 +2
557 +2
558 +3
558 +3
559 4
559 4
560 5
560 5
561 6
561 6
562 7
562 7
563 8
563 8
564 9
564 9
565 record change 1/2 to 'plain'? [Ynesfdaq?] n
565 record change 1/2 to 'plain'? [Ynesfdaq?] n
566
566
567 @@ -1,7 +4,6 @@
567 @@ -1,7 +4,6 @@
568 4
568 4
569 5
569 5
570 6
570 6
571 7
571 7
572 8
572 8
573 9
573 9
574 -10.new
574 -10.new
575 record change 2/2 to 'plain'? [Ynesfdaq?] y
575 record change 2/2 to 'plain'? [Ynesfdaq?] y
576
576
577
577
578 Add to beginning, middle, end
578 Add to beginning, middle, end
579
579
580 $ rm plain
580 $ rm plain
581 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
581 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
582 > echo $i >> plain
582 > echo $i >> plain
583 > done
583 > done
584
584
585 Record beginning, middle, and test that format-breaking diffopts are ignored
585 Record beginning, middle, and test that format-breaking diffopts are ignored
586
586
587 $ hg commit -i --config diff.noprefix=True -d '14 0' -m middle-only plain <<EOF
587 $ hg commit -i --config diff.noprefix=True -d '14 0' -m middle-only plain <<EOF
588 > y
588 > y
589 > y
589 > y
590 > y
590 > y
591 > n
591 > n
592 > EOF
592 > EOF
593 diff --git a/plain b/plain
593 diff --git a/plain b/plain
594 3 hunks, 7 lines changed
594 3 hunks, 7 lines changed
595 examine changes to 'plain'? [Ynesfdaq?] y
595 examine changes to 'plain'? [Ynesfdaq?] y
596
596
597 @@ -1,2 +1,5 @@
597 @@ -1,2 +1,5 @@
598 +1
598 +1
599 +2
599 +2
600 +3
600 +3
601 4
601 4
602 5
602 5
603 record change 1/3 to 'plain'? [Ynesfdaq?] y
603 record change 1/3 to 'plain'? [Ynesfdaq?] y
604
604
605 @@ -1,6 +4,8 @@
605 @@ -1,6 +4,8 @@
606 4
606 4
607 5
607 5
608 +5.new
608 +5.new
609 +5.reallynew
609 +5.reallynew
610 6
610 6
611 7
611 7
612 8
612 8
613 9
613 9
614 record change 2/3 to 'plain'? [Ynesfdaq?] y
614 record change 2/3 to 'plain'? [Ynesfdaq?] y
615
615
616 @@ -3,4 +8,6 @@
616 @@ -3,4 +8,6 @@
617 6
617 6
618 7
618 7
619 8
619 8
620 9
620 9
621 +10
621 +10
622 +11
622 +11
623 record change 3/3 to 'plain'? [Ynesfdaq?] n
623 record change 3/3 to 'plain'? [Ynesfdaq?] n
624
624
625
625
626 $ hg tip -p
626 $ hg tip -p
627 changeset: 15:f34a7937ec33
627 changeset: 15:f34a7937ec33
628 tag: tip
628 tag: tip
629 user: test
629 user: test
630 date: Thu Jan 01 00:00:14 1970 +0000
630 date: Thu Jan 01 00:00:14 1970 +0000
631 summary: middle-only
631 summary: middle-only
632
632
633 diff -r 82c065d0b850 -r f34a7937ec33 plain
633 diff -r 82c065d0b850 -r f34a7937ec33 plain
634 --- a/plain Thu Jan 01 00:00:13 1970 +0000
634 --- a/plain Thu Jan 01 00:00:13 1970 +0000
635 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
635 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
636 @@ -1,5 +1,10 @@
636 @@ -1,5 +1,10 @@
637 +1
637 +1
638 +2
638 +2
639 +3
639 +3
640 4
640 4
641 5
641 5
642 +5.new
642 +5.new
643 +5.reallynew
643 +5.reallynew
644 6
644 6
645 7
645 7
646 8
646 8
647
647
648
648
649 Record end
649 Record end
650
650
651 $ hg commit -i -d '15 0' -m end-only plain <<EOF
651 $ hg commit -i -d '15 0' -m end-only plain <<EOF
652 > y
652 > y
653 > y
653 > y
654 > EOF
654 > EOF
655 diff --git a/plain b/plain
655 diff --git a/plain b/plain
656 1 hunks, 2 lines changed
656 1 hunks, 2 lines changed
657 examine changes to 'plain'? [Ynesfdaq?] y
657 examine changes to 'plain'? [Ynesfdaq?] y
658
658
659 @@ -9,3 +9,5 @@
659 @@ -9,3 +9,5 @@
660 7
660 7
661 8
661 8
662 9
662 9
663 +10
663 +10
664 +11
664 +11
665 record this change to 'plain'? [Ynesfdaq?] y
665 record this change to 'plain'? [Ynesfdaq?] y
666
666
667
667
668 $ hg tip -p
668 $ hg tip -p
669 changeset: 16:f9900b71a04c
669 changeset: 16:f9900b71a04c
670 tag: tip
670 tag: tip
671 user: test
671 user: test
672 date: Thu Jan 01 00:00:15 1970 +0000
672 date: Thu Jan 01 00:00:15 1970 +0000
673 summary: end-only
673 summary: end-only
674
674
675 diff -r f34a7937ec33 -r f9900b71a04c plain
675 diff -r f34a7937ec33 -r f9900b71a04c plain
676 --- a/plain Thu Jan 01 00:00:14 1970 +0000
676 --- a/plain Thu Jan 01 00:00:14 1970 +0000
677 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
677 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
678 @@ -9,3 +9,5 @@
678 @@ -9,3 +9,5 @@
679 7
679 7
680 8
680 8
681 9
681 9
682 +10
682 +10
683 +11
683 +11
684
684
685
685
686 $ mkdir subdir
686 $ mkdir subdir
687 $ cd subdir
687 $ cd subdir
688 $ echo a > a
688 $ echo a > a
689 $ hg ci -d '16 0' -Amsubdir
689 $ hg ci -d '16 0' -Amsubdir
690 adding subdir/a
690 adding subdir/a
691
691
692 $ echo a >> a
692 $ echo a >> a
693 $ hg commit -i -d '16 0' -m subdir-change a <<EOF
693 $ hg commit -i -d '16 0' -m subdir-change a <<EOF
694 > y
694 > y
695 > y
695 > y
696 > EOF
696 > EOF
697 diff --git a/subdir/a b/subdir/a
697 diff --git a/subdir/a b/subdir/a
698 1 hunks, 1 lines changed
698 1 hunks, 1 lines changed
699 examine changes to 'subdir/a'? [Ynesfdaq?] y
699 examine changes to 'subdir/a'? [Ynesfdaq?] y
700
700
701 @@ -1,1 +1,2 @@
701 @@ -1,1 +1,2 @@
702 a
702 a
703 +a
703 +a
704 record this change to 'subdir/a'? [Ynesfdaq?] y
704 record this change to 'subdir/a'? [Ynesfdaq?] y
705
705
706
706
707 $ hg tip -p
707 $ hg tip -p
708 changeset: 18:61be427a9deb
708 changeset: 18:61be427a9deb
709 tag: tip
709 tag: tip
710 user: test
710 user: test
711 date: Thu Jan 01 00:00:16 1970 +0000
711 date: Thu Jan 01 00:00:16 1970 +0000
712 summary: subdir-change
712 summary: subdir-change
713
713
714 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
714 diff -r a7ffae4d61cb -r 61be427a9deb subdir/a
715 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
715 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
716 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
716 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
717 @@ -1,1 +1,2 @@
717 @@ -1,1 +1,2 @@
718 a
718 a
719 +a
719 +a
720
720
721
721
722 $ echo a > f1
722 $ echo a > f1
723 $ echo b > f2
723 $ echo b > f2
724 $ hg add f1 f2
724 $ hg add f1 f2
725
725
726 $ hg ci -mz -d '17 0'
726 $ hg ci -mz -d '17 0'
727
727
728 $ echo a >> f1
728 $ echo a >> f1
729 $ echo b >> f2
729 $ echo b >> f2
730
730
731 Help, quit
731 Help, quit
732
732
733 $ hg commit -i <<EOF
733 $ hg commit -i <<EOF
734 > ?
734 > ?
735 > q
735 > q
736 > EOF
736 > EOF
737 diff --git a/subdir/f1 b/subdir/f1
737 diff --git a/subdir/f1 b/subdir/f1
738 1 hunks, 1 lines changed
738 1 hunks, 1 lines changed
739 examine changes to 'subdir/f1'? [Ynesfdaq?] ?
739 examine changes to 'subdir/f1'? [Ynesfdaq?] ?
740
740
741 y - yes, record this change
741 y - yes, record this change
742 n - no, skip this change
742 n - no, skip this change
743 e - edit this change manually
743 e - edit this change manually
744 s - skip remaining changes to this file
744 s - skip remaining changes to this file
745 f - record remaining changes to this file
745 f - record remaining changes to this file
746 d - done, skip remaining changes and files
746 d - done, skip remaining changes and files
747 a - record all changes to all remaining files
747 a - record all changes to all remaining files
748 q - quit, recording no changes
748 q - quit, recording no changes
749 ? - ? (display help)
749 ? - ? (display help)
750 examine changes to 'subdir/f1'? [Ynesfdaq?] q
750 examine changes to 'subdir/f1'? [Ynesfdaq?] q
751
751
752 abort: user quit
752 abort: user quit
753 [255]
753 [255]
754
754
755 Skip
755 Skip
756
756
757 $ hg commit -i <<EOF
757 $ hg commit -i <<EOF
758 > s
758 > s
759 > EOF
759 > EOF
760 diff --git a/subdir/f1 b/subdir/f1
760 diff --git a/subdir/f1 b/subdir/f1
761 1 hunks, 1 lines changed
761 1 hunks, 1 lines changed
762 examine changes to 'subdir/f1'? [Ynesfdaq?] s
762 examine changes to 'subdir/f1'? [Ynesfdaq?] s
763
763
764 diff --git a/subdir/f2 b/subdir/f2
764 diff --git a/subdir/f2 b/subdir/f2
765 1 hunks, 1 lines changed
765 1 hunks, 1 lines changed
766 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
766 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
767 [255]
767 [255]
768
768
769 No
769 No
770
770
771 $ hg commit -i <<EOF
771 $ hg commit -i <<EOF
772 > n
772 > n
773 > EOF
773 > EOF
774 diff --git a/subdir/f1 b/subdir/f1
774 diff --git a/subdir/f1 b/subdir/f1
775 1 hunks, 1 lines changed
775 1 hunks, 1 lines changed
776 examine changes to 'subdir/f1'? [Ynesfdaq?] n
776 examine changes to 'subdir/f1'? [Ynesfdaq?] n
777
777
778 diff --git a/subdir/f2 b/subdir/f2
778 diff --git a/subdir/f2 b/subdir/f2
779 1 hunks, 1 lines changed
779 1 hunks, 1 lines changed
780 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
780 examine changes to 'subdir/f2'? [Ynesfdaq?] abort: response expected
781 [255]
781 [255]
782
782
783 f, quit
783 f, quit
784
784
785 $ hg commit -i <<EOF
785 $ hg commit -i <<EOF
786 > f
786 > f
787 > q
787 > q
788 > EOF
788 > EOF
789 diff --git a/subdir/f1 b/subdir/f1
789 diff --git a/subdir/f1 b/subdir/f1
790 1 hunks, 1 lines changed
790 1 hunks, 1 lines changed
791 examine changes to 'subdir/f1'? [Ynesfdaq?] f
791 examine changes to 'subdir/f1'? [Ynesfdaq?] f
792
792
793 diff --git a/subdir/f2 b/subdir/f2
793 diff --git a/subdir/f2 b/subdir/f2
794 1 hunks, 1 lines changed
794 1 hunks, 1 lines changed
795 examine changes to 'subdir/f2'? [Ynesfdaq?] q
795 examine changes to 'subdir/f2'? [Ynesfdaq?] q
796
796
797 abort: user quit
797 abort: user quit
798 [255]
798 [255]
799
799
800 s, all
800 s, all
801
801
802 $ hg commit -i -d '18 0' -mx <<EOF
802 $ hg commit -i -d '18 0' -mx <<EOF
803 > s
803 > s
804 > a
804 > a
805 > EOF
805 > EOF
806 diff --git a/subdir/f1 b/subdir/f1
806 diff --git a/subdir/f1 b/subdir/f1
807 1 hunks, 1 lines changed
807 1 hunks, 1 lines changed
808 examine changes to 'subdir/f1'? [Ynesfdaq?] s
808 examine changes to 'subdir/f1'? [Ynesfdaq?] s
809
809
810 diff --git a/subdir/f2 b/subdir/f2
810 diff --git a/subdir/f2 b/subdir/f2
811 1 hunks, 1 lines changed
811 1 hunks, 1 lines changed
812 examine changes to 'subdir/f2'? [Ynesfdaq?] a
812 examine changes to 'subdir/f2'? [Ynesfdaq?] a
813
813
814
814
815 $ hg tip -p
815 $ hg tip -p
816 changeset: 20:b3df3dda369a
816 changeset: 20:b3df3dda369a
817 tag: tip
817 tag: tip
818 user: test
818 user: test
819 date: Thu Jan 01 00:00:18 1970 +0000
819 date: Thu Jan 01 00:00:18 1970 +0000
820 summary: x
820 summary: x
821
821
822 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
822 diff -r 6e02d6c9906d -r b3df3dda369a subdir/f2
823 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
823 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
824 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
824 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
825 @@ -1,1 +1,2 @@
825 @@ -1,1 +1,2 @@
826 b
826 b
827 +b
827 +b
828
828
829
829
830 f
830 f
831
831
832 $ hg commit -i -d '19 0' -my <<EOF
832 $ hg commit -i -d '19 0' -my <<EOF
833 > f
833 > f
834 > EOF
834 > EOF
835 diff --git a/subdir/f1 b/subdir/f1
835 diff --git a/subdir/f1 b/subdir/f1
836 1 hunks, 1 lines changed
836 1 hunks, 1 lines changed
837 examine changes to 'subdir/f1'? [Ynesfdaq?] f
837 examine changes to 'subdir/f1'? [Ynesfdaq?] f
838
838
839
839
840 $ hg tip -p
840 $ hg tip -p
841 changeset: 21:38ec577f126b
841 changeset: 21:38ec577f126b
842 tag: tip
842 tag: tip
843 user: test
843 user: test
844 date: Thu Jan 01 00:00:19 1970 +0000
844 date: Thu Jan 01 00:00:19 1970 +0000
845 summary: y
845 summary: y
846
846
847 diff -r b3df3dda369a -r 38ec577f126b subdir/f1
847 diff -r b3df3dda369a -r 38ec577f126b subdir/f1
848 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
848 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
849 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
849 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
850 @@ -1,1 +1,2 @@
850 @@ -1,1 +1,2 @@
851 a
851 a
852 +a
852 +a
853
853
854
854
855 #if execbit
855 #if execbit
856
856
857 Preserve chmod +x
857 Preserve chmod +x
858
858
859 $ chmod +x f1
859 $ chmod +x f1
860 $ echo a >> f1
860 $ echo a >> f1
861 $ hg commit -i -d '20 0' -mz <<EOF
861 $ hg commit -i -d '20 0' -mz <<EOF
862 > y
862 > y
863 > y
863 > y
864 > y
864 > y
865 > EOF
865 > EOF
866 diff --git a/subdir/f1 b/subdir/f1
866 diff --git a/subdir/f1 b/subdir/f1
867 old mode 100644
867 old mode 100644
868 new mode 100755
868 new mode 100755
869 1 hunks, 1 lines changed
869 1 hunks, 1 lines changed
870 examine changes to 'subdir/f1'? [Ynesfdaq?] y
870 examine changes to 'subdir/f1'? [Ynesfdaq?] y
871
871
872 @@ -1,2 +1,3 @@
872 @@ -1,2 +1,3 @@
873 a
873 a
874 a
874 a
875 +a
875 +a
876 record this change to 'subdir/f1'? [Ynesfdaq?] y
876 record this change to 'subdir/f1'? [Ynesfdaq?] y
877
877
878
878
879 $ hg tip --config diff.git=True -p
879 $ hg tip --config diff.git=True -p
880 changeset: 22:3261adceb075
880 changeset: 22:3261adceb075
881 tag: tip
881 tag: tip
882 user: test
882 user: test
883 date: Thu Jan 01 00:00:20 1970 +0000
883 date: Thu Jan 01 00:00:20 1970 +0000
884 summary: z
884 summary: z
885
885
886 diff --git a/subdir/f1 b/subdir/f1
886 diff --git a/subdir/f1 b/subdir/f1
887 old mode 100644
887 old mode 100644
888 new mode 100755
888 new mode 100755
889 --- a/subdir/f1
889 --- a/subdir/f1
890 +++ b/subdir/f1
890 +++ b/subdir/f1
891 @@ -1,2 +1,3 @@
891 @@ -1,2 +1,3 @@
892 a
892 a
893 a
893 a
894 +a
894 +a
895
895
896
896
897 Preserve execute permission on original
897 Preserve execute permission on original
898
898
899 $ echo b >> f1
899 $ echo b >> f1
900 $ hg commit -i -d '21 0' -maa <<EOF
900 $ hg commit -i -d '21 0' -maa <<EOF
901 > y
901 > y
902 > y
902 > y
903 > y
903 > y
904 > EOF
904 > EOF
905 diff --git a/subdir/f1 b/subdir/f1
905 diff --git a/subdir/f1 b/subdir/f1
906 1 hunks, 1 lines changed
906 1 hunks, 1 lines changed
907 examine changes to 'subdir/f1'? [Ynesfdaq?] y
907 examine changes to 'subdir/f1'? [Ynesfdaq?] y
908
908
909 @@ -1,3 +1,4 @@
909 @@ -1,3 +1,4 @@
910 a
910 a
911 a
911 a
912 a
912 a
913 +b
913 +b
914 record this change to 'subdir/f1'? [Ynesfdaq?] y
914 record this change to 'subdir/f1'? [Ynesfdaq?] y
915
915
916
916
917 $ hg tip --config diff.git=True -p
917 $ hg tip --config diff.git=True -p
918 changeset: 23:b429867550db
918 changeset: 23:b429867550db
919 tag: tip
919 tag: tip
920 user: test
920 user: test
921 date: Thu Jan 01 00:00:21 1970 +0000
921 date: Thu Jan 01 00:00:21 1970 +0000
922 summary: aa
922 summary: aa
923
923
924 diff --git a/subdir/f1 b/subdir/f1
924 diff --git a/subdir/f1 b/subdir/f1
925 --- a/subdir/f1
925 --- a/subdir/f1
926 +++ b/subdir/f1
926 +++ b/subdir/f1
927 @@ -1,3 +1,4 @@
927 @@ -1,3 +1,4 @@
928 a
928 a
929 a
929 a
930 a
930 a
931 +b
931 +b
932
932
933
933
934 Preserve chmod -x
934 Preserve chmod -x
935
935
936 $ chmod -x f1
936 $ chmod -x f1
937 $ echo c >> f1
937 $ echo c >> f1
938 $ hg commit -i -d '22 0' -mab <<EOF
938 $ hg commit -i -d '22 0' -mab <<EOF
939 > y
939 > y
940 > y
940 > y
941 > y
941 > y
942 > EOF
942 > EOF
943 diff --git a/subdir/f1 b/subdir/f1
943 diff --git a/subdir/f1 b/subdir/f1
944 old mode 100755
944 old mode 100755
945 new mode 100644
945 new mode 100644
946 1 hunks, 1 lines changed
946 1 hunks, 1 lines changed
947 examine changes to 'subdir/f1'? [Ynesfdaq?] y
947 examine changes to 'subdir/f1'? [Ynesfdaq?] y
948
948
949 @@ -2,3 +2,4 @@
949 @@ -2,3 +2,4 @@
950 a
950 a
951 a
951 a
952 b
952 b
953 +c
953 +c
954 record this change to 'subdir/f1'? [Ynesfdaq?] y
954 record this change to 'subdir/f1'? [Ynesfdaq?] y
955
955
956
956
957 $ hg tip --config diff.git=True -p
957 $ hg tip --config diff.git=True -p
958 changeset: 24:0b082130c20a
958 changeset: 24:0b082130c20a
959 tag: tip
959 tag: tip
960 user: test
960 user: test
961 date: Thu Jan 01 00:00:22 1970 +0000
961 date: Thu Jan 01 00:00:22 1970 +0000
962 summary: ab
962 summary: ab
963
963
964 diff --git a/subdir/f1 b/subdir/f1
964 diff --git a/subdir/f1 b/subdir/f1
965 old mode 100755
965 old mode 100755
966 new mode 100644
966 new mode 100644
967 --- a/subdir/f1
967 --- a/subdir/f1
968 +++ b/subdir/f1
968 +++ b/subdir/f1
969 @@ -2,3 +2,4 @@
969 @@ -2,3 +2,4 @@
970 a
970 a
971 a
971 a
972 b
972 b
973 +c
973 +c
974
974
975
975
976 #else
976 #else
977
977
978 Slightly bogus tests to get almost same repo structure as when x bit is used
978 Slightly bogus tests to get almost same repo structure as when x bit is used
979 - but with different hashes.
979 - but with different hashes.
980
980
981 Mock "Preserve chmod +x"
981 Mock "Preserve chmod +x"
982
982
983 $ echo a >> f1
983 $ echo a >> f1
984 $ hg commit -i -d '20 0' -mz <<EOF
984 $ hg commit -i -d '20 0' -mz <<EOF
985 > y
985 > y
986 > y
986 > y
987 > y
987 > y
988 > EOF
988 > EOF
989 diff --git a/subdir/f1 b/subdir/f1
989 diff --git a/subdir/f1 b/subdir/f1
990 1 hunks, 1 lines changed
990 1 hunks, 1 lines changed
991 examine changes to 'subdir/f1'? [Ynesfdaq?] y
991 examine changes to 'subdir/f1'? [Ynesfdaq?] y
992
992
993 @@ -1,2 +1,3 @@
993 @@ -1,2 +1,3 @@
994 a
994 a
995 a
995 a
996 +a
996 +a
997 record this change to 'subdir/f1'? [Ynesfdaq?] y
997 record this change to 'subdir/f1'? [Ynesfdaq?] y
998
998
999
999
1000 $ hg tip --config diff.git=True -p
1000 $ hg tip --config diff.git=True -p
1001 changeset: 22:0d463bd428f5
1001 changeset: 22:0d463bd428f5
1002 tag: tip
1002 tag: tip
1003 user: test
1003 user: test
1004 date: Thu Jan 01 00:00:20 1970 +0000
1004 date: Thu Jan 01 00:00:20 1970 +0000
1005 summary: z
1005 summary: z
1006
1006
1007 diff --git a/subdir/f1 b/subdir/f1
1007 diff --git a/subdir/f1 b/subdir/f1
1008 --- a/subdir/f1
1008 --- a/subdir/f1
1009 +++ b/subdir/f1
1009 +++ b/subdir/f1
1010 @@ -1,2 +1,3 @@
1010 @@ -1,2 +1,3 @@
1011 a
1011 a
1012 a
1012 a
1013 +a
1013 +a
1014
1014
1015
1015
1016 Mock "Preserve execute permission on original"
1016 Mock "Preserve execute permission on original"
1017
1017
1018 $ echo b >> f1
1018 $ echo b >> f1
1019 $ hg commit -i -d '21 0' -maa <<EOF
1019 $ hg commit -i -d '21 0' -maa <<EOF
1020 > y
1020 > y
1021 > y
1021 > y
1022 > y
1022 > y
1023 > EOF
1023 > EOF
1024 diff --git a/subdir/f1 b/subdir/f1
1024 diff --git a/subdir/f1 b/subdir/f1
1025 1 hunks, 1 lines changed
1025 1 hunks, 1 lines changed
1026 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1026 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1027
1027
1028 @@ -1,3 +1,4 @@
1028 @@ -1,3 +1,4 @@
1029 a
1029 a
1030 a
1030 a
1031 a
1031 a
1032 +b
1032 +b
1033 record this change to 'subdir/f1'? [Ynesfdaq?] y
1033 record this change to 'subdir/f1'? [Ynesfdaq?] y
1034
1034
1035
1035
1036 $ hg tip --config diff.git=True -p
1036 $ hg tip --config diff.git=True -p
1037 changeset: 23:0eab41a3e524
1037 changeset: 23:0eab41a3e524
1038 tag: tip
1038 tag: tip
1039 user: test
1039 user: test
1040 date: Thu Jan 01 00:00:21 1970 +0000
1040 date: Thu Jan 01 00:00:21 1970 +0000
1041 summary: aa
1041 summary: aa
1042
1042
1043 diff --git a/subdir/f1 b/subdir/f1
1043 diff --git a/subdir/f1 b/subdir/f1
1044 --- a/subdir/f1
1044 --- a/subdir/f1
1045 +++ b/subdir/f1
1045 +++ b/subdir/f1
1046 @@ -1,3 +1,4 @@
1046 @@ -1,3 +1,4 @@
1047 a
1047 a
1048 a
1048 a
1049 a
1049 a
1050 +b
1050 +b
1051
1051
1052
1052
1053 Mock "Preserve chmod -x"
1053 Mock "Preserve chmod -x"
1054
1054
1055 $ chmod -x f1
1055 $ chmod -x f1
1056 $ echo c >> f1
1056 $ echo c >> f1
1057 $ hg commit -i -d '22 0' -mab <<EOF
1057 $ hg commit -i -d '22 0' -mab <<EOF
1058 > y
1058 > y
1059 > y
1059 > y
1060 > y
1060 > y
1061 > EOF
1061 > EOF
1062 diff --git a/subdir/f1 b/subdir/f1
1062 diff --git a/subdir/f1 b/subdir/f1
1063 1 hunks, 1 lines changed
1063 1 hunks, 1 lines changed
1064 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1064 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1065
1065
1066 @@ -2,3 +2,4 @@
1066 @@ -2,3 +2,4 @@
1067 a
1067 a
1068 a
1068 a
1069 b
1069 b
1070 +c
1070 +c
1071 record this change to 'subdir/f1'? [Ynesfdaq?] y
1071 record this change to 'subdir/f1'? [Ynesfdaq?] y
1072
1072
1073
1073
1074 $ hg tip --config diff.git=True -p
1074 $ hg tip --config diff.git=True -p
1075 changeset: 24:f4f718f27b7c
1075 changeset: 24:f4f718f27b7c
1076 tag: tip
1076 tag: tip
1077 user: test
1077 user: test
1078 date: Thu Jan 01 00:00:22 1970 +0000
1078 date: Thu Jan 01 00:00:22 1970 +0000
1079 summary: ab
1079 summary: ab
1080
1080
1081 diff --git a/subdir/f1 b/subdir/f1
1081 diff --git a/subdir/f1 b/subdir/f1
1082 --- a/subdir/f1
1082 --- a/subdir/f1
1083 +++ b/subdir/f1
1083 +++ b/subdir/f1
1084 @@ -2,3 +2,4 @@
1084 @@ -2,3 +2,4 @@
1085 a
1085 a
1086 a
1086 a
1087 b
1087 b
1088 +c
1088 +c
1089
1089
1090
1090
1091 #endif
1091 #endif
1092
1092
1093 $ cd ..
1093 $ cd ..
1094
1094
1095
1095
1096 Abort early when a merge is in progress
1096 Abort early when a merge is in progress
1097
1097
1098 $ hg up 4
1098 $ hg up 4
1099 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
1099 1 files updated, 0 files merged, 6 files removed, 0 files unresolved
1100
1100
1101 $ touch iwillmergethat
1101 $ touch iwillmergethat
1102 $ hg add iwillmergethat
1102 $ hg add iwillmergethat
1103
1103
1104 $ hg branch thatbranch
1104 $ hg branch thatbranch
1105 marked working directory as branch thatbranch
1105 marked working directory as branch thatbranch
1106 (branches are permanent and global, did you want a bookmark?)
1106 (branches are permanent and global, did you want a bookmark?)
1107
1107
1108 $ hg ci -m'new head'
1108 $ hg ci -m'new head'
1109
1109
1110 $ hg up default
1110 $ hg up default
1111 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
1111 6 files updated, 0 files merged, 2 files removed, 0 files unresolved
1112
1112
1113 $ hg merge thatbranch
1113 $ hg merge thatbranch
1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1115 (branch merge, don't forget to commit)
1115 (branch merge, don't forget to commit)
1116
1116
1117 $ hg commit -i -m'will abort'
1117 $ hg commit -i -m'will abort'
1118 abort: cannot partially commit a merge (use "hg commit" instead)
1118 abort: cannot partially commit a merge (use "hg commit" instead)
1119 [255]
1119 [255]
1120
1120
1121 $ hg up -C
1121 $ hg up -C
1122 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1122 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1123
1123
1124 Editing patch (and ignoring trailing text)
1124 Editing patch (and ignoring trailing text)
1125
1125
1126 $ cat > editor.sh << '__EOF__'
1126 $ cat > editor.sh << '__EOF__'
1127 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1127 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1128 > trailing\nditto' "$1" > tmp
1128 > trailing\nditto' "$1" > tmp
1129 > mv tmp "$1"
1129 > mv tmp "$1"
1130 > __EOF__
1130 > __EOF__
1131 $ cat > editedfile << '__EOF__'
1131 $ cat > editedfile << '__EOF__'
1132 > This is the first line
1132 > This is the first line
1133 > This is the second line
1133 > This is the second line
1134 > This is the third line
1134 > This is the third line
1135 > __EOF__
1135 > __EOF__
1136 $ hg add editedfile
1136 $ hg add editedfile
1137 $ hg commit -medit-patch-1
1137 $ hg commit -medit-patch-1
1138 $ cat > editedfile << '__EOF__'
1138 $ cat > editedfile << '__EOF__'
1139 > This line has changed
1139 > This line has changed
1140 > This change will be committed
1140 > This change will be committed
1141 > This is the third line
1141 > This is the third line
1142 > __EOF__
1142 > __EOF__
1143 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-2 <<EOF
1143 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-2 <<EOF
1144 > y
1144 > y
1145 > e
1145 > e
1146 > EOF
1146 > EOF
1147 diff --git a/editedfile b/editedfile
1147 diff --git a/editedfile b/editedfile
1148 1 hunks, 2 lines changed
1148 1 hunks, 2 lines changed
1149 examine changes to 'editedfile'? [Ynesfdaq?] y
1149 examine changes to 'editedfile'? [Ynesfdaq?] y
1150
1150
1151 @@ -1,3 +1,3 @@
1151 @@ -1,3 +1,3 @@
1152 -This is the first line
1152 -This is the first line
1153 -This is the second line
1153 -This is the second line
1154 +This line has changed
1154 +This line has changed
1155 +This change will be committed
1155 +This change will be committed
1156 This is the third line
1156 This is the third line
1157 record this change to 'editedfile'? [Ynesfdaq?] e
1157 record this change to 'editedfile'? [Ynesfdaq?] e
1158
1158
1159 $ cat editedfile
1159 $ cat editedfile
1160 This line has changed
1160 This line has changed
1161 This change will be committed
1161 This change will be committed
1162 This is the third line
1162 This is the third line
1163 $ hg cat -r tip editedfile
1163 $ hg cat -r tip editedfile
1164 This is the first line
1164 This is the first line
1165 This change will be committed
1165 This change will be committed
1166 This is the third line
1166 This is the third line
1167 $ hg revert editedfile
1167 $ hg revert editedfile
1168
1168
1169 Trying to edit patch for whole file
1169 Trying to edit patch for whole file
1170
1170
1171 $ echo "This is the fourth line" >> editedfile
1171 $ echo "This is the fourth line" >> editedfile
1172 $ hg commit -i <<EOF
1172 $ hg commit -i <<EOF
1173 > e
1173 > e
1174 > q
1174 > q
1175 > EOF
1175 > EOF
1176 diff --git a/editedfile b/editedfile
1176 diff --git a/editedfile b/editedfile
1177 1 hunks, 1 lines changed
1177 1 hunks, 1 lines changed
1178 examine changes to 'editedfile'? [Ynesfdaq?] e
1178 examine changes to 'editedfile'? [Ynesfdaq?] e
1179
1179
1180 cannot edit patch for whole file
1180 cannot edit patch for whole file
1181 examine changes to 'editedfile'? [Ynesfdaq?] q
1181 examine changes to 'editedfile'? [Ynesfdaq?] q
1182
1182
1183 abort: user quit
1183 abort: user quit
1184 [255]
1184 [255]
1185 $ hg revert editedfile
1185 $ hg revert editedfile
1186
1186
1187 Removing changes from patch
1187 Removing changes from patch
1188
1188
1189 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1189 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1190 $ mv tmp editedfile
1190 $ mv tmp editedfile
1191 $ echo "This line has been added" >> editedfile
1191 $ echo "This line has been added" >> editedfile
1192 $ cat > editor.sh << '__EOF__'
1192 $ cat > editor.sh << '__EOF__'
1193 > sed -e 's/^[-+]/ /' "$1" > tmp
1193 > sed -e 's/^[-+]/ /' "$1" > tmp
1194 > mv tmp "$1"
1194 > mv tmp "$1"
1195 > __EOF__
1195 > __EOF__
1196 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1196 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1197 > y
1197 > y
1198 > e
1198 > e
1199 > EOF
1199 > EOF
1200 diff --git a/editedfile b/editedfile
1200 diff --git a/editedfile b/editedfile
1201 1 hunks, 3 lines changed
1201 1 hunks, 3 lines changed
1202 examine changes to 'editedfile'? [Ynesfdaq?] y
1202 examine changes to 'editedfile'? [Ynesfdaq?] y
1203
1203
1204 @@ -1,3 +1,3 @@
1204 @@ -1,3 +1,3 @@
1205 -This is the first line
1205 -This is the first line
1206 -This change will be committed
1206 -This change will be committed
1207 -This is the third line
1207 -This is the third line
1208 +This change will not be committed
1208 +This change will not be committed
1209 +This is the second line
1209 +This is the second line
1210 +This line has been added
1210 +This line has been added
1211 record this change to 'editedfile'? [Ynesfdaq?] e
1211 record this change to 'editedfile'? [Ynesfdaq?] e
1212
1212
1213 no changes to record
1213 no changes to record
1214 $ cat editedfile
1214 $ cat editedfile
1215 This change will not be committed
1215 This change will not be committed
1216 This is the second line
1216 This is the second line
1217 This line has been added
1217 This line has been added
1218 $ hg cat -r tip editedfile
1218 $ hg cat -r tip editedfile
1219 This is the first line
1219 This is the first line
1220 This change will be committed
1220 This change will be committed
1221 This is the third line
1221 This is the third line
1222 $ hg revert editedfile
1222 $ hg revert editedfile
1223
1223
1224 Invalid patch
1224 Invalid patch
1225
1225
1226 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1226 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1227 $ mv tmp editedfile
1227 $ mv tmp editedfile
1228 $ echo "This line has been added" >> editedfile
1228 $ echo "This line has been added" >> editedfile
1229 $ cat > editor.sh << '__EOF__'
1229 $ cat > editor.sh << '__EOF__'
1230 > sed s/This/That/ "$1" > tmp
1230 > sed s/This/That/ "$1" > tmp
1231 > mv tmp "$1"
1231 > mv tmp "$1"
1232 > __EOF__
1232 > __EOF__
1233 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1233 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1234 > y
1234 > y
1235 > e
1235 > e
1236 > EOF
1236 > EOF
1237 diff --git a/editedfile b/editedfile
1237 diff --git a/editedfile b/editedfile
1238 1 hunks, 3 lines changed
1238 1 hunks, 3 lines changed
1239 examine changes to 'editedfile'? [Ynesfdaq?] y
1239 examine changes to 'editedfile'? [Ynesfdaq?] y
1240
1240
1241 @@ -1,3 +1,3 @@
1241 @@ -1,3 +1,3 @@
1242 -This is the first line
1242 -This is the first line
1243 -This change will be committed
1243 -This change will be committed
1244 -This is the third line
1244 -This is the third line
1245 +This change will not be committed
1245 +This change will not be committed
1246 +This is the second line
1246 +This is the second line
1247 +This line has been added
1247 +This line has been added
1248 record this change to 'editedfile'? [Ynesfdaq?] e
1248 record this change to 'editedfile'? [Ynesfdaq?] e
1249
1249
1250 patching file editedfile
1250 patching file editedfile
1251 Hunk #1 FAILED at 0
1251 Hunk #1 FAILED at 0
1252 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1252 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1253 abort: patch failed to apply
1253 abort: patch failed to apply
1254 [255]
1254 [255]
1255 $ cat editedfile
1255 $ cat editedfile
1256 This change will not be committed
1256 This change will not be committed
1257 This is the second line
1257 This is the second line
1258 This line has been added
1258 This line has been added
1259 $ hg cat -r tip editedfile
1259 $ hg cat -r tip editedfile
1260 This is the first line
1260 This is the first line
1261 This change will be committed
1261 This change will be committed
1262 This is the third line
1262 This is the third line
1263 $ cat editedfile.rej
1263 $ cat editedfile.rej
1264 --- editedfile
1264 --- editedfile
1265 +++ editedfile
1265 +++ editedfile
1266 @@ -1,3 +1,3 @@
1266 @@ -1,3 +1,3 @@
1267 -That is the first line
1267 -That is the first line
1268 -That change will be committed
1268 -That change will be committed
1269 -That is the third line
1269 -That is the third line
1270 +That change will not be committed
1270 +That change will not be committed
1271 +That is the second line
1271 +That is the second line
1272 +That line has been added
1272 +That line has been added
1273
1273
1274 Malformed patch - error handling
1274 Malformed patch - error handling
1275
1275
1276 $ cat > editor.sh << '__EOF__'
1276 $ cat > editor.sh << '__EOF__'
1277 > sed -e '/^@/p' "$1" > tmp
1277 > sed -e '/^@/p' "$1" > tmp
1278 > mv tmp "$1"
1278 > mv tmp "$1"
1279 > __EOF__
1279 > __EOF__
1280 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1280 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1281 > y
1281 > y
1282 > e
1282 > e
1283 > EOF
1283 > EOF
1284 diff --git a/editedfile b/editedfile
1284 diff --git a/editedfile b/editedfile
1285 1 hunks, 3 lines changed
1285 1 hunks, 3 lines changed
1286 examine changes to 'editedfile'? [Ynesfdaq?] y
1286 examine changes to 'editedfile'? [Ynesfdaq?] y
1287
1287
1288 @@ -1,3 +1,3 @@
1288 @@ -1,3 +1,3 @@
1289 -This is the first line
1289 -This is the first line
1290 -This change will be committed
1290 -This change will be committed
1291 -This is the third line
1291 -This is the third line
1292 +This change will not be committed
1292 +This change will not be committed
1293 +This is the second line
1293 +This is the second line
1294 +This line has been added
1294 +This line has been added
1295 record this change to 'editedfile'? [Ynesfdaq?] e
1295 record this change to 'editedfile'? [Ynesfdaq?] e
1296
1296
1297 abort: error parsing patch: unhandled transition: range -> range
1297 abort: error parsing patch: unhandled transition: range -> range
1298 [255]
1298 [255]
1299
1299
1300 Exiting editor with status 1, ignores the edit but does not stop the recording
1300 Exiting editor with status 1, ignores the edit but does not stop the recording
1301 session
1301 session
1302
1302
1303 $ HGEDITOR=false hg commit -i <<EOF
1303 $ HGEDITOR=false hg commit -i <<EOF
1304 > y
1304 > y
1305 > e
1305 > e
1306 > n
1306 > n
1307 > EOF
1307 > EOF
1308 diff --git a/editedfile b/editedfile
1308 diff --git a/editedfile b/editedfile
1309 1 hunks, 3 lines changed
1309 1 hunks, 3 lines changed
1310 examine changes to 'editedfile'? [Ynesfdaq?] y
1310 examine changes to 'editedfile'? [Ynesfdaq?] y
1311
1311
1312 @@ -1,3 +1,3 @@
1312 @@ -1,3 +1,3 @@
1313 -This is the first line
1313 -This is the first line
1314 -This change will be committed
1314 -This change will be committed
1315 -This is the third line
1315 -This is the third line
1316 +This change will not be committed
1316 +This change will not be committed
1317 +This is the second line
1317 +This is the second line
1318 +This line has been added
1318 +This line has been added
1319 record this change to 'editedfile'? [Ynesfdaq?] e
1319 record this change to 'editedfile'? [Ynesfdaq?] e
1320
1320
1321 editor exited with exit code 1
1321 editor exited with exit code 1
1322 record this change to 'editedfile'? [Ynesfdaq?] n
1322 record this change to 'editedfile'? [Ynesfdaq?] n
1323
1323
1324 no changes to record
1324 no changes to record
1325
1325
1326
1326
1327 random text in random positions is still an error
1327 random text in random positions is still an error
1328
1328
1329 $ cat > editor.sh << '__EOF__'
1329 $ cat > editor.sh << '__EOF__'
1330 > sed -e '/^@/i\
1330 > sed -e '/^@/i\
1331 > other' "$1" > tmp
1331 > other' "$1" > tmp
1332 > mv tmp "$1"
1332 > mv tmp "$1"
1333 > __EOF__
1333 > __EOF__
1334 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1334 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1335 > y
1335 > y
1336 > e
1336 > e
1337 > EOF
1337 > EOF
1338 diff --git a/editedfile b/editedfile
1338 diff --git a/editedfile b/editedfile
1339 1 hunks, 3 lines changed
1339 1 hunks, 3 lines changed
1340 examine changes to 'editedfile'? [Ynesfdaq?] y
1340 examine changes to 'editedfile'? [Ynesfdaq?] y
1341
1341
1342 @@ -1,3 +1,3 @@
1342 @@ -1,3 +1,3 @@
1343 -This is the first line
1343 -This is the first line
1344 -This change will be committed
1344 -This change will be committed
1345 -This is the third line
1345 -This is the third line
1346 +This change will not be committed
1346 +This change will not be committed
1347 +This is the second line
1347 +This is the second line
1348 +This line has been added
1348 +This line has been added
1349 record this change to 'editedfile'? [Ynesfdaq?] e
1349 record this change to 'editedfile'? [Ynesfdaq?] e
1350
1350
1351 abort: error parsing patch: unhandled transition: file -> other
1351 abort: error parsing patch: unhandled transition: file -> other
1352 [255]
1352 [255]
1353
1353
1354 $ hg up -C
1354 $ hg up -C
1355 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1355 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1356
1356
1357 With win32text
1357 With win32text
1358
1358
1359 $ echo '[extensions]' >> .hg/hgrc
1359 $ echo '[extensions]' >> .hg/hgrc
1360 $ echo 'win32text = ' >> .hg/hgrc
1360 $ echo 'win32text = ' >> .hg/hgrc
1361 $ echo '[decode]' >> .hg/hgrc
1361 $ echo '[decode]' >> .hg/hgrc
1362 $ echo '** = cleverdecode:' >> .hg/hgrc
1362 $ echo '** = cleverdecode:' >> .hg/hgrc
1363 $ echo '[encode]' >> .hg/hgrc
1363 $ echo '[encode]' >> .hg/hgrc
1364 $ echo '** = cleverencode:' >> .hg/hgrc
1364 $ echo '** = cleverencode:' >> .hg/hgrc
1365 $ echo '[patch]' >> .hg/hgrc
1365 $ echo '[patch]' >> .hg/hgrc
1366 $ echo 'eol = crlf' >> .hg/hgrc
1366 $ echo 'eol = crlf' >> .hg/hgrc
1367
1367
1368 Ignore win32text deprecation warning for now:
1368 Ignore win32text deprecation warning for now:
1369
1369
1370 $ echo '[win32text]' >> .hg/hgrc
1370 $ echo '[win32text]' >> .hg/hgrc
1371 $ echo 'warn = no' >> .hg/hgrc
1371 $ echo 'warn = no' >> .hg/hgrc
1372
1372
1373 $ echo d >> subdir/f1
1373 $ echo d >> subdir/f1
1374 $ hg commit -i -d '24 0' -mw1 <<EOF
1374 $ hg commit -i -d '24 0' -mw1 <<EOF
1375 > y
1375 > y
1376 > y
1376 > y
1377 > EOF
1377 > EOF
1378 diff --git a/subdir/f1 b/subdir/f1
1378 diff --git a/subdir/f1 b/subdir/f1
1379 1 hunks, 1 lines changed
1379 1 hunks, 1 lines changed
1380 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1380 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1381
1381
1382 @@ -3,3 +3,4 @@
1382 @@ -3,3 +3,4 @@
1383 a
1383 a
1384 b
1384 b
1385 c
1385 c
1386 +d
1386 +d
1387 record this change to 'subdir/f1'? [Ynesfdaq?] y
1387 record this change to 'subdir/f1'? [Ynesfdaq?] y
1388
1388
1389
1389
1390 $ hg status -A subdir/f1
1390 $ hg status -A subdir/f1
1391 C subdir/f1
1391 C subdir/f1
1392 $ hg tip -p
1392 $ hg tip -p
1393 changeset: 28:* (glob)
1393 changeset: 28:* (glob)
1394 tag: tip
1394 tag: tip
1395 user: test
1395 user: test
1396 date: Thu Jan 01 00:00:24 1970 +0000
1396 date: Thu Jan 01 00:00:24 1970 +0000
1397 summary: w1
1397 summary: w1
1398
1398
1399 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1399 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1400 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1400 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1401 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1401 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1402 @@ -3,3 +3,4 @@
1402 @@ -3,3 +3,4 @@
1403 a
1403 a
1404 b
1404 b
1405 c
1405 c
1406 +d
1406 +d
1407
1407
1408
1408
1409
1409
1410 Test --user when ui.username not set
1410 Test --user when ui.username not set
1411 $ unset HGUSER
1411 $ unset HGUSER
1412 $ echo e >> subdir/f1
1412 $ echo e >> subdir/f1
1413 $ hg commit -i --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1413 $ hg commit -i --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1414 > y
1414 > y
1415 > y
1415 > y
1416 > EOF
1416 > EOF
1417 diff --git a/subdir/f1 b/subdir/f1
1417 diff --git a/subdir/f1 b/subdir/f1
1418 1 hunks, 1 lines changed
1418 1 hunks, 1 lines changed
1419 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1419 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1420
1420
1421 @@ -4,3 +4,4 @@
1421 @@ -4,3 +4,4 @@
1422 b
1422 b
1423 c
1423 c
1424 d
1424 d
1425 +e
1425 +e
1426 record this change to 'subdir/f1'? [Ynesfdaq?] y
1426 record this change to 'subdir/f1'? [Ynesfdaq?] y
1427
1427
1428 $ hg status -A subdir/f1
1428 $ hg status -A subdir/f1
1429 C subdir/f1
1429 C subdir/f1
1430 $ hg log --template '{author}\n' -l 1
1430 $ hg log --template '{author}\n' -l 1
1431 xyz
1431 xyz
1432 $ HGUSER="test"
1432 $ HGUSER="test"
1433 $ export HGUSER
1433 $ export HGUSER
1434
1434
1435
1435
1436 Moving files
1436 Moving files
1437
1437
1438 $ hg update -C .
1438 $ hg update -C .
1439 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1439 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1440 $ hg mv plain plain3
1440 $ hg mv plain plain3
1441 $ echo somechange >> plain3
1441 $ echo somechange >> plain3
1442 $ hg commit -i -d '23 0' -mmoving_files << EOF
1442 $ hg commit -i -d '23 0' -mmoving_files << EOF
1443 > y
1443 > y
1444 > y
1444 > y
1445 > EOF
1445 > EOF
1446 diff --git a/plain b/plain3
1446 diff --git a/plain b/plain3
1447 rename from plain
1447 rename from plain
1448 rename to plain3
1448 rename to plain3
1449 1 hunks, 1 lines changed
1449 1 hunks, 1 lines changed
1450 examine changes to 'plain' and 'plain3'? [Ynesfdaq?] y
1450 examine changes to 'plain' and 'plain3'? [Ynesfdaq?] y
1451
1451
1452 @@ -11,3 +11,4 @@
1452 @@ -11,3 +11,4 @@
1453 9
1453 9
1454 10
1454 10
1455 11
1455 11
1456 +somechange
1456 +somechange
1457 record this change to 'plain3'? [Ynesfdaq?] y
1457 record this change to 'plain3'? [Ynesfdaq?] y
1458
1458
1459 The #if execbit block above changes the hash here on some systems
1459 The #if execbit block above changes the hash here on some systems
1460 $ hg status -A plain3
1460 $ hg status -A plain3
1461 C plain3
1461 C plain3
1462 $ hg tip
1462 $ hg tip
1463 changeset: 30:* (glob)
1463 changeset: 30:* (glob)
1464 tag: tip
1464 tag: tip
1465 user: test
1465 user: test
1466 date: Thu Jan 01 00:00:23 1970 +0000
1466 date: Thu Jan 01 00:00:23 1970 +0000
1467 summary: moving_files
1467 summary: moving_files
1468
1468
1469 Editing patch of newly added file
1469 Editing patch of newly added file
1470
1470
1471 $ hg update -C .
1471 $ hg update -C .
1472 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1472 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1473 $ cat > editor.sh << '__EOF__'
1473 $ cat > editor.sh << '__EOF__'
1474 > cat "$1" | sed "s/first/very/g" > tt
1474 > cat "$1" | sed "s/first/very/g" > tt
1475 > mv tt "$1"
1475 > mv tt "$1"
1476 > __EOF__
1476 > __EOF__
1477 $ cat > newfile << '__EOF__'
1477 $ cat > newfile << '__EOF__'
1478 > This is the first line
1478 > This is the first line
1479 > This is the second line
1479 > This is the second line
1480 > This is the third line
1480 > This is the third line
1481 > __EOF__
1481 > __EOF__
1482 $ hg add newfile
1482 $ hg add newfile
1483 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new <<EOF
1483 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new <<EOF
1484 > y
1484 > y
1485 > e
1485 > e
1486 > EOF
1486 > EOF
1487 diff --git a/newfile b/newfile
1487 diff --git a/newfile b/newfile
1488 new file mode 100644
1488 new file mode 100644
1489 examine changes to 'newfile'? [Ynesfdaq?] y
1489 examine changes to 'newfile'? [Ynesfdaq?] y
1490
1490
1491 @@ -0,0 +1,3 @@
1491 @@ -0,0 +1,3 @@
1492 +This is the first line
1492 +This is the first line
1493 +This is the second line
1493 +This is the second line
1494 +This is the third line
1494 +This is the third line
1495 record this change to 'newfile'? [Ynesfdaq?] e
1495 record this change to 'newfile'? [Ynesfdaq?] e
1496
1496
1497 $ hg cat -r tip newfile
1497 $ hg cat -r tip newfile
1498 This is the very line
1498 This is the very line
1499 This is the second line
1499 This is the second line
1500 This is the third line
1500 This is the third line
1501
1501
1502 $ cat newfile
1502 $ cat newfile
1503 This is the first line
1503 This is the first line
1504 This is the second line
1504 This is the second line
1505 This is the third line
1505 This is the third line
1506
1506
1507 Add new file from within a subdirectory
1507 Add new file from within a subdirectory
1508 $ hg update -C .
1508 $ hg update -C .
1509 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1509 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1510 $ mkdir folder
1510 $ mkdir folder
1511 $ cd folder
1511 $ cd folder
1512 $ echo "foo" > bar
1512 $ echo "foo" > bar
1513 $ hg add bar
1513 $ hg add bar
1514 $ hg commit -i -d '23 0' -mnewfilesubdir <<EOF
1514 $ hg commit -i -d '23 0' -mnewfilesubdir <<EOF
1515 > y
1515 > y
1516 > y
1516 > y
1517 > EOF
1517 > EOF
1518 diff --git a/folder/bar b/folder/bar
1518 diff --git a/folder/bar b/folder/bar
1519 new file mode 100644
1519 new file mode 100644
1520 examine changes to 'folder/bar'? [Ynesfdaq?] y
1520 examine changes to 'folder/bar'? [Ynesfdaq?] y
1521
1521
1522 @@ -0,0 +1,1 @@
1522 @@ -0,0 +1,1 @@
1523 +foo
1523 +foo
1524 record this change to 'folder/bar'? [Ynesfdaq?] y
1524 record this change to 'folder/bar'? [Ynesfdaq?] y
1525
1525
1526 The #if execbit block above changes the hashes here on some systems
1526 The #if execbit block above changes the hashes here on some systems
1527 $ hg tip -p
1527 $ hg tip -p
1528 changeset: 32:* (glob)
1528 changeset: 32:* (glob)
1529 tag: tip
1529 tag: tip
1530 user: test
1530 user: test
1531 date: Thu Jan 01 00:00:23 1970 +0000
1531 date: Thu Jan 01 00:00:23 1970 +0000
1532 summary: newfilesubdir
1532 summary: newfilesubdir
1533
1533
1534 diff -r * -r * folder/bar (glob)
1534 diff -r * -r * folder/bar (glob)
1535 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1535 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1536 +++ b/folder/bar Thu Jan 01 00:00:23 1970 +0000
1536 +++ b/folder/bar Thu Jan 01 00:00:23 1970 +0000
1537 @@ -0,0 +1,1 @@
1537 @@ -0,0 +1,1 @@
1538 +foo
1538 +foo
1539
1539
1540 $ cd ..
1540 $ cd ..
1541
1541
1542 $ hg status -A folder/bar
1542 $ hg status -A folder/bar
1543 C folder/bar
1543 C folder/bar
1544
1544
1545 Clear win32text configuration before size/timestamp sensitive test
1545 Clear win32text configuration before size/timestamp sensitive test
1546
1546
1547 $ cat >> .hg/hgrc <<EOF
1547 $ cat >> .hg/hgrc <<EOF
1548 > [extensions]
1548 > [extensions]
1549 > win32text = !
1549 > win32text = !
1550 > [decode]
1550 > [decode]
1551 > ** = !
1551 > ** = !
1552 > [encode]
1552 > [encode]
1553 > ** = !
1553 > ** = !
1554 > [patch]
1554 > [patch]
1555 > eol = strict
1555 > eol = strict
1556 > EOF
1556 > EOF
1557 $ hg update -q -C null
1557 $ hg update -q -C null
1558 $ hg update -q -C tip
1558 $ hg update -q -C tip
1559
1559
1560 Test that partially committed file is still treated as "modified",
1560 Test that partially committed file is still treated as "modified",
1561 even if none of mode, size and timestamp is changed on the filesystem
1561 even if none of mode, size and timestamp is changed on the filesystem
1562 (see also issue4583).
1562 (see also issue4583).
1563
1563
1564 $ cat > subdir/f1 <<EOF
1564 $ cat > subdir/f1 <<EOF
1565 > A
1565 > A
1566 > a
1566 > a
1567 > a
1567 > a
1568 > b
1568 > b
1569 > c
1569 > c
1570 > d
1570 > d
1571 > E
1571 > E
1572 > EOF
1572 > EOF
1573 $ hg diff --git subdir/f1
1573 $ hg diff --git subdir/f1
1574 diff --git a/subdir/f1 b/subdir/f1
1574 diff --git a/subdir/f1 b/subdir/f1
1575 --- a/subdir/f1
1575 --- a/subdir/f1
1576 +++ b/subdir/f1
1576 +++ b/subdir/f1
1577 @@ -1,7 +1,7 @@
1577 @@ -1,7 +1,7 @@
1578 -a
1578 -a
1579 +A
1579 +A
1580 a
1580 a
1581 a
1581 a
1582 b
1582 b
1583 c
1583 c
1584 d
1584 d
1585 -e
1585 -e
1586 +E
1586 +E
1587
1587
1588 $ touch -t 200001010000 subdir/f1
1588 $ touch -t 200001010000 subdir/f1
1589
1589
1590 $ cat >> .hg/hgrc <<EOF
1590 $ cat >> .hg/hgrc <<EOF
1591 > # emulate invoking patch.internalpatch() at 2000-01-01 00:00
1591 > # emulate invoking patch.internalpatch() at 2000-01-01 00:00
1592 > [fakepatchtime]
1592 > [fakepatchtime]
1593 > fakenow = 200001010000
1593 > fakenow = 200001010000
1594 >
1594 >
1595 > [extensions]
1595 > [extensions]
1596 > fakepatchtime = $TESTDIR/fakepatchtime.py
1596 > fakepatchtime = $TESTDIR/fakepatchtime.py
1597 > EOF
1597 > EOF
1598 $ hg commit -i -m 'commit subdir/f1 partially' <<EOF
1598 $ hg commit -i -m 'commit subdir/f1 partially' <<EOF
1599 > y
1599 > y
1600 > y
1600 > y
1601 > n
1601 > n
1602 > EOF
1602 > EOF
1603 diff --git a/subdir/f1 b/subdir/f1
1603 diff --git a/subdir/f1 b/subdir/f1
1604 2 hunks, 2 lines changed
1604 2 hunks, 2 lines changed
1605 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1605 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1606
1606
1607 @@ -1,6 +1,6 @@
1607 @@ -1,6 +1,6 @@
1608 -a
1608 -a
1609 +A
1609 +A
1610 a
1610 a
1611 a
1611 a
1612 b
1612 b
1613 c
1613 c
1614 d
1614 d
1615 record change 1/2 to 'subdir/f1'? [Ynesfdaq?] y
1615 record change 1/2 to 'subdir/f1'? [Ynesfdaq?] y
1616
1616
1617 @@ -2,6 +2,6 @@
1617 @@ -2,6 +2,6 @@
1618 a
1618 a
1619 a
1619 a
1620 b
1620 b
1621 c
1621 c
1622 d
1622 d
1623 -e
1623 -e
1624 +E
1624 +E
1625 record change 2/2 to 'subdir/f1'? [Ynesfdaq?] n
1625 record change 2/2 to 'subdir/f1'? [Ynesfdaq?] n
1626
1626
1627 $ cat >> .hg/hgrc <<EOF
1627 $ cat >> .hg/hgrc <<EOF
1628 > [extensions]
1628 > [extensions]
1629 > fakepatchtime = !
1629 > fakepatchtime = !
1630 > EOF
1630 > EOF
1631
1631
1632 $ hg debugstate | grep ' subdir/f1$'
1632 $ hg debugstate | grep ' subdir/f1$'
1633 n 0 -1 unset subdir/f1
1633 n 0 -1 unset subdir/f1
1634 $ hg status -A subdir/f1
1634 $ hg status -A subdir/f1
1635 M subdir/f1
1635 M subdir/f1
General Comments 0
You need to be logged in to leave comments. Login now