Search code examples
tortoisehg

TortoiseHg - How to create patch without committing first


When I want to create a patch from uncommitted changes, do I really have to first commit? Does TortoiseHg not allow creating a patch without performing a commit?


Solution

  • 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)