diff mercurial/hgweb/webutil.py @ 41618:e834f6f6f221

patch: pass in context objects into diffhunks() (API) It's a pretty low-level function and having the contexts in patch.diff() makes future patches easier. Differential Revision: https://phab.mercurial-scm.org/D5891
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 06 Feb 2019 17:27:43 -0800
parents eff0a7d3229c
children 0531dff73d0b
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Thu Feb 07 21:48:50 2019 +0300
+++ b/mercurial/hgweb/webutil.py	Wed Feb 06 17:27:43 2019 -0800
@@ -570,11 +570,9 @@
         m = match.always(repo.root, repo.getcwd())
 
     diffopts = patch.diffopts(repo.ui, untrusted=True)
-    node1 = basectx.node()
-    node2 = ctx.node()
     parity = paritygen(stripecount)
 
-    diffhunks = patch.diffhunks(repo, node1, node2, m, opts=diffopts)
+    diffhunks = patch.diffhunks(repo, basectx, ctx, m, opts=diffopts)
     for blockno, (fctx1, fctx2, header, hunks) in enumerate(diffhunks, 1):
         if style != 'raw':
             header = header[1:]