##// END OF EJS Templates
tests: update test-commit-interactive.t for no-execbit platforms...
Matt Harbison -
r42788:ebf353aa default
parent child Browse files
Show More
@@ -1,1978 +1,1984 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 abort: empty commit message
29 abort: empty commit message
30 [255]
30 [255]
31
31
32 $ hg tip -p
32 $ hg tip -p
33 changeset: -1:000000000000
33 changeset: -1:000000000000
34 tag: tip
34 tag: tip
35 user:
35 user:
36 date: Thu Jan 01 00:00:00 1970 +0000
36 date: Thu Jan 01 00:00:00 1970 +0000
37
37
38
38
39
39
40 Select files but no hunks
40 Select files but no hunks
41
41
42 $ hg commit -i empty-rw<<EOF
42 $ hg commit -i empty-rw<<EOF
43 > y
43 > y
44 > n
44 > n
45 > EOF
45 > EOF
46 diff --git a/empty-rw b/empty-rw
46 diff --git a/empty-rw b/empty-rw
47 new file mode 100644
47 new file mode 100644
48 abort: empty commit message
48 abort: empty commit message
49 [255]
49 [255]
50
50
51 $ hg tip -p
51 $ hg tip -p
52 changeset: -1:000000000000
52 changeset: -1:000000000000
53 tag: tip
53 tag: tip
54 user:
54 user:
55 date: Thu Jan 01 00:00:00 1970 +0000
55 date: Thu Jan 01 00:00:00 1970 +0000
56
56
57
57
58
58
59 Abort for untracked
59 Abort for untracked
60
60
61 $ touch untracked
61 $ touch untracked
62 $ hg commit -i -m should-fail empty-rw untracked
62 $ hg commit -i -m should-fail empty-rw untracked
63 abort: untracked: file not tracked!
63 abort: untracked: file not tracked!
64 [255]
64 [255]
65 $ rm untracked
65 $ rm untracked
66
66
67 Record empty file
67 Record empty file
68
68
69 $ hg commit -i -d '0 0' -m empty empty-rw<<EOF
69 $ hg commit -i -d '0 0' -m empty empty-rw<<EOF
70 > y
70 > y
71 > EOF
71 > EOF
72 diff --git a/empty-rw b/empty-rw
72 diff --git a/empty-rw b/empty-rw
73 new file mode 100644
73 new file mode 100644
74
74
75 $ hg tip -p
75 $ hg tip -p
76 changeset: 0:c0708cf4e46e
76 changeset: 0:c0708cf4e46e
77 tag: tip
77 tag: tip
78 user: test
78 user: test
79 date: Thu Jan 01 00:00:00 1970 +0000
79 date: Thu Jan 01 00:00:00 1970 +0000
80 summary: empty
80 summary: empty
81
81
82
82
83
83
84 Summary shows we updated to the new cset
84 Summary shows we updated to the new cset
85
85
86 $ hg summary
86 $ hg summary
87 parent: 0:c0708cf4e46e tip
87 parent: 0:c0708cf4e46e tip
88 empty
88 empty
89 branch: default
89 branch: default
90 commit: (clean)
90 commit: (clean)
91 update: (current)
91 update: (current)
92 phases: 1 draft
92 phases: 1 draft
93
93
94 Rename empty file
94 Rename empty file
95
95
96 $ hg mv empty-rw empty-rename
96 $ hg mv empty-rw empty-rename
97 $ hg commit -i -d '1 0' -m rename<<EOF
97 $ hg commit -i -d '1 0' -m rename<<EOF
98 > y
98 > y
99 > EOF
99 > EOF
100 diff --git a/empty-rw b/empty-rename
100 diff --git a/empty-rw b/empty-rename
101 rename from empty-rw
101 rename from empty-rw
102 rename to empty-rename
102 rename to empty-rename
103 examine changes to 'empty-rw' and 'empty-rename'?
103 examine changes to 'empty-rw' and 'empty-rename'?
104 (enter ? for help) [Ynesfdaq?] y
104 (enter ? for help) [Ynesfdaq?] y
105
105
106
106
107 $ hg tip -p
107 $ hg tip -p
108 changeset: 1:d695e8dcb197
108 changeset: 1:d695e8dcb197
109 tag: tip
109 tag: tip
110 user: test
110 user: test
111 date: Thu Jan 01 00:00:01 1970 +0000
111 date: Thu Jan 01 00:00:01 1970 +0000
112 summary: rename
112 summary: rename
113
113
114
114
115
115
116 Copy empty file
116 Copy empty file
117
117
118 $ hg cp empty-rename empty-copy
118 $ hg cp empty-rename empty-copy
119 $ hg commit -i -d '2 0' -m copy<<EOF
119 $ hg commit -i -d '2 0' -m copy<<EOF
120 > y
120 > y
121 > EOF
121 > EOF
122 diff --git a/empty-rename b/empty-copy
122 diff --git a/empty-rename b/empty-copy
123 copy from empty-rename
123 copy from empty-rename
124 copy to empty-copy
124 copy to empty-copy
125 examine changes to 'empty-rename' and 'empty-copy'?
125 examine changes to 'empty-rename' and 'empty-copy'?
126 (enter ? for help) [Ynesfdaq?] y
126 (enter ? for help) [Ynesfdaq?] y
127
127
128
128
129 $ hg tip -p
129 $ hg tip -p
130 changeset: 2:1d4b90bea524
130 changeset: 2:1d4b90bea524
131 tag: tip
131 tag: tip
132 user: test
132 user: test
133 date: Thu Jan 01 00:00:02 1970 +0000
133 date: Thu Jan 01 00:00:02 1970 +0000
134 summary: copy
134 summary: copy
135
135
136
136
137
137
138 Delete empty file
138 Delete empty file
139
139
140 $ hg rm empty-copy
140 $ hg rm empty-copy
141 $ hg commit -i -d '3 0' -m delete<<EOF
141 $ hg commit -i -d '3 0' -m delete<<EOF
142 > y
142 > y
143 > EOF
143 > EOF
144 diff --git a/empty-copy b/empty-copy
144 diff --git a/empty-copy b/empty-copy
145 deleted file mode 100644
145 deleted file mode 100644
146 examine changes to 'empty-copy'?
146 examine changes to 'empty-copy'?
147 (enter ? for help) [Ynesfdaq?] y
147 (enter ? for help) [Ynesfdaq?] y
148
148
149
149
150 $ hg tip -p
150 $ hg tip -p
151 changeset: 3:b39a238f01a1
151 changeset: 3:b39a238f01a1
152 tag: tip
152 tag: tip
153 user: test
153 user: test
154 date: Thu Jan 01 00:00:03 1970 +0000
154 date: Thu Jan 01 00:00:03 1970 +0000
155 summary: delete
155 summary: delete
156
156
157
157
158
158
159 Add binary file
159 Add binary file
160
160
161 $ hg bundle --type v1 --base -2 tip.bundle
161 $ hg bundle --type v1 --base -2 tip.bundle
162 1 changesets found
162 1 changesets found
163 $ hg add tip.bundle
163 $ hg add tip.bundle
164 $ hg commit -i -d '4 0' -m binary<<EOF
164 $ hg commit -i -d '4 0' -m binary<<EOF
165 > y
165 > y
166 > EOF
166 > EOF
167 diff --git a/tip.bundle b/tip.bundle
167 diff --git a/tip.bundle b/tip.bundle
168 new file mode 100644
168 new file mode 100644
169 this is a binary file
169 this is a binary file
170 examine changes to 'tip.bundle'?
170 examine changes to 'tip.bundle'?
171 (enter ? for help) [Ynesfdaq?] y
171 (enter ? for help) [Ynesfdaq?] y
172
172
173
173
174 $ hg tip -p
174 $ hg tip -p
175 changeset: 4:ad816da3711e
175 changeset: 4:ad816da3711e
176 tag: tip
176 tag: tip
177 user: test
177 user: test
178 date: Thu Jan 01 00:00:04 1970 +0000
178 date: Thu Jan 01 00:00:04 1970 +0000
179 summary: binary
179 summary: binary
180
180
181 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
181 diff -r b39a238f01a1 -r ad816da3711e tip.bundle
182 Binary file tip.bundle has changed
182 Binary file tip.bundle has changed
183
183
184
184
185 Change binary file
185 Change binary file
186
186
187 $ hg bundle --base -2 --type v1 tip.bundle
187 $ hg bundle --base -2 --type v1 tip.bundle
188 1 changesets found
188 1 changesets found
189 $ hg commit -i -d '5 0' -m binary-change<<EOF
189 $ hg commit -i -d '5 0' -m binary-change<<EOF
190 > y
190 > y
191 > EOF
191 > EOF
192 diff --git a/tip.bundle b/tip.bundle
192 diff --git a/tip.bundle b/tip.bundle
193 this modifies a binary file (all or nothing)
193 this modifies a binary file (all or nothing)
194 examine changes to 'tip.bundle'?
194 examine changes to 'tip.bundle'?
195 (enter ? for help) [Ynesfdaq?] y
195 (enter ? for help) [Ynesfdaq?] y
196
196
197
197
198 $ hg tip -p
198 $ hg tip -p
199 changeset: 5:dccd6f3eb485
199 changeset: 5:dccd6f3eb485
200 tag: tip
200 tag: tip
201 user: test
201 user: test
202 date: Thu Jan 01 00:00:05 1970 +0000
202 date: Thu Jan 01 00:00:05 1970 +0000
203 summary: binary-change
203 summary: binary-change
204
204
205 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
205 diff -r ad816da3711e -r dccd6f3eb485 tip.bundle
206 Binary file tip.bundle has changed
206 Binary file tip.bundle has changed
207
207
208
208
209 Rename and change binary file
209 Rename and change binary file
210
210
211 $ hg mv tip.bundle top.bundle
211 $ hg mv tip.bundle top.bundle
212 $ hg bundle --base -2 --type v1 top.bundle
212 $ hg bundle --base -2 --type v1 top.bundle
213 1 changesets found
213 1 changesets found
214 $ hg commit -i -d '6 0' -m binary-change-rename<<EOF
214 $ hg commit -i -d '6 0' -m binary-change-rename<<EOF
215 > y
215 > y
216 > EOF
216 > EOF
217 diff --git a/tip.bundle b/top.bundle
217 diff --git a/tip.bundle b/top.bundle
218 rename from tip.bundle
218 rename from tip.bundle
219 rename to top.bundle
219 rename to top.bundle
220 this modifies a binary file (all or nothing)
220 this modifies a binary file (all or nothing)
221 examine changes to 'tip.bundle' and 'top.bundle'?
221 examine changes to 'tip.bundle' and 'top.bundle'?
222 (enter ? for help) [Ynesfdaq?] y
222 (enter ? for help) [Ynesfdaq?] y
223
223
224
224
225 $ hg tip -p
225 $ hg tip -p
226 changeset: 6:7fa44105f5b3
226 changeset: 6:7fa44105f5b3
227 tag: tip
227 tag: tip
228 user: test
228 user: test
229 date: Thu Jan 01 00:00:06 1970 +0000
229 date: Thu Jan 01 00:00:06 1970 +0000
230 summary: binary-change-rename
230 summary: binary-change-rename
231
231
232 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
232 diff -r dccd6f3eb485 -r 7fa44105f5b3 tip.bundle
233 Binary file tip.bundle has changed
233 Binary file tip.bundle has changed
234 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
234 diff -r dccd6f3eb485 -r 7fa44105f5b3 top.bundle
235 Binary file top.bundle has changed
235 Binary file top.bundle has changed
236
236
237
237
238 Add plain file
238 Add plain file
239
239
240 $ for i in 1 2 3 4 5 6 7 8 9 10; do
240 $ for i in 1 2 3 4 5 6 7 8 9 10; do
241 > echo $i >> plain
241 > echo $i >> plain
242 > done
242 > done
243
243
244 $ hg add plain
244 $ hg add plain
245 $ hg commit -i -d '7 0' -m plain plain<<EOF
245 $ hg commit -i -d '7 0' -m plain plain<<EOF
246 > y
246 > y
247 > y
247 > y
248 > EOF
248 > EOF
249 diff --git a/plain b/plain
249 diff --git a/plain b/plain
250 new file mode 100644
250 new file mode 100644
251 @@ -0,0 +1,10 @@
251 @@ -0,0 +1,10 @@
252 +1
252 +1
253 +2
253 +2
254 +3
254 +3
255 +4
255 +4
256 +5
256 +5
257 +6
257 +6
258 +7
258 +7
259 +8
259 +8
260 +9
260 +9
261 +10
261 +10
262 record this change to 'plain'?
262 record this change to 'plain'?
263 (enter ? for help) [Ynesfdaq?] y
263 (enter ? for help) [Ynesfdaq?] y
264
264
265 $ hg tip -p
265 $ hg tip -p
266 changeset: 7:11fb457c1be4
266 changeset: 7:11fb457c1be4
267 tag: tip
267 tag: tip
268 user: test
268 user: test
269 date: Thu Jan 01 00:00:07 1970 +0000
269 date: Thu Jan 01 00:00:07 1970 +0000
270 summary: plain
270 summary: plain
271
271
272 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
272 diff -r 7fa44105f5b3 -r 11fb457c1be4 plain
273 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
273 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
274 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
274 +++ b/plain Thu Jan 01 00:00:07 1970 +0000
275 @@ -0,0 +1,10 @@
275 @@ -0,0 +1,10 @@
276 +1
276 +1
277 +2
277 +2
278 +3
278 +3
279 +4
279 +4
280 +5
280 +5
281 +6
281 +6
282 +7
282 +7
283 +8
283 +8
284 +9
284 +9
285 +10
285 +10
286
286
287 Modify end of plain file with username unset
287 Modify end of plain file with username unset
288
288
289 $ echo 11 >> plain
289 $ echo 11 >> plain
290 $ unset HGUSER
290 $ unset HGUSER
291 $ hg commit -i --config ui.username= -d '8 0' -m end plain
291 $ hg commit -i --config ui.username= -d '8 0' -m end plain
292 abort: no username supplied
292 abort: no username supplied
293 (use 'hg config --edit' to set your username)
293 (use 'hg config --edit' to set your username)
294 [255]
294 [255]
295
295
296
296
297 Modify end of plain file, also test that diffopts are accounted for
297 Modify end of plain file, also test that diffopts are accounted for
298
298
299 $ HGUSER="test"
299 $ HGUSER="test"
300 $ export HGUSER
300 $ export HGUSER
301 $ hg commit -i --config diff.showfunc=true -d '8 0' -m end plain <<EOF
301 $ hg commit -i --config diff.showfunc=true -d '8 0' -m end plain <<EOF
302 > y
302 > y
303 > y
303 > y
304 > EOF
304 > EOF
305 diff --git a/plain b/plain
305 diff --git a/plain b/plain
306 1 hunks, 1 lines changed
306 1 hunks, 1 lines changed
307 @@ -8,3 +8,4 @@ 7
307 @@ -8,3 +8,4 @@ 7
308 8
308 8
309 9
309 9
310 10
310 10
311 +11
311 +11
312 record this change to 'plain'?
312 record this change to 'plain'?
313 (enter ? for help) [Ynesfdaq?] y
313 (enter ? for help) [Ynesfdaq?] y
314
314
315
315
316 Modify end of plain file, no EOL
316 Modify end of plain file, no EOL
317
317
318 $ hg tip --template '{node}' >> plain
318 $ hg tip --template '{node}' >> plain
319 $ hg commit -i -d '9 0' -m noeol plain <<EOF
319 $ hg commit -i -d '9 0' -m noeol plain <<EOF
320 > y
320 > y
321 > y
321 > y
322 > EOF
322 > EOF
323 diff --git a/plain b/plain
323 diff --git a/plain b/plain
324 1 hunks, 1 lines changed
324 1 hunks, 1 lines changed
325 @@ -9,3 +9,4 @@ 8
325 @@ -9,3 +9,4 @@ 8
326 9
326 9
327 10
327 10
328 11
328 11
329 +7264f99c5f5ff3261504828afa4fb4d406c3af54
329 +7264f99c5f5ff3261504828afa4fb4d406c3af54
330 \ No newline at end of file
330 \ No newline at end of file
331 record this change to 'plain'?
331 record this change to 'plain'?
332 (enter ? for help) [Ynesfdaq?] y
332 (enter ? for help) [Ynesfdaq?] y
333
333
334
334
335 Record showfunc should preserve function across sections
335 Record showfunc should preserve function across sections
336
336
337 $ cat > f1.py <<NO_CHECK_EOF
337 $ cat > f1.py <<NO_CHECK_EOF
338 > def annotate(ui, repo, *pats, **opts):
338 > def annotate(ui, repo, *pats, **opts):
339 > """show changeset information by line for each file
339 > """show changeset information by line for each file
340 >
340 >
341 > List changes in files, showing the revision id responsible for
341 > List changes in files, showing the revision id responsible for
342 > each line.
342 > each line.
343 >
343 >
344 > This command is useful for discovering when a change was made and
344 > This command is useful for discovering when a change was made and
345 > by whom.
345 > by whom.
346 >
346 >
347 > If you include -f/-u/-d, the revision number is suppressed unless
347 > If you include -f/-u/-d, the revision number is suppressed unless
348 > you also include -the revision number is suppressed unless
348 > you also include -the revision number is suppressed unless
349 > you also include -n.
349 > you also include -n.
350 >
350 >
351 > Without the -a/--text option, annotate will avoid processing files
351 > Without the -a/--text option, annotate will avoid processing files
352 > it detects as binary. With -a, annotate will annotate the file
352 > it detects as binary. With -a, annotate will annotate the file
353 > anyway, although the results will probably be neither useful
353 > anyway, although the results will probably be neither useful
354 > nor desirable.
354 > nor desirable.
355 >
355 >
356 > Returns 0 on success.
356 > Returns 0 on success.
357 > """
357 > """
358 > return 0
358 > return 0
359 > def archive(ui, repo, dest, **opts):
359 > def archive(ui, repo, dest, **opts):
360 > '''create an unversioned archive of a repository revision
360 > '''create an unversioned archive of a repository revision
361 >
361 >
362 > By default, the revision used is the parent of the working
362 > By default, the revision used is the parent of the working
363 > directory; use -r/--rev to specify a different revision.
363 > directory; use -r/--rev to specify a different revision.
364 >
364 >
365 > The archive type is automatically detected based on file
365 > The archive type is automatically detected based on file
366 > extension (to override, use -t/--type).
366 > extension (to override, use -t/--type).
367 >
367 >
368 > .. container:: verbose
368 > .. container:: verbose
369 >
369 >
370 > Valid types are:
370 > Valid types are:
371 > NO_CHECK_EOF
371 > NO_CHECK_EOF
372 $ hg add f1.py
372 $ hg add f1.py
373 $ hg commit -m funcs
373 $ hg commit -m funcs
374 $ cat > f1.py <<NO_CHECK_EOF
374 $ cat > f1.py <<NO_CHECK_EOF
375 > def annotate(ui, repo, *pats, **opts):
375 > def annotate(ui, repo, *pats, **opts):
376 > """show changeset information by line for each file
376 > """show changeset information by line for each file
377 >
377 >
378 > List changes in files, showing the revision id responsible for
378 > List changes in files, showing the revision id responsible for
379 > each line
379 > each line
380 >
380 >
381 > This command is useful for discovering when a change was made and
381 > This command is useful for discovering when a change was made and
382 > by whom.
382 > by whom.
383 >
383 >
384 > Without the -a/--text option, annotate will avoid processing files
384 > Without the -a/--text option, annotate will avoid processing files
385 > it detects as binary. With -a, annotate will annotate the file
385 > it detects as binary. With -a, annotate will annotate the file
386 > anyway, although the results will probably be neither useful
386 > anyway, although the results will probably be neither useful
387 > nor desirable.
387 > nor desirable.
388 >
388 >
389 > Returns 0 on success.
389 > Returns 0 on success.
390 > """
390 > """
391 > return 0
391 > return 0
392 > def archive(ui, repo, dest, **opts):
392 > def archive(ui, repo, dest, **opts):
393 > '''create an unversioned archive of a repository revision
393 > '''create an unversioned archive of a repository revision
394 >
394 >
395 > By default, the revision used is the parent of the working
395 > By default, the revision used is the parent of the working
396 > directory; use -r/--rev to specify a different revision.
396 > directory; use -r/--rev to specify a different revision.
397 >
397 >
398 > The archive type is automatically detected based on file
398 > The archive type is automatically detected based on file
399 > extension (or override using -t/--type).
399 > extension (or override using -t/--type).
400 >
400 >
401 > .. container:: verbose
401 > .. container:: verbose
402 >
402 >
403 > Valid types are:
403 > Valid types are:
404 > NO_CHECK_EOF
404 > NO_CHECK_EOF
405 $ hg commit -i -m interactive <<EOF
405 $ hg commit -i -m interactive <<EOF
406 > y
406 > y
407 > y
407 > y
408 > y
408 > y
409 > y
409 > y
410 > EOF
410 > EOF
411 diff --git a/f1.py b/f1.py
411 diff --git a/f1.py b/f1.py
412 3 hunks, 6 lines changed
412 3 hunks, 6 lines changed
413 examine changes to 'f1.py'?
413 examine changes to 'f1.py'?
414 (enter ? for help) [Ynesfdaq?] y
414 (enter ? for help) [Ynesfdaq?] y
415
415
416 @@ -2,8 +2,8 @@ def annotate(ui, repo, *pats, **opts):
416 @@ -2,8 +2,8 @@ def annotate(ui, repo, *pats, **opts):
417 """show changeset information by line for each file
417 """show changeset information by line for each file
418
418
419 List changes in files, showing the revision id responsible for
419 List changes in files, showing the revision id responsible for
420 - each line.
420 - each line.
421 + each line
421 + each line
422
422
423 This command is useful for discovering when a change was made and
423 This command is useful for discovering when a change was made and
424 by whom.
424 by whom.
425
425
426 record change 1/3 to 'f1.py'?
426 record change 1/3 to 'f1.py'?
427 (enter ? for help) [Ynesfdaq?] y
427 (enter ? for help) [Ynesfdaq?] y
428
428
429 @@ -6,11 +6,7 @@ def annotate(ui, repo, *pats, **opts):
429 @@ -6,11 +6,7 @@ def annotate(ui, repo, *pats, **opts):
430
430
431 This command is useful for discovering when a change was made and
431 This command is useful for discovering when a change was made and
432 by whom.
432 by whom.
433
433
434 - If you include -f/-u/-d, the revision number is suppressed unless
434 - If you include -f/-u/-d, the revision number is suppressed unless
435 - you also include -the revision number is suppressed unless
435 - you also include -the revision number is suppressed unless
436 - you also include -n.
436 - you also include -n.
437 -
437 -
438 Without the -a/--text option, annotate will avoid processing files
438 Without the -a/--text option, annotate will avoid processing files
439 it detects as binary. With -a, annotate will annotate the file
439 it detects as binary. With -a, annotate will annotate the file
440 anyway, although the results will probably be neither useful
440 anyway, although the results will probably be neither useful
441 record change 2/3 to 'f1.py'?
441 record change 2/3 to 'f1.py'?
442 (enter ? for help) [Ynesfdaq?] y
442 (enter ? for help) [Ynesfdaq?] y
443
443
444 @@ -26,7 +22,7 @@ def archive(ui, repo, dest, **opts):
444 @@ -26,7 +22,7 @@ def archive(ui, repo, dest, **opts):
445 directory; use -r/--rev to specify a different revision.
445 directory; use -r/--rev to specify a different revision.
446
446
447 The archive type is automatically detected based on file
447 The archive type is automatically detected based on file
448 - extension (to override, use -t/--type).
448 - extension (to override, use -t/--type).
449 + extension (or override using -t/--type).
449 + extension (or override using -t/--type).
450
450
451 .. container:: verbose
451 .. container:: verbose
452
452
453 record change 3/3 to 'f1.py'?
453 record change 3/3 to 'f1.py'?
454 (enter ? for help) [Ynesfdaq?] y
454 (enter ? for help) [Ynesfdaq?] y
455
455
456
456
457 Modify end of plain file, add EOL
457 Modify end of plain file, add EOL
458
458
459 $ echo >> plain
459 $ echo >> plain
460 $ echo 1 > plain2
460 $ echo 1 > plain2
461 $ hg add plain2
461 $ hg add plain2
462 $ hg commit -i -d '10 0' -m eol plain plain2 <<EOF
462 $ hg commit -i -d '10 0' -m eol plain plain2 <<EOF
463 > y
463 > y
464 > y
464 > y
465 > y
465 > y
466 > y
466 > y
467 > EOF
467 > EOF
468 diff --git a/plain b/plain
468 diff --git a/plain b/plain
469 1 hunks, 1 lines changed
469 1 hunks, 1 lines changed
470 @@ -9,4 +9,4 @@ 8
470 @@ -9,4 +9,4 @@ 8
471 9
471 9
472 10
472 10
473 11
473 11
474 -7264f99c5f5ff3261504828afa4fb4d406c3af54
474 -7264f99c5f5ff3261504828afa4fb4d406c3af54
475 \ No newline at end of file
475 \ No newline at end of file
476 +7264f99c5f5ff3261504828afa4fb4d406c3af54
476 +7264f99c5f5ff3261504828afa4fb4d406c3af54
477 record change 1/2 to 'plain'?
477 record change 1/2 to 'plain'?
478 (enter ? for help) [Ynesfdaq?] y
478 (enter ? for help) [Ynesfdaq?] y
479
479
480 diff --git a/plain2 b/plain2
480 diff --git a/plain2 b/plain2
481 new file mode 100644
481 new file mode 100644
482 @@ -0,0 +1,1 @@
482 @@ -0,0 +1,1 @@
483 +1
483 +1
484 record change 2/2 to 'plain2'?
484 record change 2/2 to 'plain2'?
485 (enter ? for help) [Ynesfdaq?] y
485 (enter ? for help) [Ynesfdaq?] y
486
486
487 Modify beginning, trim end, record both, add another file to test
487 Modify beginning, trim end, record both, add another file to test
488 changes numbering
488 changes numbering
489
489
490 $ rm plain
490 $ rm plain
491 $ for i in 2 2 3 4 5 6 7 8 9 10; do
491 $ for i in 2 2 3 4 5 6 7 8 9 10; do
492 > echo $i >> plain
492 > echo $i >> plain
493 > done
493 > done
494 $ echo 2 >> plain2
494 $ echo 2 >> plain2
495
495
496 $ hg commit -i -d '10 0' -m begin-and-end plain plain2 <<EOF
496 $ hg commit -i -d '10 0' -m begin-and-end plain plain2 <<EOF
497 > y
497 > y
498 > y
498 > y
499 > y
499 > y
500 > y
500 > y
501 > y
501 > y
502 > EOF
502 > EOF
503 diff --git a/plain b/plain
503 diff --git a/plain b/plain
504 2 hunks, 3 lines changed
504 2 hunks, 3 lines changed
505 @@ -1,4 +1,4 @@
505 @@ -1,4 +1,4 @@
506 -1
506 -1
507 +2
507 +2
508 2
508 2
509 3
509 3
510 4
510 4
511 record change 1/3 to 'plain'?
511 record change 1/3 to 'plain'?
512 (enter ? for help) [Ynesfdaq?] y
512 (enter ? for help) [Ynesfdaq?] y
513
513
514 @@ -8,5 +8,3 @@ 7
514 @@ -8,5 +8,3 @@ 7
515 8
515 8
516 9
516 9
517 10
517 10
518 -11
518 -11
519 -7264f99c5f5ff3261504828afa4fb4d406c3af54
519 -7264f99c5f5ff3261504828afa4fb4d406c3af54
520 record change 2/3 to 'plain'?
520 record change 2/3 to 'plain'?
521 (enter ? for help) [Ynesfdaq?] y
521 (enter ? for help) [Ynesfdaq?] y
522
522
523 diff --git a/plain2 b/plain2
523 diff --git a/plain2 b/plain2
524 1 hunks, 1 lines changed
524 1 hunks, 1 lines changed
525 @@ -1,1 +1,2 @@
525 @@ -1,1 +1,2 @@
526 1
526 1
527 +2
527 +2
528 record change 3/3 to 'plain2'?
528 record change 3/3 to 'plain2'?
529 (enter ? for help) [Ynesfdaq?] y
529 (enter ? for help) [Ynesfdaq?] y
530
530
531
531
532 $ hg tip -p
532 $ hg tip -p
533 changeset: 13:f941910cff62
533 changeset: 13:f941910cff62
534 tag: tip
534 tag: tip
535 user: test
535 user: test
536 date: Thu Jan 01 00:00:10 1970 +0000
536 date: Thu Jan 01 00:00:10 1970 +0000
537 summary: begin-and-end
537 summary: begin-and-end
538
538
539 diff -r 33abe24d946c -r f941910cff62 plain
539 diff -r 33abe24d946c -r f941910cff62 plain
540 --- a/plain Thu Jan 01 00:00:10 1970 +0000
540 --- a/plain Thu Jan 01 00:00:10 1970 +0000
541 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
541 +++ b/plain Thu Jan 01 00:00:10 1970 +0000
542 @@ -1,4 +1,4 @@
542 @@ -1,4 +1,4 @@
543 -1
543 -1
544 +2
544 +2
545 2
545 2
546 3
546 3
547 4
547 4
548 @@ -8,5 +8,3 @@
548 @@ -8,5 +8,3 @@
549 8
549 8
550 9
550 9
551 10
551 10
552 -11
552 -11
553 -7264f99c5f5ff3261504828afa4fb4d406c3af54
553 -7264f99c5f5ff3261504828afa4fb4d406c3af54
554 diff -r 33abe24d946c -r f941910cff62 plain2
554 diff -r 33abe24d946c -r f941910cff62 plain2
555 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
555 --- a/plain2 Thu Jan 01 00:00:10 1970 +0000
556 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
556 +++ b/plain2 Thu Jan 01 00:00:10 1970 +0000
557 @@ -1,1 +1,2 @@
557 @@ -1,1 +1,2 @@
558 1
558 1
559 +2
559 +2
560
560
561
561
562 Trim beginning, modify end
562 Trim beginning, modify end
563
563
564 $ rm plain
564 $ rm plain
565 > for i in 4 5 6 7 8 9 10.new; do
565 > for i in 4 5 6 7 8 9 10.new; do
566 > echo $i >> plain
566 > echo $i >> plain
567 > done
567 > done
568
568
569 Record end
569 Record end
570
570
571 $ hg commit -i -d '11 0' -m end-only plain <<EOF
571 $ hg commit -i -d '11 0' -m end-only plain <<EOF
572 > n
572 > n
573 > y
573 > y
574 > EOF
574 > EOF
575 diff --git a/plain b/plain
575 diff --git a/plain b/plain
576 2 hunks, 4 lines changed
576 2 hunks, 4 lines changed
577 @@ -1,9 +1,6 @@
577 @@ -1,9 +1,6 @@
578 -2
578 -2
579 -2
579 -2
580 -3
580 -3
581 4
581 4
582 5
582 5
583 6
583 6
584 7
584 7
585 8
585 8
586 9
586 9
587 record change 1/2 to 'plain'?
587 record change 1/2 to 'plain'?
588 (enter ? for help) [Ynesfdaq?] n
588 (enter ? for help) [Ynesfdaq?] n
589
589
590 @@ -4,7 +1,7 @@
590 @@ -4,7 +1,7 @@
591 4
591 4
592 5
592 5
593 6
593 6
594 7
594 7
595 8
595 8
596 9
596 9
597 -10
597 -10
598 +10.new
598 +10.new
599 record change 2/2 to 'plain'?
599 record change 2/2 to 'plain'?
600 (enter ? for help) [Ynesfdaq?] y
600 (enter ? for help) [Ynesfdaq?] y
601
601
602
602
603 $ hg tip -p
603 $ hg tip -p
604 changeset: 14:4915f538659b
604 changeset: 14:4915f538659b
605 tag: tip
605 tag: tip
606 user: test
606 user: test
607 date: Thu Jan 01 00:00:11 1970 +0000
607 date: Thu Jan 01 00:00:11 1970 +0000
608 summary: end-only
608 summary: end-only
609
609
610 diff -r f941910cff62 -r 4915f538659b plain
610 diff -r f941910cff62 -r 4915f538659b plain
611 --- a/plain Thu Jan 01 00:00:10 1970 +0000
611 --- a/plain Thu Jan 01 00:00:10 1970 +0000
612 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
612 +++ b/plain Thu Jan 01 00:00:11 1970 +0000
613 @@ -7,4 +7,4 @@
613 @@ -7,4 +7,4 @@
614 7
614 7
615 8
615 8
616 9
616 9
617 -10
617 -10
618 +10.new
618 +10.new
619
619
620
620
621 Record beginning
621 Record beginning
622
622
623 $ hg commit -i -d '12 0' -m begin-only plain <<EOF
623 $ hg commit -i -d '12 0' -m begin-only plain <<EOF
624 > y
624 > y
625 > y
625 > y
626 > EOF
626 > EOF
627 diff --git a/plain b/plain
627 diff --git a/plain b/plain
628 1 hunks, 3 lines changed
628 1 hunks, 3 lines changed
629 @@ -1,6 +1,3 @@
629 @@ -1,6 +1,3 @@
630 -2
630 -2
631 -2
631 -2
632 -3
632 -3
633 4
633 4
634 5
634 5
635 6
635 6
636 record this change to 'plain'?
636 record this change to 'plain'?
637 (enter ? for help) [Ynesfdaq?] y
637 (enter ? for help) [Ynesfdaq?] y
638
638
639
639
640 $ hg tip -p
640 $ hg tip -p
641 changeset: 15:1b1f93d4b94b
641 changeset: 15:1b1f93d4b94b
642 tag: tip
642 tag: tip
643 user: test
643 user: test
644 date: Thu Jan 01 00:00:12 1970 +0000
644 date: Thu Jan 01 00:00:12 1970 +0000
645 summary: begin-only
645 summary: begin-only
646
646
647 diff -r 4915f538659b -r 1b1f93d4b94b plain
647 diff -r 4915f538659b -r 1b1f93d4b94b plain
648 --- a/plain Thu Jan 01 00:00:11 1970 +0000
648 --- a/plain Thu Jan 01 00:00:11 1970 +0000
649 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
649 +++ b/plain Thu Jan 01 00:00:12 1970 +0000
650 @@ -1,6 +1,3 @@
650 @@ -1,6 +1,3 @@
651 -2
651 -2
652 -2
652 -2
653 -3
653 -3
654 4
654 4
655 5
655 5
656 6
656 6
657
657
658
658
659 Add to beginning, trim from end
659 Add to beginning, trim from end
660
660
661 $ rm plain
661 $ rm plain
662 $ for i in 1 2 3 4 5 6 7 8 9; do
662 $ for i in 1 2 3 4 5 6 7 8 9; do
663 > echo $i >> plain
663 > echo $i >> plain
664 > done
664 > done
665
665
666 Record end
666 Record end
667
667
668 $ hg commit -i --traceback -d '13 0' -m end-again plain<<EOF
668 $ hg commit -i --traceback -d '13 0' -m end-again plain<<EOF
669 > n
669 > n
670 > y
670 > y
671 > EOF
671 > EOF
672 diff --git a/plain b/plain
672 diff --git a/plain b/plain
673 2 hunks, 4 lines changed
673 2 hunks, 4 lines changed
674 @@ -1,6 +1,9 @@
674 @@ -1,6 +1,9 @@
675 +1
675 +1
676 +2
676 +2
677 +3
677 +3
678 4
678 4
679 5
679 5
680 6
680 6
681 7
681 7
682 8
682 8
683 9
683 9
684 record change 1/2 to 'plain'?
684 record change 1/2 to 'plain'?
685 (enter ? for help) [Ynesfdaq?] n
685 (enter ? for help) [Ynesfdaq?] n
686
686
687 @@ -1,7 +4,6 @@
687 @@ -1,7 +4,6 @@
688 4
688 4
689 5
689 5
690 6
690 6
691 7
691 7
692 8
692 8
693 9
693 9
694 -10.new
694 -10.new
695 record change 2/2 to 'plain'?
695 record change 2/2 to 'plain'?
696 (enter ? for help) [Ynesfdaq?] y
696 (enter ? for help) [Ynesfdaq?] y
697
697
698
698
699 Add to beginning, middle, end
699 Add to beginning, middle, end
700
700
701 $ rm plain
701 $ rm plain
702 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
702 $ for i in 1 2 3 4 5 5.new 5.reallynew 6 7 8 9 10 11; do
703 > echo $i >> plain
703 > echo $i >> plain
704 > done
704 > done
705
705
706 Record beginning, middle, and test that format-breaking diffopts are ignored
706 Record beginning, middle, and test that format-breaking diffopts are ignored
707
707
708 $ hg commit -i --config diff.noprefix=True -d '14 0' -m middle-only plain <<EOF
708 $ hg commit -i --config diff.noprefix=True -d '14 0' -m middle-only plain <<EOF
709 > y
709 > y
710 > y
710 > y
711 > n
711 > n
712 > EOF
712 > EOF
713 diff --git a/plain b/plain
713 diff --git a/plain b/plain
714 3 hunks, 7 lines changed
714 3 hunks, 7 lines changed
715 @@ -1,2 +1,5 @@
715 @@ -1,2 +1,5 @@
716 +1
716 +1
717 +2
717 +2
718 +3
718 +3
719 4
719 4
720 5
720 5
721 record change 1/3 to 'plain'?
721 record change 1/3 to 'plain'?
722 (enter ? for help) [Ynesfdaq?] y
722 (enter ? for help) [Ynesfdaq?] y
723
723
724 @@ -1,6 +4,8 @@
724 @@ -1,6 +4,8 @@
725 4
725 4
726 5
726 5
727 +5.new
727 +5.new
728 +5.reallynew
728 +5.reallynew
729 6
729 6
730 7
730 7
731 8
731 8
732 9
732 9
733 record change 2/3 to 'plain'?
733 record change 2/3 to 'plain'?
734 (enter ? for help) [Ynesfdaq?] y
734 (enter ? for help) [Ynesfdaq?] y
735
735
736 @@ -3,4 +8,6 @@
736 @@ -3,4 +8,6 @@
737 6
737 6
738 7
738 7
739 8
739 8
740 9
740 9
741 +10
741 +10
742 +11
742 +11
743 record change 3/3 to 'plain'?
743 record change 3/3 to 'plain'?
744 (enter ? for help) [Ynesfdaq?] n
744 (enter ? for help) [Ynesfdaq?] n
745
745
746
746
747 $ hg tip -p
747 $ hg tip -p
748 changeset: 17:41cf3f5c55ae
748 changeset: 17:41cf3f5c55ae
749 tag: tip
749 tag: tip
750 user: test
750 user: test
751 date: Thu Jan 01 00:00:14 1970 +0000
751 date: Thu Jan 01 00:00:14 1970 +0000
752 summary: middle-only
752 summary: middle-only
753
753
754 diff -r a69d252246e1 -r 41cf3f5c55ae plain
754 diff -r a69d252246e1 -r 41cf3f5c55ae plain
755 --- a/plain Thu Jan 01 00:00:13 1970 +0000
755 --- a/plain Thu Jan 01 00:00:13 1970 +0000
756 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
756 +++ b/plain Thu Jan 01 00:00:14 1970 +0000
757 @@ -1,5 +1,10 @@
757 @@ -1,5 +1,10 @@
758 +1
758 +1
759 +2
759 +2
760 +3
760 +3
761 4
761 4
762 5
762 5
763 +5.new
763 +5.new
764 +5.reallynew
764 +5.reallynew
765 6
765 6
766 7
766 7
767 8
767 8
768
768
769
769
770 Record end
770 Record end
771
771
772 $ hg commit -i -d '15 0' -m end-only plain <<EOF
772 $ hg commit -i -d '15 0' -m end-only plain <<EOF
773 > y
773 > y
774 > y
774 > y
775 > EOF
775 > EOF
776 diff --git a/plain b/plain
776 diff --git a/plain b/plain
777 1 hunks, 2 lines changed
777 1 hunks, 2 lines changed
778 @@ -9,3 +9,5 @@ 6
778 @@ -9,3 +9,5 @@ 6
779 7
779 7
780 8
780 8
781 9
781 9
782 +10
782 +10
783 +11
783 +11
784 record this change to 'plain'?
784 record this change to 'plain'?
785 (enter ? for help) [Ynesfdaq?] y
785 (enter ? for help) [Ynesfdaq?] y
786
786
787
787
788 $ hg tip -p
788 $ hg tip -p
789 changeset: 18:58a72f46bc24
789 changeset: 18:58a72f46bc24
790 tag: tip
790 tag: tip
791 user: test
791 user: test
792 date: Thu Jan 01 00:00:15 1970 +0000
792 date: Thu Jan 01 00:00:15 1970 +0000
793 summary: end-only
793 summary: end-only
794
794
795 diff -r 41cf3f5c55ae -r 58a72f46bc24 plain
795 diff -r 41cf3f5c55ae -r 58a72f46bc24 plain
796 --- a/plain Thu Jan 01 00:00:14 1970 +0000
796 --- a/plain Thu Jan 01 00:00:14 1970 +0000
797 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
797 +++ b/plain Thu Jan 01 00:00:15 1970 +0000
798 @@ -9,3 +9,5 @@
798 @@ -9,3 +9,5 @@
799 7
799 7
800 8
800 8
801 9
801 9
802 +10
802 +10
803 +11
803 +11
804
804
805 Interactive commit can name a directory instead of files (issue6131)
805 Interactive commit can name a directory instead of files (issue6131)
806
806
807 $ mkdir subdir
807 $ mkdir subdir
808 $ echo a > subdir/a
808 $ echo a > subdir/a
809 $ hg ci -d '16 0' -i subdir -Amsubdir <<EOF
809 $ hg ci -d '16 0' -i subdir -Amsubdir <<EOF
810 > y
810 > y
811 > y
811 > y
812 > EOF
812 > EOF
813 adding subdir/a
813 adding subdir/a
814 diff --git a/subdir/a b/subdir/a
814 diff --git a/subdir/a b/subdir/a
815 new file mode 100644
815 new file mode 100644
816 examine changes to 'subdir/a'?
816 examine changes to 'subdir/a'?
817 (enter ? for help) [Ynesfdaq?] y
817 (enter ? for help) [Ynesfdaq?] y
818
818
819 @@ -0,0 +1,1 @@
819 @@ -0,0 +1,1 @@
820 +a
820 +a
821 record this change to 'subdir/a'?
821 record this change to 'subdir/a'?
822 (enter ? for help) [Ynesfdaq?] y
822 (enter ? for help) [Ynesfdaq?] y
823
823
824 $ cd subdir
824 $ cd subdir
825
825
826 $ echo a >> a
826 $ echo a >> a
827 $ hg commit -i -d '16 0' -m subdir-change a <<EOF
827 $ hg commit -i -d '16 0' -m subdir-change a <<EOF
828 > y
828 > y
829 > y
829 > y
830 > EOF
830 > EOF
831 diff --git a/subdir/a b/subdir/a
831 diff --git a/subdir/a b/subdir/a
832 1 hunks, 1 lines changed
832 1 hunks, 1 lines changed
833 @@ -1,1 +1,2 @@
833 @@ -1,1 +1,2 @@
834 a
834 a
835 +a
835 +a
836 record this change to 'subdir/a'?
836 record this change to 'subdir/a'?
837 (enter ? for help) [Ynesfdaq?] y
837 (enter ? for help) [Ynesfdaq?] y
838
838
839
839
840 $ hg tip -p
840 $ hg tip -p
841 changeset: 20:e0f6b99f6c49
841 changeset: 20:e0f6b99f6c49
842 tag: tip
842 tag: tip
843 user: test
843 user: test
844 date: Thu Jan 01 00:00:16 1970 +0000
844 date: Thu Jan 01 00:00:16 1970 +0000
845 summary: subdir-change
845 summary: subdir-change
846
846
847 diff -r abd26b51de37 -r e0f6b99f6c49 subdir/a
847 diff -r abd26b51de37 -r e0f6b99f6c49 subdir/a
848 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
848 --- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
849 +++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
849 +++ b/subdir/a Thu Jan 01 00:00:16 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 $ echo a > f1
855 $ echo a > f1
856 $ echo b > f2
856 $ echo b > f2
857 $ hg add f1 f2
857 $ hg add f1 f2
858
858
859 $ hg ci -mz -d '17 0'
859 $ hg ci -mz -d '17 0'
860
860
861 $ echo a >> f1
861 $ echo a >> f1
862 $ echo b >> f2
862 $ echo b >> f2
863
863
864 Help, quit
864 Help, quit
865
865
866 $ hg commit -i <<EOF
866 $ hg commit -i <<EOF
867 > ?
867 > ?
868 > q
868 > q
869 > EOF
869 > EOF
870 diff --git a/subdir/f1 b/subdir/f1
870 diff --git a/subdir/f1 b/subdir/f1
871 1 hunks, 1 lines changed
871 1 hunks, 1 lines changed
872 examine changes to 'subdir/f1'?
872 examine changes to 'subdir/f1'?
873 (enter ? for help) [Ynesfdaq?] ?
873 (enter ? for help) [Ynesfdaq?] ?
874
874
875 y - yes, record this change
875 y - yes, record this change
876 n - no, skip this change
876 n - no, skip this change
877 e - edit this change manually
877 e - edit this change manually
878 s - skip remaining changes to this file
878 s - skip remaining changes to this file
879 f - record remaining changes to this file
879 f - record remaining changes to this file
880 d - done, skip remaining changes and files
880 d - done, skip remaining changes and files
881 a - record all changes to all remaining files
881 a - record all changes to all remaining files
882 q - quit, recording no changes
882 q - quit, recording no changes
883 ? - ? (display help)
883 ? - ? (display help)
884 examine changes to 'subdir/f1'?
884 examine changes to 'subdir/f1'?
885 (enter ? for help) [Ynesfdaq?] q
885 (enter ? for help) [Ynesfdaq?] q
886
886
887 abort: user quit
887 abort: user quit
888 [255]
888 [255]
889
889
890 Patterns
890 Patterns
891
891
892 $ hg commit -i 'glob:f*' << EOF
892 $ hg commit -i 'glob:f*' << EOF
893 > y
893 > y
894 > n
894 > n
895 > y
895 > y
896 > n
896 > n
897 > EOF
897 > EOF
898 diff --git a/subdir/f1 b/subdir/f1
898 diff --git a/subdir/f1 b/subdir/f1
899 1 hunks, 1 lines changed
899 1 hunks, 1 lines changed
900 examine changes to 'subdir/f1'?
900 examine changes to 'subdir/f1'?
901 (enter ? for help) [Ynesfdaq?] y
901 (enter ? for help) [Ynesfdaq?] y
902
902
903 @@ -1,1 +1,2 @@
903 @@ -1,1 +1,2 @@
904 a
904 a
905 +a
905 +a
906 record change 1/2 to 'subdir/f1'?
906 record change 1/2 to 'subdir/f1'?
907 (enter ? for help) [Ynesfdaq?] n
907 (enter ? for help) [Ynesfdaq?] n
908
908
909 diff --git a/subdir/f2 b/subdir/f2
909 diff --git a/subdir/f2 b/subdir/f2
910 1 hunks, 1 lines changed
910 1 hunks, 1 lines changed
911 examine changes to 'subdir/f2'?
911 examine changes to 'subdir/f2'?
912 (enter ? for help) [Ynesfdaq?] y
912 (enter ? for help) [Ynesfdaq?] y
913
913
914 @@ -1,1 +1,2 @@
914 @@ -1,1 +1,2 @@
915 b
915 b
916 +b
916 +b
917 record change 2/2 to 'subdir/f2'?
917 record change 2/2 to 'subdir/f2'?
918 (enter ? for help) [Ynesfdaq?] n
918 (enter ? for help) [Ynesfdaq?] n
919
919
920 no changes to record
920 no changes to record
921 [1]
921 [1]
922
922
923 #if gettext
923 #if gettext
924
924
925 Test translated help message
925 Test translated help message
926
926
927 str.lower() instead of encoding.lower(str) on translated message might
927 str.lower() instead of encoding.lower(str) on translated message might
928 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
928 make message meaningless, because some encoding uses 0x41(A) - 0x5a(Z)
929 as the second or later byte of multi-byte character.
929 as the second or later byte of multi-byte character.
930
930
931 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
931 For example, "\x8bL\x98^" (translation of "record" in ja_JP.cp932)
932 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
932 contains 0x4c (L). str.lower() replaces 0x4c(L) by 0x6c(l) and this
933 replacement makes message meaningless.
933 replacement makes message meaningless.
934
934
935 This tests that translated help message is lower()-ed correctly.
935 This tests that translated help message is lower()-ed correctly.
936
936
937 $ LANGUAGE=ja
937 $ LANGUAGE=ja
938 $ export LANGUAGE
938 $ export LANGUAGE
939
939
940 $ cat > $TESTTMP/escape.py <<EOF
940 $ cat > $TESTTMP/escape.py <<EOF
941 > from __future__ import absolute_import
941 > from __future__ import absolute_import
942 > from mercurial import (
942 > from mercurial import (
943 > pycompat,
943 > pycompat,
944 > )
944 > )
945 > from mercurial.utils import (
945 > from mercurial.utils import (
946 > procutil,
946 > procutil,
947 > )
947 > )
948 > def escape(c):
948 > def escape(c):
949 > o = ord(c)
949 > o = ord(c)
950 > if o < 0x80:
950 > if o < 0x80:
951 > return c
951 > return c
952 > else:
952 > else:
953 > return br'\x%02x' % o # escape char setting MSB
953 > return br'\x%02x' % o # escape char setting MSB
954 > for l in procutil.stdin:
954 > for l in procutil.stdin:
955 > procutil.stdout.write(
955 > procutil.stdout.write(
956 > b''.join(escape(c) for c in pycompat.iterbytestr(l)))
956 > b''.join(escape(c) for c in pycompat.iterbytestr(l)))
957 > EOF
957 > EOF
958
958
959 $ hg commit -i --encoding cp932 2>&1 <<EOF | "$PYTHON" $TESTTMP/escape.py | grep '^y - '
959 $ hg commit -i --encoding cp932 2>&1 <<EOF | "$PYTHON" $TESTTMP/escape.py | grep '^y - '
960 > ?
960 > ?
961 > q
961 > q
962 > EOF
962 > EOF
963 y - \x82\xb1\x82\xcc\x95\xcf\x8dX\x82\xf0\x8bL\x98^(yes)
963 y - \x82\xb1\x82\xcc\x95\xcf\x8dX\x82\xf0\x8bL\x98^(yes)
964
964
965 $ LANGUAGE=
965 $ LANGUAGE=
966 #endif
966 #endif
967
967
968 Skip
968 Skip
969
969
970 $ hg commit -i <<EOF
970 $ hg commit -i <<EOF
971 > s
971 > s
972 > EOF
972 > EOF
973 diff --git a/subdir/f1 b/subdir/f1
973 diff --git a/subdir/f1 b/subdir/f1
974 1 hunks, 1 lines changed
974 1 hunks, 1 lines changed
975 examine changes to 'subdir/f1'?
975 examine changes to 'subdir/f1'?
976 (enter ? for help) [Ynesfdaq?] s
976 (enter ? for help) [Ynesfdaq?] s
977
977
978 diff --git a/subdir/f2 b/subdir/f2
978 diff --git a/subdir/f2 b/subdir/f2
979 1 hunks, 1 lines changed
979 1 hunks, 1 lines changed
980 examine changes to 'subdir/f2'?
980 examine changes to 'subdir/f2'?
981 (enter ? for help) [Ynesfdaq?] abort: response expected
981 (enter ? for help) [Ynesfdaq?] abort: response expected
982 [255]
982 [255]
983
983
984 No
984 No
985
985
986 $ hg commit -i <<EOF
986 $ hg commit -i <<EOF
987 > n
987 > n
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'?
991 examine changes to 'subdir/f1'?
992 (enter ? for help) [Ynesfdaq?] n
992 (enter ? for help) [Ynesfdaq?] n
993
993
994 diff --git a/subdir/f2 b/subdir/f2
994 diff --git a/subdir/f2 b/subdir/f2
995 1 hunks, 1 lines changed
995 1 hunks, 1 lines changed
996 examine changes to 'subdir/f2'?
996 examine changes to 'subdir/f2'?
997 (enter ? for help) [Ynesfdaq?] abort: response expected
997 (enter ? for help) [Ynesfdaq?] abort: response expected
998 [255]
998 [255]
999
999
1000 f, quit
1000 f, quit
1001
1001
1002 $ hg commit -i <<EOF
1002 $ hg commit -i <<EOF
1003 > f
1003 > f
1004 > q
1004 > q
1005 > EOF
1005 > EOF
1006 diff --git a/subdir/f1 b/subdir/f1
1006 diff --git a/subdir/f1 b/subdir/f1
1007 1 hunks, 1 lines changed
1007 1 hunks, 1 lines changed
1008 examine changes to 'subdir/f1'?
1008 examine changes to 'subdir/f1'?
1009 (enter ? for help) [Ynesfdaq?] f
1009 (enter ? for help) [Ynesfdaq?] f
1010
1010
1011 diff --git a/subdir/f2 b/subdir/f2
1011 diff --git a/subdir/f2 b/subdir/f2
1012 1 hunks, 1 lines changed
1012 1 hunks, 1 lines changed
1013 examine changes to 'subdir/f2'?
1013 examine changes to 'subdir/f2'?
1014 (enter ? for help) [Ynesfdaq?] q
1014 (enter ? for help) [Ynesfdaq?] q
1015
1015
1016 abort: user quit
1016 abort: user quit
1017 [255]
1017 [255]
1018
1018
1019 s, all
1019 s, all
1020
1020
1021 $ hg commit -i -d '18 0' -mx <<EOF
1021 $ hg commit -i -d '18 0' -mx <<EOF
1022 > s
1022 > s
1023 > a
1023 > a
1024 > EOF
1024 > EOF
1025 diff --git a/subdir/f1 b/subdir/f1
1025 diff --git a/subdir/f1 b/subdir/f1
1026 1 hunks, 1 lines changed
1026 1 hunks, 1 lines changed
1027 examine changes to 'subdir/f1'?
1027 examine changes to 'subdir/f1'?
1028 (enter ? for help) [Ynesfdaq?] s
1028 (enter ? for help) [Ynesfdaq?] s
1029
1029
1030 diff --git a/subdir/f2 b/subdir/f2
1030 diff --git a/subdir/f2 b/subdir/f2
1031 1 hunks, 1 lines changed
1031 1 hunks, 1 lines changed
1032 examine changes to 'subdir/f2'?
1032 examine changes to 'subdir/f2'?
1033 (enter ? for help) [Ynesfdaq?] a
1033 (enter ? for help) [Ynesfdaq?] a
1034
1034
1035
1035
1036 $ hg tip -p
1036 $ hg tip -p
1037 changeset: 22:6afbbefacf35
1037 changeset: 22:6afbbefacf35
1038 tag: tip
1038 tag: tip
1039 user: test
1039 user: test
1040 date: Thu Jan 01 00:00:18 1970 +0000
1040 date: Thu Jan 01 00:00:18 1970 +0000
1041 summary: x
1041 summary: x
1042
1042
1043 diff -r b73c401c693c -r 6afbbefacf35 subdir/f2
1043 diff -r b73c401c693c -r 6afbbefacf35 subdir/f2
1044 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
1044 --- a/subdir/f2 Thu Jan 01 00:00:17 1970 +0000
1045 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
1045 +++ b/subdir/f2 Thu Jan 01 00:00:18 1970 +0000
1046 @@ -1,1 +1,2 @@
1046 @@ -1,1 +1,2 @@
1047 b
1047 b
1048 +b
1048 +b
1049
1049
1050
1050
1051 f
1051 f
1052
1052
1053 $ hg commit -i -d '19 0' -my <<EOF
1053 $ hg commit -i -d '19 0' -my <<EOF
1054 > f
1054 > f
1055 > EOF
1055 > EOF
1056 diff --git a/subdir/f1 b/subdir/f1
1056 diff --git a/subdir/f1 b/subdir/f1
1057 1 hunks, 1 lines changed
1057 1 hunks, 1 lines changed
1058 examine changes to 'subdir/f1'?
1058 examine changes to 'subdir/f1'?
1059 (enter ? for help) [Ynesfdaq?] f
1059 (enter ? for help) [Ynesfdaq?] f
1060
1060
1061
1061
1062 $ hg tip -p
1062 $ hg tip -p
1063 changeset: 23:715028a33949
1063 changeset: 23:715028a33949
1064 tag: tip
1064 tag: tip
1065 user: test
1065 user: test
1066 date: Thu Jan 01 00:00:19 1970 +0000
1066 date: Thu Jan 01 00:00:19 1970 +0000
1067 summary: y
1067 summary: y
1068
1068
1069 diff -r 6afbbefacf35 -r 715028a33949 subdir/f1
1069 diff -r 6afbbefacf35 -r 715028a33949 subdir/f1
1070 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
1070 --- a/subdir/f1 Thu Jan 01 00:00:18 1970 +0000
1071 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
1071 +++ b/subdir/f1 Thu Jan 01 00:00:19 1970 +0000
1072 @@ -1,1 +1,2 @@
1072 @@ -1,1 +1,2 @@
1073 a
1073 a
1074 +a
1074 +a
1075
1075
1076
1076
1077 #if execbit
1077 #if execbit
1078
1078
1079 Preserve chmod +x
1079 Preserve chmod +x
1080
1080
1081 $ chmod +x f1
1081 $ chmod +x f1
1082 $ echo a >> f1
1082 $ echo a >> f1
1083 $ hg commit -i -d '20 0' -mz <<EOF
1083 $ hg commit -i -d '20 0' -mz <<EOF
1084 > y
1084 > y
1085 > y
1085 > y
1086 > y
1086 > y
1087 > EOF
1087 > EOF
1088 diff --git a/subdir/f1 b/subdir/f1
1088 diff --git a/subdir/f1 b/subdir/f1
1089 old mode 100644
1089 old mode 100644
1090 new mode 100755
1090 new mode 100755
1091 1 hunks, 1 lines changed
1091 1 hunks, 1 lines changed
1092 examine changes to 'subdir/f1'?
1092 examine changes to 'subdir/f1'?
1093 (enter ? for help) [Ynesfdaq?] y
1093 (enter ? for help) [Ynesfdaq?] y
1094
1094
1095 @@ -1,2 +1,3 @@
1095 @@ -1,2 +1,3 @@
1096 a
1096 a
1097 a
1097 a
1098 +a
1098 +a
1099 record this change to 'subdir/f1'?
1099 record this change to 'subdir/f1'?
1100 (enter ? for help) [Ynesfdaq?] y
1100 (enter ? for help) [Ynesfdaq?] y
1101
1101
1102
1102
1103 $ hg tip --config diff.git=True -p
1103 $ hg tip --config diff.git=True -p
1104 changeset: 24:db967c1e5884
1104 changeset: 24:db967c1e5884
1105 tag: tip
1105 tag: tip
1106 user: test
1106 user: test
1107 date: Thu Jan 01 00:00:20 1970 +0000
1107 date: Thu Jan 01 00:00:20 1970 +0000
1108 summary: z
1108 summary: z
1109
1109
1110 diff --git a/subdir/f1 b/subdir/f1
1110 diff --git a/subdir/f1 b/subdir/f1
1111 old mode 100644
1111 old mode 100644
1112 new mode 100755
1112 new mode 100755
1113 --- a/subdir/f1
1113 --- a/subdir/f1
1114 +++ b/subdir/f1
1114 +++ b/subdir/f1
1115 @@ -1,2 +1,3 @@
1115 @@ -1,2 +1,3 @@
1116 a
1116 a
1117 a
1117 a
1118 +a
1118 +a
1119
1119
1120
1120
1121 Preserve execute permission on original
1121 Preserve execute permission on original
1122
1122
1123 $ echo b >> f1
1123 $ echo b >> f1
1124 $ hg commit -i -d '21 0' -maa <<EOF
1124 $ hg commit -i -d '21 0' -maa <<EOF
1125 > y
1125 > y
1126 > y
1126 > y
1127 > y
1127 > y
1128 > EOF
1128 > EOF
1129 diff --git a/subdir/f1 b/subdir/f1
1129 diff --git a/subdir/f1 b/subdir/f1
1130 1 hunks, 1 lines changed
1130 1 hunks, 1 lines changed
1131 examine changes to 'subdir/f1'?
1131 examine changes to 'subdir/f1'?
1132 (enter ? for help) [Ynesfdaq?] y
1132 (enter ? for help) [Ynesfdaq?] y
1133
1133
1134 @@ -1,3 +1,4 @@
1134 @@ -1,3 +1,4 @@
1135 a
1135 a
1136 a
1136 a
1137 a
1137 a
1138 +b
1138 +b
1139 record this change to 'subdir/f1'?
1139 record this change to 'subdir/f1'?
1140 (enter ? for help) [Ynesfdaq?] y
1140 (enter ? for help) [Ynesfdaq?] y
1141
1141
1142
1142
1143 $ hg tip --config diff.git=True -p
1143 $ hg tip --config diff.git=True -p
1144 changeset: 25:88903aef81c3
1144 changeset: 25:88903aef81c3
1145 tag: tip
1145 tag: tip
1146 user: test
1146 user: test
1147 date: Thu Jan 01 00:00:21 1970 +0000
1147 date: Thu Jan 01 00:00:21 1970 +0000
1148 summary: aa
1148 summary: aa
1149
1149
1150 diff --git a/subdir/f1 b/subdir/f1
1150 diff --git a/subdir/f1 b/subdir/f1
1151 --- a/subdir/f1
1151 --- a/subdir/f1
1152 +++ b/subdir/f1
1152 +++ b/subdir/f1
1153 @@ -1,3 +1,4 @@
1153 @@ -1,3 +1,4 @@
1154 a
1154 a
1155 a
1155 a
1156 a
1156 a
1157 +b
1157 +b
1158
1158
1159
1159
1160 Preserve chmod -x
1160 Preserve chmod -x
1161
1161
1162 $ chmod -x f1
1162 $ chmod -x f1
1163 $ echo c >> f1
1163 $ echo c >> f1
1164 $ hg commit -i -d '22 0' -mab <<EOF
1164 $ hg commit -i -d '22 0' -mab <<EOF
1165 > y
1165 > y
1166 > y
1166 > y
1167 > y
1167 > y
1168 > EOF
1168 > EOF
1169 diff --git a/subdir/f1 b/subdir/f1
1169 diff --git a/subdir/f1 b/subdir/f1
1170 old mode 100755
1170 old mode 100755
1171 new mode 100644
1171 new mode 100644
1172 1 hunks, 1 lines changed
1172 1 hunks, 1 lines changed
1173 examine changes to 'subdir/f1'?
1173 examine changes to 'subdir/f1'?
1174 (enter ? for help) [Ynesfdaq?] y
1174 (enter ? for help) [Ynesfdaq?] y
1175
1175
1176 @@ -2,3 +2,4 @@ a
1176 @@ -2,3 +2,4 @@ a
1177 a
1177 a
1178 a
1178 a
1179 b
1179 b
1180 +c
1180 +c
1181 record this change to 'subdir/f1'?
1181 record this change to 'subdir/f1'?
1182 (enter ? for help) [Ynesfdaq?] y
1182 (enter ? for help) [Ynesfdaq?] y
1183
1183
1184
1184
1185 $ hg tip --config diff.git=True -p
1185 $ hg tip --config diff.git=True -p
1186 changeset: 26:7af84b6cf560
1186 changeset: 26:7af84b6cf560
1187 tag: tip
1187 tag: tip
1188 user: test
1188 user: test
1189 date: Thu Jan 01 00:00:22 1970 +0000
1189 date: Thu Jan 01 00:00:22 1970 +0000
1190 summary: ab
1190 summary: ab
1191
1191
1192 diff --git a/subdir/f1 b/subdir/f1
1192 diff --git a/subdir/f1 b/subdir/f1
1193 old mode 100755
1193 old mode 100755
1194 new mode 100644
1194 new mode 100644
1195 --- a/subdir/f1
1195 --- a/subdir/f1
1196 +++ b/subdir/f1
1196 +++ b/subdir/f1
1197 @@ -2,3 +2,4 @@
1197 @@ -2,3 +2,4 @@
1198 a
1198 a
1199 a
1199 a
1200 b
1200 b
1201 +c
1201 +c
1202
1202
1203
1203
1204 #else
1204 #else
1205
1205
1206 Slightly bogus tests to get almost same repo structure as when x bit is used
1206 Slightly bogus tests to get almost same repo structure as when x bit is used
1207 - but with different hashes.
1207 - but with different hashes.
1208
1208
1209 Mock "Preserve chmod +x"
1209 Mock "Preserve chmod +x"
1210
1210
1211 $ echo a >> f1
1211 $ echo a >> f1
1212 $ hg commit -i -d '20 0' -mz <<EOF
1212 $ hg commit -i -d '20 0' -mz <<EOF
1213 > y
1213 > y
1214 > y
1214 > y
1215 > y
1215 > y
1216 > EOF
1216 > EOF
1217 diff --git a/subdir/f1 b/subdir/f1
1217 diff --git a/subdir/f1 b/subdir/f1
1218 1 hunks, 1 lines changed
1218 1 hunks, 1 lines changed
1219 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1219 examine changes to 'subdir/f1'?
1220 (enter ? for help) [Ynesfdaq?] y
1220
1221
1221 @@ -1,2 +1,3 @@
1222 @@ -1,2 +1,3 @@
1222 a
1223 a
1223 a
1224 a
1224 +a
1225 +a
1225 record this change to 'subdir/f1'? [Ynesfdaq?] y
1226 record this change to 'subdir/f1'?
1227 (enter ? for help) [Ynesfdaq?] y
1226
1228
1227
1229
1228 $ hg tip --config diff.git=True -p
1230 $ hg tip --config diff.git=True -p
1229 changeset: 24:c26cfe2c4eb0
1231 changeset: 24:c26cfe2c4eb0
1230 tag: tip
1232 tag: tip
1231 user: test
1233 user: test
1232 date: Thu Jan 01 00:00:20 1970 +0000
1234 date: Thu Jan 01 00:00:20 1970 +0000
1233 summary: z
1235 summary: z
1234
1236
1235 diff --git a/subdir/f1 b/subdir/f1
1237 diff --git a/subdir/f1 b/subdir/f1
1236 --- a/subdir/f1
1238 --- a/subdir/f1
1237 +++ b/subdir/f1
1239 +++ b/subdir/f1
1238 @@ -1,2 +1,3 @@
1240 @@ -1,2 +1,3 @@
1239 a
1241 a
1240 a
1242 a
1241 +a
1243 +a
1242
1244
1243
1245
1244 Mock "Preserve execute permission on original"
1246 Mock "Preserve execute permission on original"
1245
1247
1246 $ echo b >> f1
1248 $ echo b >> f1
1247 $ hg commit -i -d '21 0' -maa <<EOF
1249 $ hg commit -i -d '21 0' -maa <<EOF
1248 > y
1250 > y
1249 > y
1251 > y
1250 > y
1252 > y
1251 > EOF
1253 > EOF
1252 diff --git a/subdir/f1 b/subdir/f1
1254 diff --git a/subdir/f1 b/subdir/f1
1253 1 hunks, 1 lines changed
1255 1 hunks, 1 lines changed
1254 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1256 examine changes to 'subdir/f1'?
1257 (enter ? for help) [Ynesfdaq?] y
1255
1258
1256 @@ -1,3 +1,4 @@
1259 @@ -1,3 +1,4 @@
1257 a
1260 a
1258 a
1261 a
1259 a
1262 a
1260 +b
1263 +b
1261 record this change to 'subdir/f1'? [Ynesfdaq?] y
1264 record this change to 'subdir/f1'?
1265 (enter ? for help) [Ynesfdaq?] y
1262
1266
1263
1267
1264 $ hg tip --config diff.git=True -p
1268 $ hg tip --config diff.git=True -p
1265 changeset: 25:a48d2d60adde
1269 changeset: 25:a48d2d60adde
1266 tag: tip
1270 tag: tip
1267 user: test
1271 user: test
1268 date: Thu Jan 01 00:00:21 1970 +0000
1272 date: Thu Jan 01 00:00:21 1970 +0000
1269 summary: aa
1273 summary: aa
1270
1274
1271 diff --git a/subdir/f1 b/subdir/f1
1275 diff --git a/subdir/f1 b/subdir/f1
1272 --- a/subdir/f1
1276 --- a/subdir/f1
1273 +++ b/subdir/f1
1277 +++ b/subdir/f1
1274 @@ -1,3 +1,4 @@
1278 @@ -1,3 +1,4 @@
1275 a
1279 a
1276 a
1280 a
1277 a
1281 a
1278 +b
1282 +b
1279
1283
1280
1284
1281 Mock "Preserve chmod -x"
1285 Mock "Preserve chmod -x"
1282
1286
1283 $ chmod -x f1
1287 $ chmod -x f1
1284 $ echo c >> f1
1288 $ echo c >> f1
1285 $ hg commit -i -d '22 0' -mab <<EOF
1289 $ hg commit -i -d '22 0' -mab <<EOF
1286 > y
1290 > y
1287 > y
1291 > y
1288 > y
1292 > y
1289 > EOF
1293 > EOF
1290 diff --git a/subdir/f1 b/subdir/f1
1294 diff --git a/subdir/f1 b/subdir/f1
1291 1 hunks, 1 lines changed
1295 1 hunks, 1 lines changed
1292 examine changes to 'subdir/f1'? [Ynesfdaq?] y
1296 examine changes to 'subdir/f1'?
1297 (enter ? for help) [Ynesfdaq?] y
1293
1298
1294 @@ -2,3 +2,4 @@ a
1299 @@ -2,3 +2,4 @@ a
1295 a
1300 a
1296 a
1301 a
1297 b
1302 b
1298 +c
1303 +c
1299 record this change to 'subdir/f1'? [Ynesfdaq?] y
1304 record this change to 'subdir/f1'?
1305 (enter ? for help) [Ynesfdaq?] y
1300
1306
1301
1307
1302 $ hg tip --config diff.git=True -p
1308 $ hg tip --config diff.git=True -p
1303 changeset: 26:5cc89ae210fa
1309 changeset: 26:5cc89ae210fa
1304 tag: tip
1310 tag: tip
1305 user: test
1311 user: test
1306 date: Thu Jan 01 00:00:22 1970 +0000
1312 date: Thu Jan 01 00:00:22 1970 +0000
1307 summary: ab
1313 summary: ab
1308
1314
1309 diff --git a/subdir/f1 b/subdir/f1
1315 diff --git a/subdir/f1 b/subdir/f1
1310 --- a/subdir/f1
1316 --- a/subdir/f1
1311 +++ b/subdir/f1
1317 +++ b/subdir/f1
1312 @@ -2,3 +2,4 @@
1318 @@ -2,3 +2,4 @@
1313 a
1319 a
1314 a
1320 a
1315 b
1321 b
1316 +c
1322 +c
1317
1323
1318
1324
1319 #endif
1325 #endif
1320
1326
1321 $ cd ..
1327 $ cd ..
1322
1328
1323
1329
1324 Abort early when a merge is in progress
1330 Abort early when a merge is in progress
1325
1331
1326 $ hg up 4
1332 $ hg up 4
1327 1 files updated, 0 files merged, 7 files removed, 0 files unresolved
1333 1 files updated, 0 files merged, 7 files removed, 0 files unresolved
1328
1334
1329 $ touch iwillmergethat
1335 $ touch iwillmergethat
1330 $ hg add iwillmergethat
1336 $ hg add iwillmergethat
1331
1337
1332 $ hg branch thatbranch
1338 $ hg branch thatbranch
1333 marked working directory as branch thatbranch
1339 marked working directory as branch thatbranch
1334 (branches are permanent and global, did you want a bookmark?)
1340 (branches are permanent and global, did you want a bookmark?)
1335
1341
1336 $ hg ci -m'new head'
1342 $ hg ci -m'new head'
1337
1343
1338 $ hg up default
1344 $ hg up default
1339 7 files updated, 0 files merged, 2 files removed, 0 files unresolved
1345 7 files updated, 0 files merged, 2 files removed, 0 files unresolved
1340
1346
1341 $ hg merge thatbranch
1347 $ hg merge thatbranch
1342 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1348 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1343 (branch merge, don't forget to commit)
1349 (branch merge, don't forget to commit)
1344
1350
1345 $ hg commit -i -m'will abort'
1351 $ hg commit -i -m'will abort'
1346 abort: cannot partially commit a merge (use "hg commit" instead)
1352 abort: cannot partially commit a merge (use "hg commit" instead)
1347 [255]
1353 [255]
1348
1354
1349 $ hg up -C
1355 $ hg up -C
1350 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1356 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1351
1357
1352 Editing patch (and ignoring trailing text)
1358 Editing patch (and ignoring trailing text)
1353
1359
1354 $ cat > editor.sh << '__EOF__'
1360 $ cat > editor.sh << '__EOF__'
1355 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1361 > sed -e 7d -e '5s/^-/ /' -e '/^# ---/i\
1356 > trailing\nditto' "$1" > tmp
1362 > trailing\nditto' "$1" > tmp
1357 > mv tmp "$1"
1363 > mv tmp "$1"
1358 > __EOF__
1364 > __EOF__
1359 $ cat > editedfile << '__EOF__'
1365 $ cat > editedfile << '__EOF__'
1360 > This is the first line
1366 > This is the first line
1361 > This is the second line
1367 > This is the second line
1362 > This is the third line
1368 > This is the third line
1363 > __EOF__
1369 > __EOF__
1364 $ hg add editedfile
1370 $ hg add editedfile
1365 $ hg commit -medit-patch-1
1371 $ hg commit -medit-patch-1
1366 $ cat > editedfile << '__EOF__'
1372 $ cat > editedfile << '__EOF__'
1367 > This line has changed
1373 > This line has changed
1368 > This change will be committed
1374 > This change will be committed
1369 > This is the third line
1375 > This is the third line
1370 > __EOF__
1376 > __EOF__
1371 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-2 <<EOF
1377 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-2 <<EOF
1372 > y
1378 > y
1373 > e
1379 > e
1374 > EOF
1380 > EOF
1375 diff --git a/editedfile b/editedfile
1381 diff --git a/editedfile b/editedfile
1376 1 hunks, 2 lines changed
1382 1 hunks, 2 lines changed
1377 examine changes to 'editedfile'?
1383 examine changes to 'editedfile'?
1378 (enter ? for help) [Ynesfdaq?] y
1384 (enter ? for help) [Ynesfdaq?] y
1379
1385
1380 @@ -1,3 +1,3 @@
1386 @@ -1,3 +1,3 @@
1381 -This is the first line
1387 -This is the first line
1382 -This is the second line
1388 -This is the second line
1383 +This line has changed
1389 +This line has changed
1384 +This change will be committed
1390 +This change will be committed
1385 This is the third line
1391 This is the third line
1386 record this change to 'editedfile'?
1392 record this change to 'editedfile'?
1387 (enter ? for help) [Ynesfdaq?] e
1393 (enter ? for help) [Ynesfdaq?] e
1388
1394
1389 $ cat editedfile
1395 $ cat editedfile
1390 This line has changed
1396 This line has changed
1391 This change will be committed
1397 This change will be committed
1392 This is the third line
1398 This is the third line
1393 $ hg cat -r tip editedfile
1399 $ hg cat -r tip editedfile
1394 This is the first line
1400 This is the first line
1395 This change will be committed
1401 This change will be committed
1396 This is the third line
1402 This is the third line
1397 $ hg revert editedfile
1403 $ hg revert editedfile
1398
1404
1399 Trying to edit patch for whole file
1405 Trying to edit patch for whole file
1400
1406
1401 $ echo "This is the fourth line" >> editedfile
1407 $ echo "This is the fourth line" >> editedfile
1402 $ hg commit -i <<EOF
1408 $ hg commit -i <<EOF
1403 > e
1409 > e
1404 > q
1410 > q
1405 > EOF
1411 > EOF
1406 diff --git a/editedfile b/editedfile
1412 diff --git a/editedfile b/editedfile
1407 1 hunks, 1 lines changed
1413 1 hunks, 1 lines changed
1408 examine changes to 'editedfile'?
1414 examine changes to 'editedfile'?
1409 (enter ? for help) [Ynesfdaq?] e
1415 (enter ? for help) [Ynesfdaq?] e
1410
1416
1411 cannot edit patch for whole file
1417 cannot edit patch for whole file
1412 examine changes to 'editedfile'?
1418 examine changes to 'editedfile'?
1413 (enter ? for help) [Ynesfdaq?] q
1419 (enter ? for help) [Ynesfdaq?] q
1414
1420
1415 abort: user quit
1421 abort: user quit
1416 [255]
1422 [255]
1417 $ hg revert editedfile
1423 $ hg revert editedfile
1418
1424
1419 Removing changes from patch
1425 Removing changes from patch
1420
1426
1421 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1427 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1422 $ mv tmp editedfile
1428 $ mv tmp editedfile
1423 $ echo "This line has been added" >> editedfile
1429 $ echo "This line has been added" >> editedfile
1424 $ cat > editor.sh << '__EOF__'
1430 $ cat > editor.sh << '__EOF__'
1425 > sed -e 's/^[-+]/ /' "$1" > tmp
1431 > sed -e 's/^[-+]/ /' "$1" > tmp
1426 > mv tmp "$1"
1432 > mv tmp "$1"
1427 > __EOF__
1433 > __EOF__
1428 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1434 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1429 > y
1435 > y
1430 > e
1436 > e
1431 > EOF
1437 > EOF
1432 diff --git a/editedfile b/editedfile
1438 diff --git a/editedfile b/editedfile
1433 1 hunks, 3 lines changed
1439 1 hunks, 3 lines changed
1434 examine changes to 'editedfile'?
1440 examine changes to 'editedfile'?
1435 (enter ? for help) [Ynesfdaq?] y
1441 (enter ? for help) [Ynesfdaq?] y
1436
1442
1437 @@ -1,3 +1,3 @@
1443 @@ -1,3 +1,3 @@
1438 -This is the first line
1444 -This is the first line
1439 -This change will be committed
1445 -This change will be committed
1440 -This is the third line
1446 -This is the third line
1441 +This change will not be committed
1447 +This change will not be committed
1442 +This is the second line
1448 +This is the second line
1443 +This line has been added
1449 +This line has been added
1444 record this change to 'editedfile'?
1450 record this change to 'editedfile'?
1445 (enter ? for help) [Ynesfdaq?] e
1451 (enter ? for help) [Ynesfdaq?] e
1446
1452
1447 no changes to record
1453 no changes to record
1448 [1]
1454 [1]
1449 $ cat editedfile
1455 $ cat editedfile
1450 This change will not be committed
1456 This change will not be committed
1451 This is the second line
1457 This is the second line
1452 This line has been added
1458 This line has been added
1453 $ hg cat -r tip editedfile
1459 $ hg cat -r tip editedfile
1454 This is the first line
1460 This is the first line
1455 This change will be committed
1461 This change will be committed
1456 This is the third line
1462 This is the third line
1457 $ hg revert editedfile
1463 $ hg revert editedfile
1458
1464
1459 Invalid patch
1465 Invalid patch
1460
1466
1461 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1467 $ sed -e '3s/third/second/' -e '2s/will/will not/' -e 1d editedfile > tmp
1462 $ mv tmp editedfile
1468 $ mv tmp editedfile
1463 $ echo "This line has been added" >> editedfile
1469 $ echo "This line has been added" >> editedfile
1464 $ cat > editor.sh << '__EOF__'
1470 $ cat > editor.sh << '__EOF__'
1465 > sed s/This/That/ "$1" > tmp
1471 > sed s/This/That/ "$1" > tmp
1466 > mv tmp "$1"
1472 > mv tmp "$1"
1467 > __EOF__
1473 > __EOF__
1468 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1474 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1469 > y
1475 > y
1470 > e
1476 > e
1471 > EOF
1477 > EOF
1472 diff --git a/editedfile b/editedfile
1478 diff --git a/editedfile b/editedfile
1473 1 hunks, 3 lines changed
1479 1 hunks, 3 lines changed
1474 examine changes to 'editedfile'?
1480 examine changes to 'editedfile'?
1475 (enter ? for help) [Ynesfdaq?] y
1481 (enter ? for help) [Ynesfdaq?] y
1476
1482
1477 @@ -1,3 +1,3 @@
1483 @@ -1,3 +1,3 @@
1478 -This is the first line
1484 -This is the first line
1479 -This change will be committed
1485 -This change will be committed
1480 -This is the third line
1486 -This is the third line
1481 +This change will not be committed
1487 +This change will not be committed
1482 +This is the second line
1488 +This is the second line
1483 +This line has been added
1489 +This line has been added
1484 record this change to 'editedfile'?
1490 record this change to 'editedfile'?
1485 (enter ? for help) [Ynesfdaq?] e
1491 (enter ? for help) [Ynesfdaq?] e
1486
1492
1487 patching file editedfile
1493 patching file editedfile
1488 Hunk #1 FAILED at 0
1494 Hunk #1 FAILED at 0
1489 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1495 1 out of 1 hunks FAILED -- saving rejects to file editedfile.rej
1490 abort: patch failed to apply
1496 abort: patch failed to apply
1491 [255]
1497 [255]
1492 $ cat editedfile
1498 $ cat editedfile
1493 This change will not be committed
1499 This change will not be committed
1494 This is the second line
1500 This is the second line
1495 This line has been added
1501 This line has been added
1496 $ hg cat -r tip editedfile
1502 $ hg cat -r tip editedfile
1497 This is the first line
1503 This is the first line
1498 This change will be committed
1504 This change will be committed
1499 This is the third line
1505 This is the third line
1500 $ cat editedfile.rej
1506 $ cat editedfile.rej
1501 --- editedfile
1507 --- editedfile
1502 +++ editedfile
1508 +++ editedfile
1503 @@ -1,3 +1,3 @@
1509 @@ -1,3 +1,3 @@
1504 -That is the first line
1510 -That is the first line
1505 -That change will be committed
1511 -That change will be committed
1506 -That is the third line
1512 -That is the third line
1507 +That change will not be committed
1513 +That change will not be committed
1508 +That is the second line
1514 +That is the second line
1509 +That line has been added
1515 +That line has been added
1510
1516
1511 Malformed patch - error handling
1517 Malformed patch - error handling
1512
1518
1513 $ cat > editor.sh << '__EOF__'
1519 $ cat > editor.sh << '__EOF__'
1514 > sed -e '/^@/p' "$1" > tmp
1520 > sed -e '/^@/p' "$1" > tmp
1515 > mv tmp "$1"
1521 > mv tmp "$1"
1516 > __EOF__
1522 > __EOF__
1517 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1523 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1518 > y
1524 > y
1519 > e
1525 > e
1520 > EOF
1526 > EOF
1521 diff --git a/editedfile b/editedfile
1527 diff --git a/editedfile b/editedfile
1522 1 hunks, 3 lines changed
1528 1 hunks, 3 lines changed
1523 examine changes to 'editedfile'?
1529 examine changes to 'editedfile'?
1524 (enter ? for help) [Ynesfdaq?] y
1530 (enter ? for help) [Ynesfdaq?] y
1525
1531
1526 @@ -1,3 +1,3 @@
1532 @@ -1,3 +1,3 @@
1527 -This is the first line
1533 -This is the first line
1528 -This change will be committed
1534 -This change will be committed
1529 -This is the third line
1535 -This is the third line
1530 +This change will not be committed
1536 +This change will not be committed
1531 +This is the second line
1537 +This is the second line
1532 +This line has been added
1538 +This line has been added
1533 record this change to 'editedfile'?
1539 record this change to 'editedfile'?
1534 (enter ? for help) [Ynesfdaq?] e
1540 (enter ? for help) [Ynesfdaq?] e
1535
1541
1536 abort: error parsing patch: unhandled transition: range -> range
1542 abort: error parsing patch: unhandled transition: range -> range
1537 [255]
1543 [255]
1538
1544
1539 Exiting editor with status 1, ignores the edit but does not stop the recording
1545 Exiting editor with status 1, ignores the edit but does not stop the recording
1540 session
1546 session
1541
1547
1542 $ HGEDITOR=false hg commit -i <<EOF
1548 $ HGEDITOR=false hg commit -i <<EOF
1543 > y
1549 > y
1544 > e
1550 > e
1545 > n
1551 > n
1546 > EOF
1552 > EOF
1547 diff --git a/editedfile b/editedfile
1553 diff --git a/editedfile b/editedfile
1548 1 hunks, 3 lines changed
1554 1 hunks, 3 lines changed
1549 examine changes to 'editedfile'?
1555 examine changes to 'editedfile'?
1550 (enter ? for help) [Ynesfdaq?] y
1556 (enter ? for help) [Ynesfdaq?] y
1551
1557
1552 @@ -1,3 +1,3 @@
1558 @@ -1,3 +1,3 @@
1553 -This is the first line
1559 -This is the first line
1554 -This change will be committed
1560 -This change will be committed
1555 -This is the third line
1561 -This is the third line
1556 +This change will not be committed
1562 +This change will not be committed
1557 +This is the second line
1563 +This is the second line
1558 +This line has been added
1564 +This line has been added
1559 record this change to 'editedfile'?
1565 record this change to 'editedfile'?
1560 (enter ? for help) [Ynesfdaq?] e
1566 (enter ? for help) [Ynesfdaq?] e
1561
1567
1562 editor exited with exit code 1
1568 editor exited with exit code 1
1563 record this change to 'editedfile'?
1569 record this change to 'editedfile'?
1564 (enter ? for help) [Ynesfdaq?] n
1570 (enter ? for help) [Ynesfdaq?] n
1565
1571
1566 no changes to record
1572 no changes to record
1567 [1]
1573 [1]
1568
1574
1569
1575
1570 random text in random positions is still an error
1576 random text in random positions is still an error
1571
1577
1572 $ cat > editor.sh << '__EOF__'
1578 $ cat > editor.sh << '__EOF__'
1573 > sed -e '/^@/i\
1579 > sed -e '/^@/i\
1574 > other' "$1" > tmp
1580 > other' "$1" > tmp
1575 > mv tmp "$1"
1581 > mv tmp "$1"
1576 > __EOF__
1582 > __EOF__
1577 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1583 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i <<EOF
1578 > y
1584 > y
1579 > e
1585 > e
1580 > EOF
1586 > EOF
1581 diff --git a/editedfile b/editedfile
1587 diff --git a/editedfile b/editedfile
1582 1 hunks, 3 lines changed
1588 1 hunks, 3 lines changed
1583 examine changes to 'editedfile'?
1589 examine changes to 'editedfile'?
1584 (enter ? for help) [Ynesfdaq?] y
1590 (enter ? for help) [Ynesfdaq?] y
1585
1591
1586 @@ -1,3 +1,3 @@
1592 @@ -1,3 +1,3 @@
1587 -This is the first line
1593 -This is the first line
1588 -This change will be committed
1594 -This change will be committed
1589 -This is the third line
1595 -This is the third line
1590 +This change will not be committed
1596 +This change will not be committed
1591 +This is the second line
1597 +This is the second line
1592 +This line has been added
1598 +This line has been added
1593 record this change to 'editedfile'?
1599 record this change to 'editedfile'?
1594 (enter ? for help) [Ynesfdaq?] e
1600 (enter ? for help) [Ynesfdaq?] e
1595
1601
1596 abort: error parsing patch: unhandled transition: file -> other
1602 abort: error parsing patch: unhandled transition: file -> other
1597 [255]
1603 [255]
1598
1604
1599 $ hg up -C
1605 $ hg up -C
1600 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1606 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1601
1607
1602 With win32text
1608 With win32text
1603
1609
1604 $ echo '[extensions]' >> .hg/hgrc
1610 $ echo '[extensions]' >> .hg/hgrc
1605 $ echo 'win32text = ' >> .hg/hgrc
1611 $ echo 'win32text = ' >> .hg/hgrc
1606 $ echo '[decode]' >> .hg/hgrc
1612 $ echo '[decode]' >> .hg/hgrc
1607 $ echo '** = cleverdecode:' >> .hg/hgrc
1613 $ echo '** = cleverdecode:' >> .hg/hgrc
1608 $ echo '[encode]' >> .hg/hgrc
1614 $ echo '[encode]' >> .hg/hgrc
1609 $ echo '** = cleverencode:' >> .hg/hgrc
1615 $ echo '** = cleverencode:' >> .hg/hgrc
1610 $ echo '[patch]' >> .hg/hgrc
1616 $ echo '[patch]' >> .hg/hgrc
1611 $ echo 'eol = crlf' >> .hg/hgrc
1617 $ echo 'eol = crlf' >> .hg/hgrc
1612
1618
1613 Ignore win32text deprecation warning for now:
1619 Ignore win32text deprecation warning for now:
1614
1620
1615 $ echo '[win32text]' >> .hg/hgrc
1621 $ echo '[win32text]' >> .hg/hgrc
1616 $ echo 'warn = no' >> .hg/hgrc
1622 $ echo 'warn = no' >> .hg/hgrc
1617
1623
1618 $ echo d >> subdir/f1
1624 $ echo d >> subdir/f1
1619 $ hg commit -i -d '24 0' -mw1 <<EOF
1625 $ hg commit -i -d '24 0' -mw1 <<EOF
1620 > y
1626 > y
1621 > y
1627 > y
1622 > EOF
1628 > EOF
1623 diff --git a/subdir/f1 b/subdir/f1
1629 diff --git a/subdir/f1 b/subdir/f1
1624 1 hunks, 1 lines changed
1630 1 hunks, 1 lines changed
1625 examine changes to 'subdir/f1'?
1631 examine changes to 'subdir/f1'?
1626 (enter ? for help) [Ynesfdaq?] y
1632 (enter ? for help) [Ynesfdaq?] y
1627
1633
1628 @@ -3,3 +3,4 @@ a
1634 @@ -3,3 +3,4 @@ a
1629 a
1635 a
1630 b
1636 b
1631 c
1637 c
1632 +d
1638 +d
1633 record this change to 'subdir/f1'?
1639 record this change to 'subdir/f1'?
1634 (enter ? for help) [Ynesfdaq?] y
1640 (enter ? for help) [Ynesfdaq?] y
1635
1641
1636
1642
1637 $ hg status -A subdir/f1
1643 $ hg status -A subdir/f1
1638 C subdir/f1
1644 C subdir/f1
1639 $ hg tip -p
1645 $ hg tip -p
1640 changeset: 30:* (glob)
1646 changeset: 30:* (glob)
1641 tag: tip
1647 tag: tip
1642 user: test
1648 user: test
1643 date: Thu Jan 01 00:00:24 1970 +0000
1649 date: Thu Jan 01 00:00:24 1970 +0000
1644 summary: w1
1650 summary: w1
1645
1651
1646 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1652 diff -r ???????????? -r ???????????? subdir/f1 (glob)
1647 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1653 --- a/subdir/f1 Thu Jan 01 00:00:23 1970 +0000
1648 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1654 +++ b/subdir/f1 Thu Jan 01 00:00:24 1970 +0000
1649 @@ -3,3 +3,4 @@
1655 @@ -3,3 +3,4 @@
1650 a
1656 a
1651 b
1657 b
1652 c
1658 c
1653 +d
1659 +d
1654
1660
1655
1661
1656
1662
1657 Test --user when ui.username not set
1663 Test --user when ui.username not set
1658 $ unset HGUSER
1664 $ unset HGUSER
1659 $ echo e >> subdir/f1
1665 $ echo e >> subdir/f1
1660 $ hg commit -i --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1666 $ hg commit -i --config ui.username= -d '8 0' --user xyz -m "user flag" <<EOF
1661 > y
1667 > y
1662 > y
1668 > y
1663 > EOF
1669 > EOF
1664 diff --git a/subdir/f1 b/subdir/f1
1670 diff --git a/subdir/f1 b/subdir/f1
1665 1 hunks, 1 lines changed
1671 1 hunks, 1 lines changed
1666 examine changes to 'subdir/f1'?
1672 examine changes to 'subdir/f1'?
1667 (enter ? for help) [Ynesfdaq?] y
1673 (enter ? for help) [Ynesfdaq?] y
1668
1674
1669 @@ -4,3 +4,4 @@ a
1675 @@ -4,3 +4,4 @@ a
1670 b
1676 b
1671 c
1677 c
1672 d
1678 d
1673 +e
1679 +e
1674 record this change to 'subdir/f1'?
1680 record this change to 'subdir/f1'?
1675 (enter ? for help) [Ynesfdaq?] y
1681 (enter ? for help) [Ynesfdaq?] y
1676
1682
1677 $ hg status -A subdir/f1
1683 $ hg status -A subdir/f1
1678 C subdir/f1
1684 C subdir/f1
1679 $ hg log --template '{author}\n' -l 1
1685 $ hg log --template '{author}\n' -l 1
1680 xyz
1686 xyz
1681 $ HGUSER="test"
1687 $ HGUSER="test"
1682 $ export HGUSER
1688 $ export HGUSER
1683
1689
1684
1690
1685 Moving files
1691 Moving files
1686
1692
1687 $ hg update -C .
1693 $ hg update -C .
1688 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1694 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1689 $ hg mv plain plain3
1695 $ hg mv plain plain3
1690 $ echo somechange >> plain3
1696 $ echo somechange >> plain3
1691 $ hg commit -i -d '23 0' -mmoving_files << EOF
1697 $ hg commit -i -d '23 0' -mmoving_files << EOF
1692 > y
1698 > y
1693 > y
1699 > y
1694 > EOF
1700 > EOF
1695 diff --git a/plain b/plain3
1701 diff --git a/plain b/plain3
1696 rename from plain
1702 rename from plain
1697 rename to plain3
1703 rename to plain3
1698 1 hunks, 1 lines changed
1704 1 hunks, 1 lines changed
1699 examine changes to 'plain' and 'plain3'?
1705 examine changes to 'plain' and 'plain3'?
1700 (enter ? for help) [Ynesfdaq?] y
1706 (enter ? for help) [Ynesfdaq?] y
1701
1707
1702 @@ -11,3 +11,4 @@ 8
1708 @@ -11,3 +11,4 @@ 8
1703 9
1709 9
1704 10
1710 10
1705 11
1711 11
1706 +somechange
1712 +somechange
1707 record this change to 'plain3'?
1713 record this change to 'plain3'?
1708 (enter ? for help) [Ynesfdaq?] y
1714 (enter ? for help) [Ynesfdaq?] y
1709
1715
1710 The #if execbit block above changes the hash here on some systems
1716 The #if execbit block above changes the hash here on some systems
1711 $ hg status -A plain3
1717 $ hg status -A plain3
1712 C plain3
1718 C plain3
1713 $ hg tip
1719 $ hg tip
1714 changeset: 32:* (glob)
1720 changeset: 32:* (glob)
1715 tag: tip
1721 tag: tip
1716 user: test
1722 user: test
1717 date: Thu Jan 01 00:00:23 1970 +0000
1723 date: Thu Jan 01 00:00:23 1970 +0000
1718 summary: moving_files
1724 summary: moving_files
1719
1725
1720 Editing patch of newly added file
1726 Editing patch of newly added file
1721
1727
1722 $ hg update -C .
1728 $ hg update -C .
1723 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1729 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1724 $ cat > editor.sh << '__EOF__'
1730 $ cat > editor.sh << '__EOF__'
1725 > cat "$1" | sed "s/first/very/g" > tt
1731 > cat "$1" | sed "s/first/very/g" > tt
1726 > mv tt "$1"
1732 > mv tt "$1"
1727 > __EOF__
1733 > __EOF__
1728 $ cat > newfile << '__EOF__'
1734 $ cat > newfile << '__EOF__'
1729 > This is the first line
1735 > This is the first line
1730 > This is the second line
1736 > This is the second line
1731 > This is the third line
1737 > This is the third line
1732 > __EOF__
1738 > __EOF__
1733 $ hg add newfile
1739 $ hg add newfile
1734 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new <<EOF
1740 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new <<EOF
1735 > y
1741 > y
1736 > e
1742 > e
1737 > EOF
1743 > EOF
1738 diff --git a/newfile b/newfile
1744 diff --git a/newfile b/newfile
1739 new file mode 100644
1745 new file mode 100644
1740 examine changes to 'newfile'?
1746 examine changes to 'newfile'?
1741 (enter ? for help) [Ynesfdaq?] y
1747 (enter ? for help) [Ynesfdaq?] y
1742
1748
1743 @@ -0,0 +1,3 @@
1749 @@ -0,0 +1,3 @@
1744 +This is the first line
1750 +This is the first line
1745 +This is the second line
1751 +This is the second line
1746 +This is the third line
1752 +This is the third line
1747 record this change to 'newfile'?
1753 record this change to 'newfile'?
1748 (enter ? for help) [Ynesfdaq?] e
1754 (enter ? for help) [Ynesfdaq?] e
1749
1755
1750 $ hg cat -r tip newfile
1756 $ hg cat -r tip newfile
1751 This is the very line
1757 This is the very line
1752 This is the second line
1758 This is the second line
1753 This is the third line
1759 This is the third line
1754
1760
1755 $ cat newfile
1761 $ cat newfile
1756 This is the first line
1762 This is the first line
1757 This is the second line
1763 This is the second line
1758 This is the third line
1764 This is the third line
1759
1765
1760 Add new file from within a subdirectory
1766 Add new file from within a subdirectory
1761 $ hg update -C .
1767 $ hg update -C .
1762 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1768 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1763 $ mkdir folder
1769 $ mkdir folder
1764 $ cd folder
1770 $ cd folder
1765 $ echo "foo" > bar
1771 $ echo "foo" > bar
1766 $ hg add bar
1772 $ hg add bar
1767 $ hg commit -i -d '23 0' -mnewfilesubdir <<EOF
1773 $ hg commit -i -d '23 0' -mnewfilesubdir <<EOF
1768 > y
1774 > y
1769 > y
1775 > y
1770 > EOF
1776 > EOF
1771 diff --git a/folder/bar b/folder/bar
1777 diff --git a/folder/bar b/folder/bar
1772 new file mode 100644
1778 new file mode 100644
1773 examine changes to 'folder/bar'?
1779 examine changes to 'folder/bar'?
1774 (enter ? for help) [Ynesfdaq?] y
1780 (enter ? for help) [Ynesfdaq?] y
1775
1781
1776 @@ -0,0 +1,1 @@
1782 @@ -0,0 +1,1 @@
1777 +foo
1783 +foo
1778 record this change to 'folder/bar'?
1784 record this change to 'folder/bar'?
1779 (enter ? for help) [Ynesfdaq?] y
1785 (enter ? for help) [Ynesfdaq?] y
1780
1786
1781 The #if execbit block above changes the hashes here on some systems
1787 The #if execbit block above changes the hashes here on some systems
1782 $ hg tip -p
1788 $ hg tip -p
1783 changeset: 34:* (glob)
1789 changeset: 34:* (glob)
1784 tag: tip
1790 tag: tip
1785 user: test
1791 user: test
1786 date: Thu Jan 01 00:00:23 1970 +0000
1792 date: Thu Jan 01 00:00:23 1970 +0000
1787 summary: newfilesubdir
1793 summary: newfilesubdir
1788
1794
1789 diff -r * -r * folder/bar (glob)
1795 diff -r * -r * folder/bar (glob)
1790 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1796 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1791 +++ b/folder/bar Thu Jan 01 00:00:23 1970 +0000
1797 +++ b/folder/bar Thu Jan 01 00:00:23 1970 +0000
1792 @@ -0,0 +1,1 @@
1798 @@ -0,0 +1,1 @@
1793 +foo
1799 +foo
1794
1800
1795 $ cd ..
1801 $ cd ..
1796
1802
1797 $ hg status -A folder/bar
1803 $ hg status -A folder/bar
1798 C folder/bar
1804 C folder/bar
1799
1805
1800 Clear win32text configuration before size/timestamp sensitive test
1806 Clear win32text configuration before size/timestamp sensitive test
1801
1807
1802 $ cat >> .hg/hgrc <<EOF
1808 $ cat >> .hg/hgrc <<EOF
1803 > [extensions]
1809 > [extensions]
1804 > win32text = !
1810 > win32text = !
1805 > [decode]
1811 > [decode]
1806 > ** = !
1812 > ** = !
1807 > [encode]
1813 > [encode]
1808 > ** = !
1814 > ** = !
1809 > [patch]
1815 > [patch]
1810 > eol = strict
1816 > eol = strict
1811 > EOF
1817 > EOF
1812 $ hg update -q -C null
1818 $ hg update -q -C null
1813 $ hg update -q -C tip
1819 $ hg update -q -C tip
1814
1820
1815 Test that partially committed file is still treated as "modified",
1821 Test that partially committed file is still treated as "modified",
1816 even if none of mode, size and timestamp is changed on the filesystem
1822 even if none of mode, size and timestamp is changed on the filesystem
1817 (see also issue4583).
1823 (see also issue4583).
1818
1824
1819 $ cat > subdir/f1 <<EOF
1825 $ cat > subdir/f1 <<EOF
1820 > A
1826 > A
1821 > a
1827 > a
1822 > a
1828 > a
1823 > b
1829 > b
1824 > c
1830 > c
1825 > d
1831 > d
1826 > E
1832 > E
1827 > EOF
1833 > EOF
1828 $ hg diff --git subdir/f1
1834 $ hg diff --git subdir/f1
1829 diff --git a/subdir/f1 b/subdir/f1
1835 diff --git a/subdir/f1 b/subdir/f1
1830 --- a/subdir/f1
1836 --- a/subdir/f1
1831 +++ b/subdir/f1
1837 +++ b/subdir/f1
1832 @@ -1,7 +1,7 @@
1838 @@ -1,7 +1,7 @@
1833 -a
1839 -a
1834 +A
1840 +A
1835 a
1841 a
1836 a
1842 a
1837 b
1843 b
1838 c
1844 c
1839 d
1845 d
1840 -e
1846 -e
1841 +E
1847 +E
1842
1848
1843 $ touch -t 200001010000 subdir/f1
1849 $ touch -t 200001010000 subdir/f1
1844
1850
1845 $ cat >> .hg/hgrc <<EOF
1851 $ cat >> .hg/hgrc <<EOF
1846 > # emulate invoking patch.internalpatch() at 2000-01-01 00:00
1852 > # emulate invoking patch.internalpatch() at 2000-01-01 00:00
1847 > [fakepatchtime]
1853 > [fakepatchtime]
1848 > fakenow = 200001010000
1854 > fakenow = 200001010000
1849 >
1855 >
1850 > [extensions]
1856 > [extensions]
1851 > fakepatchtime = $TESTDIR/fakepatchtime.py
1857 > fakepatchtime = $TESTDIR/fakepatchtime.py
1852 > EOF
1858 > EOF
1853 $ hg commit -i -m 'commit subdir/f1 partially' <<EOF
1859 $ hg commit -i -m 'commit subdir/f1 partially' <<EOF
1854 > y
1860 > y
1855 > y
1861 > y
1856 > n
1862 > n
1857 > EOF
1863 > EOF
1858 diff --git a/subdir/f1 b/subdir/f1
1864 diff --git a/subdir/f1 b/subdir/f1
1859 2 hunks, 2 lines changed
1865 2 hunks, 2 lines changed
1860 examine changes to 'subdir/f1'?
1866 examine changes to 'subdir/f1'?
1861 (enter ? for help) [Ynesfdaq?] y
1867 (enter ? for help) [Ynesfdaq?] y
1862
1868
1863 @@ -1,6 +1,6 @@
1869 @@ -1,6 +1,6 @@
1864 -a
1870 -a
1865 +A
1871 +A
1866 a
1872 a
1867 a
1873 a
1868 b
1874 b
1869 c
1875 c
1870 d
1876 d
1871 record change 1/2 to 'subdir/f1'?
1877 record change 1/2 to 'subdir/f1'?
1872 (enter ? for help) [Ynesfdaq?] y
1878 (enter ? for help) [Ynesfdaq?] y
1873
1879
1874 @@ -2,6 +2,6 @@
1880 @@ -2,6 +2,6 @@
1875 a
1881 a
1876 a
1882 a
1877 b
1883 b
1878 c
1884 c
1879 d
1885 d
1880 -e
1886 -e
1881 +E
1887 +E
1882 record change 2/2 to 'subdir/f1'?
1888 record change 2/2 to 'subdir/f1'?
1883 (enter ? for help) [Ynesfdaq?] n
1889 (enter ? for help) [Ynesfdaq?] n
1884
1890
1885 $ cat >> .hg/hgrc <<EOF
1891 $ cat >> .hg/hgrc <<EOF
1886 > [extensions]
1892 > [extensions]
1887 > fakepatchtime = !
1893 > fakepatchtime = !
1888 > EOF
1894 > EOF
1889
1895
1890 $ hg debugstate | grep ' subdir/f1$'
1896 $ hg debugstate | grep ' subdir/f1$'
1891 n 0 -1 unset subdir/f1
1897 n 0 -1 unset subdir/f1
1892 $ hg status -A subdir/f1
1898 $ hg status -A subdir/f1
1893 M subdir/f1
1899 M subdir/f1
1894
1900
1895 Test commands.commit.interactive.unified=0
1901 Test commands.commit.interactive.unified=0
1896
1902
1897 $ hg init $TESTTMP/b
1903 $ hg init $TESTTMP/b
1898 $ cd $TESTTMP/b
1904 $ cd $TESTTMP/b
1899 $ cat > foo <<EOF
1905 $ cat > foo <<EOF
1900 > 1
1906 > 1
1901 > 2
1907 > 2
1902 > 3
1908 > 3
1903 > 4
1909 > 4
1904 > 5
1910 > 5
1905 > EOF
1911 > EOF
1906 $ hg ci -qAm initial
1912 $ hg ci -qAm initial
1907 $ cat > foo <<EOF
1913 $ cat > foo <<EOF
1908 > 1
1914 > 1
1909 > change1
1915 > change1
1910 > 2
1916 > 2
1911 > 3
1917 > 3
1912 > change2
1918 > change2
1913 > 4
1919 > 4
1914 > 5
1920 > 5
1915 > EOF
1921 > EOF
1916 $ printf 'y\ny\ny\n' | hg ci -im initial --config commands.commit.interactive.unified=0
1922 $ printf 'y\ny\ny\n' | hg ci -im initial --config commands.commit.interactive.unified=0
1917 diff --git a/foo b/foo
1923 diff --git a/foo b/foo
1918 2 hunks, 2 lines changed
1924 2 hunks, 2 lines changed
1919 examine changes to 'foo'?
1925 examine changes to 'foo'?
1920 (enter ? for help) [Ynesfdaq?] y
1926 (enter ? for help) [Ynesfdaq?] y
1921
1927
1922 @@ -1,0 +2,1 @@ 1
1928 @@ -1,0 +2,1 @@ 1
1923 +change1
1929 +change1
1924 record change 1/2 to 'foo'?
1930 record change 1/2 to 'foo'?
1925 (enter ? for help) [Ynesfdaq?] y
1931 (enter ? for help) [Ynesfdaq?] y
1926
1932
1927 @@ -3,0 +5,1 @@ 3
1933 @@ -3,0 +5,1 @@ 3
1928 +change2
1934 +change2
1929 record change 2/2 to 'foo'?
1935 record change 2/2 to 'foo'?
1930 (enter ? for help) [Ynesfdaq?] y
1936 (enter ? for help) [Ynesfdaq?] y
1931
1937
1932 $ cd $TESTTMP
1938 $ cd $TESTTMP
1933
1939
1934 Test diff.ignoreblanklines=1
1940 Test diff.ignoreblanklines=1
1935
1941
1936 $ hg init c
1942 $ hg init c
1937 $ cd c
1943 $ cd c
1938 $ cat > foo <<EOF
1944 $ cat > foo <<EOF
1939 > 1
1945 > 1
1940 > 2
1946 > 2
1941 > 3
1947 > 3
1942 > 4
1948 > 4
1943 > 5
1949 > 5
1944 > EOF
1950 > EOF
1945 $ hg ci -qAm initial
1951 $ hg ci -qAm initial
1946 $ cat > foo <<EOF
1952 $ cat > foo <<EOF
1947 > 1
1953 > 1
1948 >
1954 >
1949 > 2
1955 > 2
1950 > 3
1956 > 3
1951 > change2
1957 > change2
1952 > 4
1958 > 4
1953 > 5
1959 > 5
1954 > EOF
1960 > EOF
1955 $ printf 'y\ny\ny\n' | hg ci -im initial --config diff.ignoreblanklines=1
1961 $ printf 'y\ny\ny\n' | hg ci -im initial --config diff.ignoreblanklines=1
1956 diff --git a/foo b/foo
1962 diff --git a/foo b/foo
1957 2 hunks, 2 lines changed
1963 2 hunks, 2 lines changed
1958 examine changes to 'foo'?
1964 examine changes to 'foo'?
1959 (enter ? for help) [Ynesfdaq?] y
1965 (enter ? for help) [Ynesfdaq?] y
1960
1966
1961 @@ -1,3 +1,4 @@
1967 @@ -1,3 +1,4 @@
1962 1
1968 1
1963 +
1969 +
1964 2
1970 2
1965 3
1971 3
1966 record change 1/2 to 'foo'?
1972 record change 1/2 to 'foo'?
1967 (enter ? for help) [Ynesfdaq?] y
1973 (enter ? for help) [Ynesfdaq?] y
1968
1974
1969 @@ -2,4 +3,5 @@
1975 @@ -2,4 +3,5 @@
1970 2
1976 2
1971 3
1977 3
1972 +change2
1978 +change2
1973 4
1979 4
1974 5
1980 5
1975 record change 2/2 to 'foo'?
1981 record change 2/2 to 'foo'?
1976 (enter ? for help) [Ynesfdaq?] y
1982 (enter ? for help) [Ynesfdaq?] y
1977
1983
1978
1984
General Comments 0
You need to be logged in to leave comments. Login now