Mercurial > hg
comparison tests/test-revert-interactive.t @ 39405:cb70501d8b71
revert: fix the inconsistency of status msgs in --interactive mode
Before this patch we were priting every action msg before actually
performing that action and that was resulting in inconsistencies;
like in --interactive session if user decided to not revert any
changes in a file foo, still there will be a msg on console saying
"reverting foo".
To fix this, I have made some changes to print status msg just
before the action it is going to perform, no matter if --interactive
or not.
Changes made in test-revert-interactive.t reflect the changed behavior.
There are also some changes in test-revert.t because of change in the
order of messages.
Differential Revision: https://phab.mercurial-scm.org/D4380
author | Sushil khanchi <sushilkhanchi97@gmail.com> |
---|---|
date | Fri, 31 Aug 2018 23:28:09 +0530 |
parents | b95a6fb7ae66 |
children | 1cbe19eb496d |
comparison
equal
deleted
inserted
replaced
39404:90afd61ef8a2 | 39405:cb70501d8b71 |
---|---|
49 > ? | 49 > ? |
50 > y | 50 > y |
51 > n | 51 > n |
52 > n | 52 > n |
53 > EOF | 53 > EOF |
54 reverting f | 54 remove added file folder1/i (Yn)? y |
55 reverting folder1/g | |
56 removing folder1/i | 55 removing folder1/i |
57 reverting folder2/h | |
58 remove added file folder1/i (Yn)? y | |
59 diff --git a/f b/f | 56 diff --git a/f b/f |
60 2 hunks, 2 lines changed | 57 2 hunks, 2 lines changed |
61 examine changes to 'f'? [Ynesfdaq?] y | 58 examine changes to 'f'? [Ynesfdaq?] y |
62 | 59 |
63 @@ -1,6 +1,5 @@ | 60 @@ -1,6 +1,5 @@ |
113 | 110 |
114 diff --git a/folder2/h b/folder2/h | 111 diff --git a/folder2/h b/folder2/h |
115 2 hunks, 2 lines changed | 112 2 hunks, 2 lines changed |
116 examine changes to 'folder2/h'? [Ynesfdaq?] n | 113 examine changes to 'folder2/h'? [Ynesfdaq?] n |
117 | 114 |
115 reverting folder1/g | |
116 reverting f | |
118 $ cat f | 117 $ cat f |
119 1 | 118 1 |
120 2 | 119 2 |
121 3 | 120 3 |
122 4 | 121 4 |
138 f | 137 f |
139 | 138 |
140 Test that --interactive lift the need for --all | 139 Test that --interactive lift the need for --all |
141 | 140 |
142 $ echo q | hg revert -i -r 2 | 141 $ echo q | hg revert -i -r 2 |
143 reverting folder1/g | |
144 reverting folder2/h | |
145 diff --git a/folder1/g b/folder1/g | 142 diff --git a/folder1/g b/folder1/g |
146 1 hunks, 1 lines changed | 143 1 hunks, 1 lines changed |
147 examine changes to 'folder1/g'? [Ynesfdaq?] q | 144 examine changes to 'folder1/g'? [Ynesfdaq?] q |
148 | 145 |
149 abort: user quit | 146 abort: user quit |
195 > y | 192 > y |
196 > y | 193 > y |
197 > n | 194 > n |
198 > n | 195 > n |
199 > EOF | 196 > EOF |
200 reverting f | |
201 reverting folder1/g | |
202 removing folder1/i | |
203 reverting folder2/h | |
204 remove added file folder1/i (Yn)? n | 197 remove added file folder1/i (Yn)? n |
205 diff --git a/f b/f | 198 diff --git a/f b/f |
206 2 hunks, 2 lines changed | 199 2 hunks, 2 lines changed |
207 examine changes to 'f'? [Ynesfdaq?] y | 200 examine changes to 'f'? [Ynesfdaq?] y |
208 | 201 |
248 | 241 |
249 diff --git a/folder2/h b/folder2/h | 242 diff --git a/folder2/h b/folder2/h |
250 2 hunks, 2 lines changed | 243 2 hunks, 2 lines changed |
251 examine changes to 'folder2/h'? [Ynesfdaq?] n | 244 examine changes to 'folder2/h'? [Ynesfdaq?] n |
252 | 245 |
246 reverting folder1/g | |
247 reverting f | |
253 $ cat f | 248 $ cat f |
254 1 | 249 1 |
255 2 | 250 2 |
256 3 | 251 3 |
257 4 | 252 4 |
352 $ printf "0\n2\n" > k | 347 $ printf "0\n2\n" > k |
353 $ HGEDITOR="\"sh\" \"${TESTTMP}/editor.sh\"" hg revert -i <<EOF | 348 $ HGEDITOR="\"sh\" \"${TESTTMP}/editor.sh\"" hg revert -i <<EOF |
354 > y | 349 > y |
355 > e | 350 > e |
356 > EOF | 351 > EOF |
357 reverting k | |
358 diff --git a/k b/k | 352 diff --git a/k b/k |
359 1 hunks, 2 lines changed | 353 1 hunks, 2 lines changed |
360 examine changes to 'k'? [Ynesfdaq?] y | 354 examine changes to 'k'? [Ynesfdaq?] y |
361 | 355 |
362 @@ -1,1 +1,2 @@ | 356 @@ -1,1 +1,2 @@ |
363 -1 | 357 -1 |
364 +0 | 358 +0 |
365 +2 | 359 +2 |
366 discard this change to 'k'? [Ynesfdaq?] e | 360 discard this change to 'k'? [Ynesfdaq?] e |
367 | 361 |
362 reverting k | |
368 $ cat k | 363 $ cat k |
369 42 | 364 42 |
370 | 365 |
371 $ hg update -C . | 366 $ hg update -C . |
372 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 367 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
376 $ hg status | 371 $ hg status |
377 A newfile | 372 A newfile |
378 $ hg revert -i <<EOF | 373 $ hg revert -i <<EOF |
379 > n | 374 > n |
380 > EOF | 375 > EOF |
381 forgetting newfile | |
382 forget added file newfile (Yn)? n | 376 forget added file newfile (Yn)? n |
383 $ hg status | 377 $ hg status |
384 A newfile | 378 A newfile |
385 $ hg revert -i <<EOF | 379 $ hg revert -i <<EOF |
386 > y | 380 > y |
387 > EOF | 381 > EOF |
382 forget added file newfile (Yn)? y | |
388 forgetting newfile | 383 forgetting newfile |
389 forget added file newfile (Yn)? y | |
390 $ hg status | 384 $ hg status |
391 ? newfile | 385 ? newfile |
392 | 386 |
393 When a line without EOL is selected during "revert -i" (issue5651) | 387 When a line without EOL is selected during "revert -i" (issue5651) |
394 | 388 |
404 | 398 |
405 $ hg revert -ir'.^' <<EOF | 399 $ hg revert -ir'.^' <<EOF |
406 > y | 400 > y |
407 > y | 401 > y |
408 > EOF | 402 > EOF |
409 reverting a | |
410 diff --git a/a b/a | 403 diff --git a/a b/a |
411 1 hunks, 1 lines changed | 404 1 hunks, 1 lines changed |
412 examine changes to 'a'? [Ynesfdaq?] y | 405 examine changes to 'a'? [Ynesfdaq?] y |
413 | 406 |
414 @@ -1,2 +1,1 @@ | 407 @@ -1,2 +1,1 @@ |
415 0 | 408 0 |
416 -1 | 409 -1 |
417 \ No newline at end of file | 410 \ No newline at end of file |
418 apply this change to 'a'? [Ynesfdaq?] y | 411 apply this change to 'a'? [Ynesfdaq?] y |
419 | 412 |
413 reverting a | |
420 $ cat a | 414 $ cat a |
421 0 | 415 0 |
422 | 416 |
423 When specified pattern does not exist, we should exit early (issue5789). | 417 When specified pattern does not exist, we should exit early (issue5789). |
424 | 418 |