Home

snap

snap is a Mercurial extension for storing (big) file snapshots outside a Mercurial repository.

This is useful for files which are either too big, or do not change in small enough deltas to be stored in a source revision system like Mercurial. They would increase the repository size, memory consumption, and run-time.

You enable snap like any other Mercurial extension, simply add

    [extensions]
    hgext.snap=/path/to/snap.py

to your ``.hgrc`` file (see hg help config). Then you can get further information with

$ hg help snap

The snap extension requires either

  • Mercurial 1.6.4, 1.7, 1.7.1, 1.7.2, or 1.7.3; or
  • TortoiseHG 1.1.4, 1.1.5, 1.1.6.1, 1.1.7, or 1.1.8.

Please checkout the appropriate branch.

Support

You may send questions to the main Mercurial mailing list: mercurial@selenic.com

Contributions are also very welcome:

http://mercurial.selenic.com/wiki/ContributingChanges

http://mercurial.selenic.com/wiki/SuccessfulPatch

Alternatives

You may check out bigfiles and hg-bfiles as well:

http://bitbucket.org/avermel/bigfiles/

http://vc.gerg.ca/hg/hg-bfiles/

FAQ

Since I use snap, my builder / make utility behaves erratically

The modification time of files is not restored on update. See the Mercurial FAQ for the reasons: Why is the modification time of files not restored on checkout?.

Whenever you store result files (derived from other files) in Mercurial and then update them, you never know whether their modification time is earlier or later than of the files they are derived from.

You may use a hook to fix the modification time of result files after updates. See http://www.selenic.com/mercurial/hgrc.5.html for information about hooks.

How can I prevent the exchange of snapped files' data between two repositories? I do not want to send xxx GB around!

You can set the paths snap-store, and snap-default or snap-default-push to the same store. Later, you can exchange the snap files explicitly with debugsnappull and debugsnappush.

I do not like the implicit detection and storage of to be snapped files. How can I make this explicit?

First you may add to your .hgrc (see hg help config) the following to set the size threshold for files to be snapped to the max value:

    [snap]
    size_threshold = 750000000

Then you can commit files to be snapped with the command:

$ hg commit --config snap.patterns='**' <files>

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.