5.13. Archiving

You can choose from quite a lot of formats to make an archive of a repository. There are the usual compressed formats, of course, but it’s also possible to make a folder of the uncompressed files in a place other than the Working Directory (like a clone, but without the .hg folder). Such archives, for example, can be useful for doing builds (similar to ‘svn export’). Archives may also be useful for sending changes to external people without access to the reposity, where only the effected files of a given revision or set of revisions need be included in the archive.

5.13.1. From TortoiseHg

From the changelog context menu in the Workbench select Export ‣ Archive… for the choosen changeset.

Archive dialog

Repository Archive Dialog

To select the revision you wish to archive or export.
Only files modified/created in this revision
To limit the number of files in the archive.
Destination path
The filename or directory where the archive will be created. The archive is filled with the name of the current repository, suffixed with the revision number of the selected revision, and has the appropriate extension of the selected archive type.
Archive types
Here you can choose the type of archive to create, ranging from a plain folder with files to a variety of standard archive type.
Hg command
This field displays the command that will be executed by the dialog.
Always show output
To have an logging output pane with the results of the command while it runs.

Archiving a repository means create an archive file or subdirectory with the contents of the selected revision.

5.13.2. From command line

The archive tool can be started from command line

thg archive

The syntax is

thg archive -r [REV] -t [TYPE] [DEST]

where [REV] is the revision to archive, [TYPE] is the type of archive to create, and [DEST] is the name of the file or folder to create.

See hg.1.html#archive for details, or type hg help archive at the command line or in the Output Log of the Workbench.