diff: use `context.diff` to produce diff
authorBoris Feld <boris.feld@octobus.net>
Wed, 23 May 2018 15:31:44 +0200
changeset 38570 2523c0200df4
parent 38569 62249cfe02d2
child 38571 30a027c0e327
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.
mercurial/logcmdutil.py
--- 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