comparison mercurial/logcmdutil.py @ 38571:2523c0200df4

diff: use `context.diff` to produce diff We want to make sure `context.diff` if full featured. Using it in the main diff code path is a good way to do so. The end goal is to be able to easily compute diff between in-memory context.
author Boris Feld <boris.feld@octobus.net>
date Wed, 23 May 2018 15:31:44 +0200
parents f2f9bacf0587
children fa681452b249
comparison
equal deleted inserted replaced
38570:62249cfe02d2 38571:2523c0200df4
74 diffopts = diffopts.copy(context=0, noprefix=False) 74 diffopts = diffopts.copy(context=0, noprefix=False)
75 width = 80 75 width = 80
76 if not ui.plain(): 76 if not ui.plain():
77 width = ui.termwidth() 77 width = ui.termwidth()
78 78
79 chunks = patch.diff(repo, node1, node2, match, changes, opts=diffopts, 79 chunks = repo[node2].diff(repo[node1], match, changes, opts=diffopts,
80 prefix=prefix, relroot=relroot, 80 prefix=prefix, relroot=relroot,
81 hunksfilterfn=hunksfilterfn) 81 hunksfilterfn=hunksfilterfn)
82 82
83 if fp is not None or ui.canwritewithoutlabels(): 83 if fp is not None or ui.canwritewithoutlabels():
84 out = fp or ui 84 out = fp or ui
85 if stat: 85 if stat:
86 chunks = [patch.diffstat(util.iterlines(chunks), width=width)] 86 chunks = [patch.diffstat(util.iterlines(chunks), width=width)]