vanna
vanna

Reputation: 1572

Exporting diffs without having to commit in Mercurial

I am using TortoiseHg GUI and it seems that there is no way to export diffs between my uncommited changes and the last revision. Is there a way to do it using hg ?

My requirements :

Upvotes: 10

Views: 3430

Answers (3)

the_real_olaf
the_real_olaf

Reputation: 61

It can be done very simply by a patch file via

hg diff > foo.patch

Then the patch can be applied on the other repo via

hg import --no-commit foo.patch

Upvotes: 6

Mark
Mark

Reputation: 462

From the command line hg diff will show the differences in the repository using the unified diff format.

Upvotes: 3

smooth reggae
smooth reggae

Reputation: 2219

  1. You could commit your changes, choose Export -> Export Patch from the context menu of the changeset and then rollback (Repository -> Rollback/Undo)
  2. Alternatively, you could select all the uncommitted changes and then choose the Copy Patch option in the context menu. This copies a patch for all your changes to your clipboard. Then open up your favourite text editor and paste the contents into the new buffer and save this as a patch.

Upvotes: 8

Related Questions