Search code examples
mercurialexportdiff

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 :

  • I do not want to commit my changes
  • I could copy the whole directory, commit, export, delete but the directory is quite heavy

Solution

    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.