Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
== 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 at least Mercurial 1.6, or TortoiseHG 1.1.4.



== 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:
[[http://mercurial.selenic.com/wiki/FAQ#FAQ.2BAC8-CommonProblems.Why_is_the_modification_time_of_files_not_restored_on_checkout.3F|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>
}}}

Recent activity

Srećko Jurić-Kavelj

Commits by Srećko Jurić-Kavelj were pushed to jksrecko/hgsnap

e275c94 - Added controlling hook for commits and changegroups.
Srećko Jurić-Kavelj

Commits by Srećko Jurić-Kavelj were pushed to jksrecko/hgsnap

83d8a31 - Fix: all responses from the server accounted for (push over SSH).
Srećko Jurić-Kavelj

Commits by Srećko Jurić-Kavelj were pushed to jksrecko/hgsnap

dfed4ad - Minor: forgot to change some informative output to show only in debug mode.
Srećko Jurić-Kavelj

Commits by Srećko Jurić-Kavelj were pushed to jksrecko/hgsnap

68f8158 - Fix: problems with pushing snapped files over SSH. There are a few unexpected responses from the server. I'll have to track them down.
Srećko Jurić-Kavelj

Commits by Srećko Jurić-Kavelj were pushed to jksrecko/hgsnap

6928427 - Fix (thg): _snapmatch() would return lambda m: False... ...when snap repository was loaded through Workbench.
Srećko Jurić-Kavelj

Commits by Srećko Jurić-Kavelj were pushed to jksrecko/hgsnap

0ccf59e - Fixed some issues that manifested on Windows. README 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.