hgweb: pass ui to diffstatgen() explicitly
authorYuya Nishihara <yuya@tcha.org>
Fri, 06 Jul 2018 21:35:47 +0900
changeset 38585 66eb74f9d87d
parent 38584 c6398fc2fc9c
child 38586 79d7d715f3d0
hgweb: pass ui to diffstatgen() explicitly
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py	Fri Jul 06 21:31:04 2018 +0900
+++ b/mercurial/hgweb/webutil.py	Fri Jul 06 21:35:47 2018 +0900
@@ -509,7 +509,7 @@
     diff = diffs(web, ctx, basectx, None, style)
 
     parity = paritygen(web.stripecount)
-    diffstatsgen = diffstatgen(ctx, basectx)
+    diffstatsgen = diffstatgen(web.repo.ui, ctx, basectx)
     diffstats = diffstat(ctx, diffstatsgen, parity)
 
     return dict(
@@ -655,10 +655,10 @@
     return templateutil.mappinggenerator(_comparegen, args=args,
                                          name='comparisonblock')
 
-def diffstatgen(ctx, basectx):
+def diffstatgen(ui, ctx, basectx):
     '''Generator function that provides the diffstat data.'''
 
-    diffopts = patch.diffopts(ctx._repo.ui, {'noprefix': False})
+    diffopts = patch.diffopts(ui, {'noprefix': False})
     stats = patch.diffstatdata(
         util.iterlines(ctx.diff(basectx, opts=diffopts)))
     maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)