[PATCH 5 of 7] largefiles: avoid match.files() in conditions

Augie Fackler raf at durin42.com
Tue May 26 09:40:13 CDT 2015


On Thu, May 21, 2015 at 04:32:32PM -0500, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1432066101 25200
> #      Tue May 19 13:08:21 2015 -0700
> # Node ID 769c0f5320b6eed726b54cad7623ff078ae80677
> # Parent  d2aad10416bb2b08587f7d55cbe9e1f934b3de9e
> largefiles: avoid match.files() in conditions
>
> See 9789b4a7c595 (match: introduce boolean prefix() method,
> 2014-10-28) for reasons to avoid match.files() in conditions.

Is this commit message correct? It looks more like this is avoiding an
unsafe default value?

>
> diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
> --- a/hgext/largefiles/lfutil.py
> +++ b/hgext/largefiles/lfutil.py
> @@ -238,10 +238,10 @@
>      if path:
>          link(storepath(repo, hash), path)
>
> -def getstandinmatcher(repo, pats=[], opts={}):
> +def getstandinmatcher(repo, pats=None, opts={}):
>      '''Return a match object that applies pats to the standin directory'''
>      standindir = repo.wjoin(shortname)
> -    if pats:
> +    if pats is not None:
>          pats = [os.path.join(standindir, pat) for pat in pats]
>      else:
>          # no patterns: relative to repo root
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list