[PATCH 0 of 4] largefiles: make system cache a user cache, and the repo cache a store

Benjamin Pollack benjamin at bitquabit.com
Thu Oct 20 12:24:54 CDT 2011


In the current version of largefiles, the system cache, which would better be
called the user cache, is treated as the primary store for largefiles.  This is
a serious bug that causes numerous problems, including:

   - Repositories owned by different users cannot reliably be cloned on the
     local filesystem;
   - The nominal cache cannot be cleared without risking losing data
   - Zipping a nominally complete repository on disk may not actually include
     all largefiles (since some will be in the user cache)

This patch series does several things:

   - In introduces a test authored by Eli Carter that provides a concrete
     failure for the current behavior
   - It corrects the documentation to clarify what the proper behavior ought to
     be
   - It renames a large number of functions and methods, plus a config setting,
     to actually reflect that desired behavior
   - It actually fixes the behavior to match the description, allowing the
     failing test to pass

The last two, or even three, patches can be folded; they were kept separate for
my sanity during development, and for ease of tracking what I actually changed.
Likewise, if we're concerned about such a large renaming, the last patch can be
easily rewritten to use the old function names.

One performance regression introduced in this patch series is that largefiles
shared amongst multiple repositories on the local machine will not always be
hardlinked.  Fixing this problem is straightforward, but requires a slightly
larger refactoring than was required to simply fix the bug, so I would prefer
to deliver that as a separate patch.


More information about the Mercurial-devel mailing list