[PATCH 3 of 3] webcommands: test that fctx is not None in filediff()

Augie Fackler raf at durin42.com
Tue Dec 1 09:13:01 CST 2015


On Tue, Dec 01, 2015 at 09:43:23PM +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6 at dwimlabs.net>
> # Date 1448701589 -28800
> #      Sat Nov 28 17:06:29 2015 +0800
> # Node ID 8264c8f4ddcee32c1d89b1adbdfe1a9d624b1ba7
> # Parent  91c232ae86ca05a9a8c71d7b9e6e8d4587b7417e
> webcommands: test that fctx is not None in filediff()

Queued these, many thanks!

>
> 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.
>
> diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
> --- a/mercurial/hgweb/webcommands.py
> +++ b/mercurial/hgweb/webcommands.py
> @@ -792,7 +792,7 @@ def filediff(web, req, tmpl):
>          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:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list