hg-recover.py

a tool to backup and recover local mercurial working copies

Overview

This tool can be used to backup and recover a mercurial working copy complete with the mercurial repository.

Instead of saving the complete repository this script only saves differences relative to a central mercurial repository. By this, much disk space is saved, the backup file has usually only about 100kBytes or less.

If the backed up repository uses mq patch queues, the tool saves and restores all applied patches, too. Note that the unapplied patches, however, are not saved.

Quick reference

More examples

Reference of command line options

--version show program's version number and exit
-h, --help show the online-help an exit
--summary print a summary of the function of the program
--doc create online help in restructured text format. Use "./hg-recover.py --doc | rst2html" to create html-help"
-f FILENAME, --file=FILENAME
 create mercurial recovery data in the given file or directory. If the given name ends with ".tar" or ".tag.gz", a tar file or a compressed tar file is created. The default for this is "hg-recover.tar.gz"
-w WORKINGCOPY, --working-copy=WORKINGCOPY
 specify where the WORKINGCOPY is found, "." is the default. For --recover, this is the directory where the working copy directory will be created as a sub- directory.
-c, --create create mercurial recovery data in the given DATA_DIRECTORY. If the given name ends with ".tar" or ".tag.gz", a tar file or a compressed tar file is created.
-r, --recover recover repository from the recovery data in the given DATA_DIRECTORY
--central-repo=CENTRALREPOSITORY
 specify the CENTRALREPOSITORY
-v, --verbose print to the screen what the program does
--dry-run do not apply any changes