--- a/mercurial/cmdutil.py Wed May 20 11:44:06 2015 -0500
+++ b/mercurial/cmdutil.py Fri May 29 13:11:52 2015 -0700
@@ -3139,10 +3139,21 @@
diffopts = patch.difffeatureopts(repo.ui, whitespace=True)
diffopts.nodates = True
diffopts.git = True
- diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
+ reversehunks = repo.ui.configbool('experimental',
+ 'revertalternateinteractivemode',
+ False)
+ if reversehunks:
+ diff = patch.diff(repo, ctx.node(), None, m, opts=diffopts)
+ else:
+ diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
originalchunks = patch.parsepatch(diff)
+
try:
+
chunks = recordfilter(repo.ui, originalchunks)
+ if reversehunks:
+ chunks = patch.reversehunks(chunks)
+
except patch.PatchError, err:
raise util.Abort(_('error parsing patch: %s') % err)