TortoiseHg Apply a Patch

MercurialPatchTortoisehg

Mercurial Problem Overview


TortoiseHg allows you to email a patch file of your changes to someone, but does it support applying patches?

If so, how do you apply a patch using TortoiseHg?

Mercurial Solutions


Solution 1 - Mercurial

From Repository Explorer, Repository > Import...

Solution 2 - Mercurial

It looks like there is no built-in support in TortoiseHg for this. Try this from a command prompt:

hg import my-patch-file.patch

That should apply the patch to your Mercurial repo and working copy.

First Stab Answer

You should be able to right-click on the patch file and choose "Apply patch..." - that's how it works for other TortoiseX clients. Make sure that you save the patch file to the same directory path it was generated from.

Downloading TortoiseHg 0.8.1 to test...

Solution 3 - Mercurial

What may be also noteworthy is, that "Repository Explorer, Synchronize > Import..." (which internally does a "hg import") will automatically do a "commit" - this may not be always wanted behaviour.

Other possibility is to use unix "patch" command (on Windows perhaps use cygwin version) or use "hg import" directly with "--no-commit" option. Both will just make changes in working directory and you may review the changes and commit them later manually.

Solution 4 - Mercurial

In 1.0, from Workbench: Repository > Import...

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMichael La VoieView Question on Stackoverflow
Solution 1 - MercurialTim ScottView Answer on Stackoverflow
Solution 2 - MercurialWill BickfordView Answer on Stackoverflow
Solution 3 - MercurialNightingale7View Answer on Stackoverflow
Solution 4 - MercurialyuziseeView Answer on Stackoverflow