[PATCH 2 of 3 RFC] localrepo: refactor filter computation
Martin Geisler
mg at lazybytes.net
Sat Aug 14 10:43:43 CDT 2010
Nicolas Dumazet <nicdumz at gmail.com> writes:
> # HG changeset patch
> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
> # Date 1279898900 -32400
> # Node ID dca39a137eaa3f107c6b6419540a0afca702d3eb
> # Parent 8d31c81b74e3ad8d61a51cb0a112ebf8dfbf5171
> localrepo: refactor filter computation
Seems fine to me.
> diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
> --- a/mercurial/localrepo.py
> +++ b/mercurial/localrepo.py
> @@ -510,7 +510,7 @@
> def _link(self, f):
> return os.path.islink(self.wjoin(f))
>
> - def _filter(self, filter, filename, data):
> + def _loadfilter(self, filter):
> if filter not in self.filterpats:
> l = []
> for pat, cmd in self.ui.configitems(filter):
> @@ -533,6 +533,9 @@
> l.append((mf, fn, params))
> self.filterpats[filter] = l
>
> + def _filter(self, filter, filename, data):
> + self._loadfilter(filter)
> +
> for mf, fn, cmd in self.filterpats[filter]:
> if mf(filename):
> self.ui.debug("filtering %s through %s\n" % (filename, cmd))
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
--
Martin Geisler
Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20100814/7f5888aa/attachment.pgp>
More information about the Mercurial-devel
mailing list