comparison tests/test-absorb-edit-lines.t @ 40190:31dfa7dac4c9

absorb: prompt user to accept absorb changes by default Change the default absorb behaviour to print the changes out and then prompt the user if they want to absorb the changes or not. Providing the `-p` option still prints the result and exits. A new `-a` option is provided which applies the changes without printing them, giving the equivalent of the old behaviour. Differential Revision: https://phab.mercurial-scm.org/D4999
author Mark Thomas <mbthomas@fb.com>
date Fri, 12 Oct 2018 17:48:40 +0000
parents 5111d11b8719
children 3cd57e2be49b
comparison
equal deleted inserted replaced
40189:9458dbfa7f33 40190:31dfa7dac4c9
13 > hg commit -A a -m "commit $i" -q 13 > hg commit -A a -m "commit $i" -q
14 > done 14 > done
15 15
16 absorb --edit-lines will run the editor if filename is provided: 16 absorb --edit-lines will run the editor if filename is provided:
17 17
18 $ hg absorb --edit-lines 18 $ hg absorb --edit-lines --apply-changes
19 nothing applied 19 nothing applied
20 [1] 20 [1]
21 $ HGEDITOR=cat hg absorb --edit-lines a 21 $ HGEDITOR=cat hg absorb --edit-lines --apply-changes a
22 HG: editing a 22 HG: editing a
23 HG: "y" means the line to the right exists in the changeset to the top 23 HG: "y" means the line to the right exists in the changeset to the top
24 HG: 24 HG:
25 HG: /---- 4ec16f85269a commit 1 25 HG: /---- 4ec16f85269a commit 1
26 HG: |/--- 5c5f95224a50 commit 2 26 HG: |/--- 5c5f95224a50 commit 2
41 > yy : d 41 > yy : d
42 > y y : e 42 > y y : e
43 > y : f 43 > y : f
44 > yyy : g 44 > yyy : g
45 > EOF 45 > EOF
46 $ HGEDITOR='cat editortext >' hg absorb -q --edit-lines a 46 $ HGEDITOR='cat editortext >' hg absorb -q --edit-lines --apply-changes a
47 $ hg cat -r 0 a 47 $ hg cat -r 0 a
48 d 48 d
49 e 49 e
50 f 50 f
51 g 51 g