Filters not invoked for files in subdirectories?

Maquelin, Olivier olivier.maquelin at intel.com
Wed Sep 21 13:42:48 CDT 2005


> With Mercurial 0.7, under Linux: 
> 
> [~/foo] cat .hg/hgrc 
> [encode] 
> *.txt = txt2unix 
> 
> [decode] 
> *.txt = txt2dos 
> [~/foo] hg addremove 
> adding bar/foobar.txt 
> adding foo.txt 
> [~/foo] hg --debug commit -m test 
> bar/foobar.txt 
> foo.txt 
> filtering foo.txt through txt2unix 

Some more details:

Specifying the pattern/command as '**.txt = txt2unix' finds text files
also in subdirectories (i.e. it does what I originally intended).
However, this was not exactly obvious to me, especially after reading
the hgrc man page, which gives '*.gz = gunzip' as an example. Moreover,
isn't this behavior inconsistent with 'hg locate \*.txt', which will
find text files also in subdirectories?

Specifying the pattern/command as 're:.*\.txt$ = txt2unix' does not
work. It seems that ConfigParser parses that line as a pattern = 're'
and command = '.*\.txt$ = txt2unix'.

-- Olivier



More information about the Mercurial mailing list