comparison mercurial/hgweb/webcommands.py @ 31082:abb92b3d370e

hgweb: explictly pass basectx in webutil.diffs There's only one case where `basectx` parameter is None (over two usages), so it's probably not worth handling the special case as it makes code-reading harder. Along the way, use ctx.p1() instead of checking for ctx.parents() being empty which should not occur.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Tue, 17 Jan 2017 17:25:48 +0100
parents 0b8356705de6
children c2dbd818e884
comparison
equal deleted inserted replaced
31081:be74ce1b930f 31082:abb92b3d370e
752 raise 752 raise
753 753
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 758
758 parity = paritygen(web.stripecount) 759 parity = paritygen(web.stripecount)
759 style = web.config('web', 'style', 'paper') 760 style = web.config('web', 'style', 'paper')
760 if 'style' in req.form: 761 if 'style' in req.form:
761 style = req.form['style'][0] 762 style = req.form['style'][0]
762 763
763 diffs = webutil.diffs(web.repo, tmpl, ctx, None, [path], parity, style) 764 diffs = webutil.diffs(web.repo, tmpl, ctx, basectx, [path], parity, style)
764 if fctx is not None: 765 if fctx is not None:
765 rename = webutil.renamelink(fctx) 766 rename = webutil.renamelink(fctx)
766 ctx = fctx 767 ctx = fctx
767 else: 768 else:
768 rename = [] 769 rename = []