Search code examples
mercurialtortoisehg

Move changesets to different machine


I am using TortoiseHg and I have some changesets in draft mode and now due to some reasons I am in a situation to use a different machine.

So, is there any way to like take a backup and restore my changesets on a new machine?

Since I'm not sure about fetching the draft mode changsets on a different machine.


Solution

  • You can do this regardless of the phase (public/draft/secret) of the changeset - I do it all the time at my work using patches.

    For this you will need the "mq" extension (installed but not enabled by default) turned on from your settings. (actually, you can do this without mq)

    Take the following steps, working your way from the first draft changeset (i.e. the one whose parent is public) to the last draft changeset (i.e. the one which is at the head):

    1. Right click on a single changeset in the source repository and select Export/Copy patch, the output of which you can paste into a text file. Repeat this n times to get the patches you want to copy.

    2. Transfer those text files to the other machine, then select Repository/Import on the target repository then import the changeset. Repeat this (in the order the changesets were exported) to recreate the same history as on the source repository.