Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 31665:c2dbd818e884
hgweb: handle "parity" internally in webutil.diffs()
There's apparently no reason to have the "parity" of diff blocks that
webutil.diffs() generates coming from outside the function. So have it
internally managed. We thus now pass a "web" object to webutil.diffs() to get
access to both "repo" and "stripecount" attribute.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Mon, 13 Mar 2017 10:40:19 +0100 |
parents | abb92b3d370e |
children | f36dc643ffdc |
comparison
equal
deleted
inserted
replaced
31664:0eec36112e58 | 31665:c2dbd818e884 |
---|---|
754 if fctx is not None: | 754 if fctx is not None: |
755 path = fctx.path() | 755 path = fctx.path() |
756 ctx = fctx.changectx() | 756 ctx = fctx.changectx() |
757 basectx = ctx.p1() | 757 basectx = ctx.p1() |
758 | 758 |
759 parity = paritygen(web.stripecount) | |
760 style = web.config('web', 'style', 'paper') | 759 style = web.config('web', 'style', 'paper') |
761 if 'style' in req.form: | 760 if 'style' in req.form: |
762 style = req.form['style'][0] | 761 style = req.form['style'][0] |
763 | 762 |
764 diffs = webutil.diffs(web.repo, tmpl, ctx, basectx, [path], parity, style) | 763 diffs = webutil.diffs(web, tmpl, ctx, basectx, [path], style) |
765 if fctx is not None: | 764 if fctx is not None: |
766 rename = webutil.renamelink(fctx) | 765 rename = webutil.renamelink(fctx) |
767 ctx = fctx | 766 ctx = fctx |
768 else: | 767 else: |
769 rename = [] | 768 rename = [] |