涂抹一个补丁

TortoiseHg 允许您将您的更改通过电子邮件发送给某人,但它是否支持应用补丁?

如果是这样,如何使用 TortoiseHg 应用补丁?

46188 次浏览

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...

From Repository Explorer, Repository > Import...

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

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.