Can ot get largefiles patterns to work
Michał Sznajder
michalsznajder at gmail.com
Thu Apr 12 18:21:53 UTC 2012
On Thu, Apr 12, 2012 at 12:49 PM, Kaare Trefall
<kaare.trefall at kongsberg.com> wrote:
> Hello.
>
> Using the new 'largefiles' extension I could not get largefiles->patterns to
> work for 'hg add'.
> Or more correctly: I could not get largefiles->patterns to work for hg 2.1
> and 2.1.1.
> By 'tricking it' I got it to work for hg 2.0.1 and 2.0.2, and started to use
> it, thinking that future bugfixes would let me stop using my 'trick'.
> But I found no way to get largefiles->patterns work in 2.1 or 2.1.1.
> I got the same result on both Linux and Windows (WindowsXP x86).
> Here a command sequence showing my problems, including the '2.0.1 trick':
>
>
> My hg settings:
> % cat ~/.hgrc
> ....
>
> [extensions]
> largefiles =
> ....
>
> [largefiles]
> patterns = xx
>
> 1) Getting largefiles->patterns to work in hg version 2.0.1 by "tricking
> it":
>
> % set path= ( /tools/hg_r/2.0.1/bin $path )
> % hg --version
> Mercurial Distributed SCM (version 2.0.1)
>
> Make a directory with two files and make it a hg repository:
> % mkdir largefiles_tst
> % cd largefiles_tst
> % date > xx
> % date > yy
> % hg init
> % ls -a
> ./ ../ .hg/ xx yy
>
> Add the two files to the repository.
> The file 'xx' specified in largefiles->patterns is NOT recognized as a
> largefile!:
> % hg add yy
> % hg add xx
> % ls -a
> ./ ../ .hg/ xx yy
>
> By an "accident" I discovered that by first manually adding one largefile,
> largefiles->patterns worked for further file adding:
>
> remove the two files:
> % hg forget yy xx
>
> Add the file not specified in largefiles->patterns as a largefile:
> % hg add --large yy
> % ls -a
> ./ ../ .hg/ .hglf/ xx yy
> % ls .hglf
> yy
>
> Add the file specified in largefiles->patterns as a largefile:
> % hg add xx
> % ls .hglf
> xx yy
>
>
> 2) Trying largefiles->patterns in hg version 2.1 and 2.1.1 (here 2.1 is used
> on Linux, 2.1.1
> was tested with the same result on Windows, where I also originally
> discovered the problem):
>
> % set path= ( /tools/hg_r/2.1/bin $path )
> % hg --version
> Mercurial Distributed SCM (version 2.1)
>
> Removing the repository and add it fresh:
> % rm -rf .hg .hglf
> % hg init
>
> Adding the two files. The file 'xx' specified in largefiles->patterns is
> NOT recognized as a largefile:
> % hg add yy
> % ls -a
> ./ ../ .hg/ xx yy
> % hg add xx
> % ls -a
> ./ ../ .hg/ xx yy
>
> Trying the 'first add a largefile manually' trick which worked for hg
> version 2.0.1.
> But in version 2.1 (and 2.1.1) this DOES NOT work:
> % hg forget yy xx
> % hg add --large yy
> % ls -a
> ./ ../ .hg/ .hglf/ xx yy
> % ls .hglf
> yy
> % hg add xx
> % ls .hglf
> yy
>
> So I could NOT get largefiles->patterns to work at all in hg version
> 2.1*.
>
>
> Hope somebody could tell me if I am doing something wrong, or if this is a
> bug.
> Thanks!
>
> Kaare
I think you've hit the same thing I did some time ago. If you read
http://www.selenic.com/mercurial/hg.1.html#largefiles
carefully you'll find
The largefiles.minsize and largefiles.patterns config options will
be ignored for any repositories not already
containing a largefile. To add the first largefile to a
repository, you must explicitly do so with
the --large flag passed to the hg add command.
largefile is a feature with a big impact on the repo so developers of
Mercurial decided that you have to
explicitly turn repo into "largefiles" enabled one by invoking first
hg add --large manually. Later on
everything is just a breeze.
Regards
Michal Sznajder
More information about the Mercurial
mailing list