diff mercurial/patch.py @ 12575:9b3913baba0c stable

patch: upgrade to git patch when removing binary file Otherwise it may cause data loss when removing binary files in mq with --git=auto.
author Patrick Mezard <pmezard@gmail.com>
date Tue, 28 Sep 2010 00:41:07 +0200
parents 77600d697d0e
children 1c9bb7e00f71
line wrap: on
line diff
--- a/mercurial/patch.py	Mon Sep 27 22:47:10 2010 +0200
+++ b/mercurial/patch.py	Tue Sep 28 00:41:07 2010 +0200
@@ -1588,7 +1588,7 @@
                     else:
                         header.append('deleted file mode %s\n' %
                                       gitmode[man1.flags(f)])
-                elif not to:
+                elif not to or util.binary(to):
                     # regular diffs cannot represent empty file deletion
                     losedatafn(f)
             else: