Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 848
vanna Avatar asked Mar 18 '13 13:03

vanna


2 Answers

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

like image 71
the_real_olaf Avatar answered Oct 19 '22 17:10

the_real_olaf


  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.
like image 8
smooth reggae Avatar answered Oct 19 '22 16:10

smooth reggae