webcommands: test that fctx is not None in filediff()
authorAnton Shestakov <av6@dwimlabs.net>
Sat, 28 Nov 2015 17:06:29 +0800
changeset 27160 c533435cbc37
parent 27159 7e10b860c174
child 27161 296d55def9c4
webcommands: test that fctx is not None in filediff() A block of code above this one already says "if fctx is not None", and it's also what this code actually intends to check, so let's be specific as PEP-8 recommends.
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Sat Nov 28 16:46:31 2015 +0800
+++ b/mercurial/hgweb/webcommands.py	Sat Nov 28 17:06:29 2015 +0800
@@ -792,7 +792,7 @@
         style = req.form['style'][0]
 
     diffs = webutil.diffs(web.repo, tmpl, ctx, None, [path], parity, style)
-    if fctx:
+    if fctx is not None:
         rename = webutil.renamelink(fctx)
         ctx = fctx
     else: