[PATCH] censor: rename loop variable to silence pyflakes warning

Gregory Szorc gregory.szorc at gmail.com
Sun Sep 16 17:39:49 EDT 2018


On Fri, Sep 14, 2018 at 6:52 PM Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1536975300 -32400
> #      Sat Sep 15 10:35:00 2018 +0900
> # Node ID 3a3364720695f26ceee3cd0a056fda59251f4ca5
> # Parent  6ecfd12f09cd4fe185ebbc98d254534ebd995b68
> censor: rename loop variable to silence pyflakes warning
>

Queued, thanks.


>
> hgext/censor.py:92: list comprehension redefines 'c' from line 88
>
> diff --git a/hgext/censor.py b/hgext/censor.py
> --- a/hgext/censor.py
> +++ b/hgext/censor.py
> @@ -85,9 +85,9 @@ def _docensor(ui, repo, path, rev='', to
>      fnode = fctx.filenode()
>      heads = []
>      for headnode in repo.heads():
> -        c = repo[headnode]
> -        if path in c and c.filenode(path) == fnode:
> -            heads.append(c)
> +        hc = repo[headnode]
> +        if path in hc and hc.filenode(path) == fnode:
> +            heads.append(hc)
>      if heads:
>          headlist = ', '.join([short(c.node()) for c in heads])
>          raise error.Abort(_('cannot censor file in heads (%s)') %
> headlist,
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180916/8a9af328/attachment.html>


More information about the Mercurial-devel mailing list