Enabling Repository Snapshots in Mercurial Browser at SF.net

Imaging's code repository at SourceForge has been migrated from Subversion version control system to Mercurial. However, repository browser for Mercurial at SF.net doesn't provide "download tarball" feature out of the box (that browser for SVN does). It's a simple way for users that don't want to install VCS clients they don't normally use to download the current revision of your project in single archive.
Fortunatelly, enabling snapshot downloads for Mercurial is possible using SF.net's shell service:

  • Login to your shell service at SF.net (ssh to username,projectname@shell.sourceforge.net) and navigate to your project's repository. You start in your home dir (for me that's /home/users/g/ga/galfar) and your project's repo dir might look like /home/scm_hg/i/im/imaginglib/imaginglib/.hg/.
  • There you create a new file named hgrc (repository configuration) or edit the existing one.
  • Append the following two lines to that config file:
    allow_archive = gz zip
  • Save the config and enjoy downloading zip and tar.gz archives! You'll see new zip and gz items in the top menu of repo browser (e.g. summary | shortlog | changelog | graph | tags | branches | files | zip | gz) when viewing the revisions and also corresponding two icons in repository list that can be used to get the snapshot of top revision of each repository.

Hg repo browser witch snapshots

PS: You can convert whole repository to Mercurial with all the history and tags simply by using Convert extension. It takes quite a lot of time when you convert remote repository directly but the conversion continues where it left off when you get timeout or some network problem and run the conversion again.

Leave a Reply

Your email address will not be published. Required fields are marked *