Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TortoiseHg - How to create patch without commit first

Tags:

tortoisehg

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?

like image 228
Cheok Yan Cheng Avatar asked Mar 23 '11 14:03

Cheok Yan Cheng


People also ask

How do you apply a TortoiseHg patch?

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. Thanks for the suggestion.

How do you commit in TortoiseHg?

Commit. Explorer: right-clicking anywhere in the folder, or on the folder itself, and then selecting Hg Commit… Write a commit message, select the files you wish to commit, then press Commit. Your previous commit message will be in the message history drop-down, so you do not have to type it in again from scratch.

How to merge Tortoise hg?

Once all the conflicts are resolved you can close TortoiseHg's resolve conflicts dialog and click next on the merge window. On this next screen you can enter the commit message and then click Commit Now . You are now done.


2 Answers

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 <[email protected]>
# 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)

like image 160
alexandrul Avatar answered Sep 19 '22 13:09

alexandrul


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

like image 28
xanatos Avatar answered Sep 20 '22 13:09

xanatos