[PATCH 0 of 5] introduce fncache repo layout

Adrian Buehlmann adrian at cadifra.com
Wed Jul 30 13:48:12 CDT 2008


This implements Matt's requirements per
http://selenic.com/pipermail/mercurial-devel/2008-July/007215.html

Specifically, I'm referring to this part of what Matt said:

'''
...
Also note that in the rare occassions when we walk the file list, we're
typically calling stat() to get the file list. This gives us the
opportunity to check that all the files mentioned actually exist, so we
don't actually have to worry about journalling this file. Because we
have the lock held, at the end of storefiles(), we can rewrite it if we
find errors.
...
'''

Matt was referring to the "filenamlog" file there, which I've now named
"fncache". The rewrite of fncache now happens in store.fncachestore.datafiles.
And fncache is *not* journalled.

Furthermore I've tweaked store.hybridencode: I've abandoned
the "X" -> "_x" encoding for the directory/filler parts of the hashed names
and just used lower() plus the usual encoding (~xx for reserved stuff).

For example, this encodes
data/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT.i
to
dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i

Since we fold directories anyway for hashed ("dh/..") files, we can fold the case
too. A tracked dir named "Foo" rarely coexists next to a "foo". If it does, the
hash values will keep the files separate.


More information about the Mercurial-devel mailing list