[PATCH] largefiles: respect config settings in a pristine repo

Michał Sznajder michalsznajder at gmail.com
Tue Dec 27 13:28:35 CST 2011


On 26 Dec 2011, at 12:35, Na'Tosha Bard wrote:
> On Sun, Dec 25, 2011 at 11:30 PM, <michalsznajder at gmail.com> wrote:
> 
>> # HG changeset patch
>> # User Michal Sznajder <michalsznajder at gmail.com>
>> # Date 1324852023 -3600
>> # Node ID c4130b507277eeccede1b8feef8506f76e552753
>> # Parent  3bcfea777efc41c87918c1bb594615ff4fb6a34b
>> largefiles: respect config settings in a pristine repo
>> 
>> largefiles config settings (patterns and minsize) are not respected until
>> at least one file is added and commited with --large option. it gives
>> an impression for newcommers that largefiles are broken.
>> 
> 
> The reason why it works this way is because we don't want the repo turned
> into a largefiles repo without the user having explicitly done so by
> supplying the --large flag.  There can easily be cases where the user has
> to deal with 5 different repos and has largefiles turned on because one of
> them is a largefiles repo.  I believe your patch will make it so that any
> repo could be turned into a largefiles repo if you supply a file that
> matches the patterns or size limits.
> 
> So unless I'm misunderstanding what this patch does, I think it's a really
> bad idea to change the behavior like this.  Largefiles adds a lot of
> overhead, it adds some complexity, and it still las rough edges that need
> to be fixed.  It should certainly not be used unless the user is completely
> aware of all of these things, and the benefit gained is still worth that
> trade-off.  Making it so that users can accidentally turn repos into
> largefiles-enabled repos and not really notice it (especially if they are
> using GUI tools and not the command-line) seems extremely dangerous.

I created this path when I first enabled largefiles. I had read documentation before
and set all parameters from [largefiles] section. Than I couldn't get any file being
detected as "largefile". My immediate thought was: "jeez, largefiles doesn't work out
of box at all..."

So your definitely valid protection for new users gave me an impression that this
great feature does not work at all.

I was definitely to hasty with patch but some improvement in docs would definitely
help. Something similar to "... In order to change repo into largefile capable please
use first add command with --large flag." or "... [largefiles] parameters are ignored
until first file is added with --large switch ..." What do you think?

BTW What is a correct way of detecting that repo is lf-capable? lfutil.islfilesrepo or
just os.path.exists(repo.wjoin(lfutil.shortname)) ?



More information about the Mercurial-devel mailing list