# HG changeset patch # User Johan Bjork # Date 1362436451 0 # Node ID f0d55e1b4855ffa79670c98f1731de598de4a648 # Parent b2a36e9b9ccc9b6187efa93970eac7547aeb9632 diff: fix binary file removals in git mode. With the previous version, a binary file removal diff generated with diff -r b2a36e9b9ccc -r f0d55e1b4855 mercurial/patch.py --- a/mercurial/patch.py Sun Mar 24 16:56:25 2013 -0700 +++ b/mercurial/patch.py Mon Mar 04 22:34:11 2013 +0000 @@ -1756,6 +1756,8 @@ else: header.append('deleted file mode %s\n' % gitmode[man1.flags(f)]) + if util.binary(to): + dodiff = 'binary' elif not to or util.binary(to): # regular diffs cannot represent empty file deletion losedatafn(f) diff -r b2a36e9b9ccc -r f0d55e1b4855 tests/test-diff-upgrade.t --- a/tests/test-diff-upgrade.t Sun Mar 24 16:56:25 2013 -0700 +++ b/tests/test-diff-upgrade.t Mon Mar 04 22:34:11 2013 +0000 @@ -200,7 +200,11 @@ % git=auto: git diff for rmbinary diff --git a/rmbinary b/rmbinary deleted file mode 100644 - Binary file rmbinary has changed + index f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000 + GIT binary patch + literal 0 + Hc$@