comparison hgext/absorb.py @ 42351:86f17fc31aa8

absorb: fix interactive mode I didn't know existed While investigating a bug in `hg absorb -e` I unintentionally discovered `hg absorb --interactive` and its brokenness. This adds a test and restores the functionality. Note that this interface is still marked experimental, so we can change this to be more sophisticated in the future. Differential Revision: https://phab.mercurial-scm.org/D6411
author Augie Fackler <augie@google.com>
date Mon, 20 May 2019 14:00:12 -0400
parents b3fc78c028ef
children c1bf63ac30c5
comparison
equal deleted inserted replaced
42350:e0ac310bd033 42351:86f17fc31aa8
933 state = fixupstate(stack, ui=ui, opts=opts) 933 state = fixupstate(stack, ui=ui, opts=opts)
934 matcher = scmutil.match(targetctx, pats, opts) 934 matcher = scmutil.match(targetctx, pats, opts)
935 if opts.get('interactive'): 935 if opts.get('interactive'):
936 diff = patch.diff(repo, stack[-1].node(), targetctx.node(), matcher) 936 diff = patch.diff(repo, stack[-1].node(), targetctx.node(), matcher)
937 origchunks = patch.parsepatch(diff) 937 origchunks = patch.parsepatch(diff)
938 chunks = cmdutil.recordfilter(ui, origchunks)[0] 938 chunks = cmdutil.recordfilter(ui, origchunks, matcher)[0]
939 targetctx = overlaydiffcontext(stack[-1], chunks) 939 targetctx = overlaydiffcontext(stack[-1], chunks)
940 fm = None 940 fm = None
941 if opts.get('print_changes') or not opts.get('apply_changes'): 941 if opts.get('print_changes') or not opts.get('apply_changes'):
942 fm = ui.formatter('absorb', opts) 942 fm = ui.formatter('absorb', opts)
943 state.diffwith(targetctx, matcher, fm) 943 state.diffwith(targetctx, matcher, fm)