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.
create the recover file hg-recover.tar.gz, current working directory must be a mercurial working copy:
hg-recover.py -c
recreate a repository from the file hg-recover.tar.gz:
hg-recover.py -r
recreate a repository from a file [file]:
hg-recover.py -r -f [file]
create a recover file for a specified central repository:
hg-recover.py -c --central-repo [central repository]
create a recover file with a given name:
hg-recover.py -c -f [myfile].tar.gz
create a recover file with a given name and a given working copy:
hg-recover.py -c -f [myfile].tar.gz -w [working copy directory]
create a recover directory with a given name. If the parameter after "-f" doesn't end with ".tar.gz", the recover directory is not packed into compressed tar file:
hg-recover.py -c -f [myfile]
recreate a repository in a given directory from a recovery file:
hg-recover.py -r -f [file] -w [directory]
--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 |