diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1756,6 +1756,8 @@ def trydiff(repo, revs, ctx1, ctx2, modi 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 --git a/tests/test-diff-upgrade.t b/tests/test-diff-upgrade.t --- a/tests/test-diff-upgrade.t +++ b/tests/test-diff-upgrade.t @@ -200,7 +200,11 @@ git=auto: regular diff for regular files % 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$@