##// END OF EJS Templates
absorb: make `--edit-lines` imply `--apply-changes`...
Martin von Zweigbergk -
r49963:3cd57e2b default
parent child Browse files
Show More
@@ -1045,6 +1045,10 b' def absorb(ui, repo, stack=None, targetc'
1045 origchunks = patch.parsepatch(diff)
1045 origchunks = patch.parsepatch(diff)
1046 chunks = cmdutil.recordfilter(ui, origchunks, matcher)[0]
1046 chunks = cmdutil.recordfilter(ui, origchunks, matcher)[0]
1047 targetctx = overlaydiffcontext(stack[-1], chunks)
1047 targetctx = overlaydiffcontext(stack[-1], chunks)
1048 if opts.get(b'edit_lines'):
1049 # If we're going to open the editor, don't ask the user to confirm
1050 # first
1051 opts[b'apply_changes'] = True
1048 fm = None
1052 fm = None
1049 if opts.get(b'print_changes') or not opts.get(b'apply_changes'):
1053 if opts.get(b'print_changes') or not opts.get(b'apply_changes'):
1050 fm = ui.formatter(b'absorb', opts)
1054 fm = ui.formatter(b'absorb', opts)
@@ -15,10 +15,10 b' Make some commits:'
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 --apply-changes
18 $ hg absorb --edit-lines
19 nothing applied
19 nothing applied
20 [1]
20 [1]
21 $ HGEDITOR=cat hg absorb --edit-lines --apply-changes a
21 $ HGEDITOR=cat hg absorb --edit-lines 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:
@@ -43,7 +43,7 b' Edit the file using --edit-lines:'
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 --apply-changes a
46 $ HGEDITOR='cat editortext >' hg absorb -q --edit-lines a
47 $ hg cat -r 0 a
47 $ hg cat -r 0 a
48 d
48 d
49 e
49 e
General Comments 0
You need to be logged in to leave comments. Login now