Support hg export -g

Issue #3583 wontfix
Fernando Nájera
created an issue

We sometimes have to generate patch files. We do so by right-clicking on a revision, then Export, then Export patch.

Unfortunately, if the revision contains binary files, the patch is basically worthless, as it just contains a line saying that the file changed, but not the change itself.

diff -r rev1 -r rev2 some/file.png
Binary file some/file.png has changed

Unfortunately it often happens that we don't realize that there are indeed binary files, and we end up having patches lying around that won't work when needed.

Hg already provides option "-g" to generate git extended diff files, that contain the binary diffs. And as far as I can tell, both Hg and THg are happy to import those files too.

diff --git a/some/file.png b/some/file.png
index rev1..rev2
GIT binary patch
literal 111

The problem is, we need to see that there are binary files involved, and then, we need to use the output log / command line to generate the patch.

So I was wondering, why not... ...make use of the option "-g" always by default? (and maybe opt-out via configuration). Is there any reason (bad side-effect) for which this option is not 'on' by default? So far I have only see that it does Good Things (TM). ...give the user a way (how?) to choose if he wants the "-g" option everytime he exports (although duplicating menu entries and/or creating an extra dialog is not ideal) * up a warning dialog if the revision(s) have binary files, and ask him if he wants to use "-g" for this export?


Comments (4)

  1. Fernando Nájera reporter

    Oh I just realized there's a settings option for this!

    I still would like to see a warning dialog if this option is not set and there are binary files involved, if possible.

  2. Log in to comment