2851
General Software Discussion / Re: Question re archiving/retrieving directories and subdirs using Mercurial
« Last post by Deozaan on July 12, 2015, 06:49 PM »Mercurial contains the entire repository history in that .hg folder. So the answer to your question is, yes, you can backup the .hg folder and reconstruct everything in the repository (at the date it was backed up) from that.
You would do it by running the update command to whichever revision you wanted. I use a GUI interface so I'm a little unsure about the exact command you'd run, but something like "hg update tip" should make the folder/file structure to be exactly as it was as of the most recent revision (at the time of backing up the .hg folder).
If you use something like TortoiseHg, you could visually browse the repository and manually update to specific revisions by right clicking the one you want and selecting Update from the context menu.
You may want to consider having copies of your repositories on a site like http://bitbucket.com/, which allows you to have private repos (for free) which will essentially automatically handle backing things up for you, as you can just push or pull to/from the bitbucket repo to backup/restore things.
You would do it by running the update command to whichever revision you wanted. I use a GUI interface so I'm a little unsure about the exact command you'd run, but something like "hg update tip" should make the folder/file structure to be exactly as it was as of the most recent revision (at the time of backing up the .hg folder).
If you use something like TortoiseHg, you could visually browse the repository and manually update to specific revisions by right clicking the one you want and selecting Update from the context menu.
You may want to consider having copies of your repositories on a site like http://bitbucket.com/, which allows you to have private repos (for free) which will essentially automatically handle backing things up for you, as you can just push or pull to/from the bitbucket repo to backup/restore things.

Recent Posts


