TortoiseHg - How to create patch without commit first

不问归期 提交于 2019-12-04 16:00:00

问题


When I want to create a patch on my local changeset, I really I have to first commit, any I can create the patch. May I know under TortoiseHg, how I can create a patch without performing commit?


回答1:


TortoiseHg 2.0.2: in workbench you can right-click on the Working Directory line and select Export / Copy patch from the contextual menu - the resulting diff will be placed in clipboard.

Of course, you won't have the changeset header and the commit message at the beginning of the patch like you will get from the same operation made on a commit:

# HG changeset patch
# User John Doe <john@doe.com>
# Date 1300889184 -7200
# Node ID 0050250004150030450034543labc23598235325
# Parent  098140937509174fbca7089686d986986e06f097
Sample commit message ...

Thanks to xanatos:

You can enable the "git format" for diffs (that include binary data) in the workbench: File->Settings->Compare->Git Format = True (the default value is unspecified, that seems to be equal to False)




回答2:


Is hg diff -g what you are looking for?

Taken from "How can I diff and patch files?" of https://developer.mozilla.org/en/Mercurial_FAQ




回答3:


for a single file in your workbench (tortoisehg), you click on you working directory and the in the file list pane, right click on the file, and as @alexandrul said click Copy Patch



来源:https://stackoverflow.com/questions/5406385/tortoisehg-how-to-create-patch-without-commit-first

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!