[PATCH 1 of 9] largefiles: use 'list*' variables for consistency and clarity

Mads Kiilerich mads at kiilerich.com
Sat Sep 20 11:31:27 CDT 2014


On 09/17/2014 10:40 PM, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at gmail.com>
> # Date 1410885827 25200
> #      Tue Sep 16 09:43:47 2014 -0700
> # Node ID 3eb908098e46eb9b60bf6d4cc66a416111f2e201
> # Parent  48791c2bea1ceda4e4f28bc11651e281d636ce1a
> largefiles: use 'list*' variables for consistency and clarity
>
> The variables 'listignored', 'listclean' and 'listunknown' are
> initialized to the values of 'ignored', 'clean' and 'unknown',
> respectively. However, the 'ignored', 'clean' and 'unknown' themselves
> get a different meaning further down in the method, so use the list*
> names for clarity, since they only have one meaning.

AFAICS it is only 'clean' that is used for other purposes later on. (It 
was changed recently when unused values were given a _ prefix.) 'clean' 
starts out as a parameter in a monkey patched wrapper function so it 
should keep its name. I think the real problem is that we reuse 'clean' 
later on - it would be better to fix that and avoid introducing the 
'list*' aliases.

/Mads

>
> diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
> --- a/hgext/largefiles/reposetup.py
> +++ b/hgext/largefiles/reposetup.py
> @@ -152,7 +152,7 @@
>                       m._files = tostandins(m._files)
>   
>                       result = super(lfilesrepo, self).status(node1, node2, m,
> -                        ignored, clean, unknown, listsubrepos)
> +                        listignored, listclean, listunknown, listsubrepos)
>                       if working:
>   
>                           def sfindirstate(f):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list