[PATCH 8 of 8] largefiles: replace match.bad() monkey patching with match.badmatch()

Martin von Zweigbergk martinvonz at google.com
Thu Jun 4 23:26:24 CDT 2015


This series looks good to me, but I'll let Matt take a look at particularly
1/8, so I'll leave the queuing for him.

On Thu, Jun 4, 2015 at 9:09 PM Matt Harbison <mharbison72 at gmail.com> wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1433470278 14400
> #      Thu Jun 04 22:11:18 2015 -0400
> # Node ID 89c9da9f2121dcba36002cf10a23df677026ee59
> # Parent  91db1c0b272e90c500f1fe5416150a65c2c6579f
> largefiles: replace match.bad() monkey patching with match.badmatch()
>
> No known issues with the previous code since it restored the original
> method,
> but this is cleaner.
>
> The monkey patching in cat is harmless, because it is created locally, and
> doesn't pass it anywhere (subrepo cat isn't supported with largefiles).
>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -100,10 +100,10 @@
>              lfmatcher = match_.match(repo.root, '', list(lfpats))
>
>      lfnames = []
> -    m = copy.copy(matcher)
> -    m.bad = lambda x, y: None
> +    m = matcher
> +
>      wctx = repo[None]
> -    for f in repo.walk(m):
> +    for f in repo.walk(match_.badmatch(m, lambda x, y: None)):
>          exact = m.exact(f)
>          lfile = lfutil.standin(f) in wctx
>          nfile = f in wctx
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150605/b78fe7e9/attachment.html>


More information about the Mercurial-devel mailing list