Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Mercurial's LargeFiles extension?

Tags:

mercurial

I use Mercurial for game development, and I'm trying to use the LargeFiles extension included in Mercurial 2.0 to keep track of large binary assets. Unfortunately there isn't a whole lot of documentation on the extension, so I'm not sure how people are expected to use it.

For example, is there any way to safely clean out the .hg/largefiles directory? If I'm on the tip revision, and expect to always have internet access, then I don't need the old versions of largefiles cluttering up the repository, since that's the whole point of using the LargeFiles extension.

Also, how do I have more fine-grained control over where the largefile store is? I can only assume that it's created somewhere on the computer that ran hg init, but I have no idea about the details.

Thanks!

like image 417
DuncanBoehle Avatar asked Nov 19 '11 22:11

DuncanBoehle


2 Answers

I don't have any guidance on how to safely clean out the .hg/largefiles directory.

Largefiles Store

The largefiles store seems to be stored, by default, at the one of following locations:

Windows: C:\Users\Username\AppData\Local\largefiles

OSX: /Users/username/Library/Caches/largefiles

Linux: (This is my best guess)

  • /home/username/largefiles
  • or /home/username/.cache/largefiles

User Configured:

This, however, can be changed in the global settings file using the usercache setting as follows:

[largefiles]
usercache = c:\path\to\largefiles\cache\

Note: This is not documented yet. This makes me wonder if it is subject to change.

Sources:

  • Largefiles Extension Documentation
  • User cache paths - https://www.mercurial-scm.org/repo/hg/file/41453d55b481/hgext/largefiles/lfutil.py (lines 84-103)
  • Undocumented largefiles.usercache setting - https://bz.mercurial-scm.org/show_bug.cgi?id=3088
like image 79
John Allers Avatar answered Nov 03 '22 21:11

John Allers


I'm just posting this for anyone else coming into the thread from a search.

There's currently an issue using the largefiles extension in the mercurial python module when hosted via IIS. See this post if you're encountering issues pushing large changesets (or large files) to IIS via TortoiseHg.

The problem ultimlately turns out to be a bug in SSL processing introduced in Python 2.7.3 (probably explaining why there are so many unresolve posts of people looking for problems with Mercurial). Rolling back to Python 2.7.2 let me get a little further ahead (blocked at 30Mb pushes instead of 15Mb), but to properly solve the problem I had to install the IISCrypto utility to completely disable transfers over SSLv2.

like image 41
Peter Bernier Avatar answered Nov 03 '22 22:11

Peter Bernier