[PATCH 2 of 2] lfs: migrate most file filtering from threshold to custom filter

Yuya Nishihara yuya at tcha.org
Sat Jan 13 21:11:45 EST 2018


On Sat, 13 Jan 2018 02:23:16 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1514706889 18000
> #      Sun Dec 31 02:54:49 2017 -0500
> # Node ID 66976f55793cced57929dedc8993204be340c717
> # Parent  868cc63bfe9d7d7f5b40bc8cd70175cf1a608a95
> lfs: migrate most file filtering from threshold to custom filter

Queued, thanks.

> -    threshold = repo.ui.configbytes('lfs', 'threshold')
> +    trackspec = repo.ui.config('lfs', 'track')
>  
> -    repo.svfs.options['lfsthreshold'] = threshold
> +    # deprecated config: lfs.threshold
> +    threshold = repo.ui.configbytes('lfs', 'threshold')
> +    if threshold:
> +        trackspec = "(%s) | size('>%s')" % (trackspec, threshold)

I've added fileset.parse(trackspec) to detect bad spec like '..) .. (..', and
s/%s/%d/ to make sure threshold is integer so no need of string escape.


More information about the Mercurial-devel mailing list