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.
--- a/mercurial/logcmdutil.py Sat Jun 23 15:03:05 2018 +0200
+++ b/mercurial/logcmdutil.py Wed May 23 15:31:44 2018 +0200
@@ -76,9 +76,9 @@
if not ui.plain():
width = ui.termwidth()
- chunks = patch.diff(repo, node1, node2, match, changes, opts=diffopts,
- prefix=prefix, relroot=relroot,
- hunksfilterfn=hunksfilterfn)
+ chunks = repo[node2].diff(repo[node1], match, changes, opts=diffopts,
+ prefix=prefix, relroot=relroot,
+ hunksfilterfn=hunksfilterfn)
if fp is not None or ui.canwritewithoutlabels():
out = fp or ui