# HG changeset patch # User Anton Shestakov # Date 2015-11-28 08:46:31 # Node ID 7e10b860c17461b7e4e2633b445343c8d2892fe9 # Parent 522ffc1896712dfb79ef8248e5b4f4d05a8d9cc4 webcommands: stop using ersatz if-else ternary operator for rename variable 6ddc86eedc3b didn't remove it, let's do it now. Placing the added lines into the already existing "if fctx is not None" block also makes webcommands.comparison() look a bit more like webcommands.filediff(), which eases possible future refactoring. And fctx is not None only when path in ctx, so logically it's equivalent. diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -838,7 +838,6 @@ def comparison(web, req, tmpl): if 'file' not in req.form: raise ErrorResponse(HTTP_NOT_FOUND, 'file not given') path = webutil.cleanpath(web.repo, req.form['file'][0]) - rename = path in ctx and webutil.renamelink(ctx[path]) or [] parsecontext = lambda v: v == 'full' and -1 or int(v) if 'context' in req.form: @@ -875,8 +874,10 @@ def comparison(web, req, tmpl): comparison = webutil.compare(tmpl, context, leftlines, rightlines) if fctx is not None: + rename = webutil.renamelink(fctx) ctx = fctx else: + rename = [] ctx = ctx return tmpl('filecomparison', file=path,