[RFC] largefiles - "system-wide" cache
Eli.Carter at tektronix.com
Tue Oct 18 15:38:49 CDT 2011
The largefiles extension talks a lot about a system-wide cache. There are two problems with this. First, this cache is per-user, not a system-wide. And secondly, it is more accurately described as a 'store' than as a 'cache'.
Regarding 'system-wide' vs 'per-user':
The extension assumes files are in the system cache, but if one user is cloning a repository from another user on the same machine, those files _won't_ be in the "system-wide" cache, and the clone winds up without the largefiles (and spews "Can't get file locally" errors).
Recarding 'cache' vs 'store':
Clearing your largefile 'cache' may cause data loss. If you 'push' your changes to another repository, you should be ok, but if you 'clone' or 'pull', you won't get all the versions of the largefiles. A user who wants to clean up a messy repository by cloning, deleting the original, and clearing ~/.largefiles winds up with a mess. Further, if a repository is restored from backup onto a new machine, the ~/.largefile 'cache' may not exist.
Additionally, this breaks the existing symmetry between 'push' and 'pull'. (And for good reason: we're trying to avoid having a full copy of all of those largefiles on every client.) But we need a way to say 'no, really, I want a full clone'.
Therefore, there are two things I'd like to see:
1: I'd like to have the extension populate $repo/.hg/largefiles in addition to ~/.largefiles (using hardlinks where possible), and reference it when looking for files.
2: I'd like to have an --all-largefiles option for hg clone and hg pull that downloads all versions of all largefiles referenced by any changeset included in the transfer.
Would these changes be welcome, or are there objections to these changes at this conceptual level?
More information about the Mercurial-devel