Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
12574:77600d697d0e | 12575:9b3913baba0c |
---|---|
1586 and copy[copyto[f]] == f)): | 1586 and copy[copyto[f]] == f)): |
1587 dodiff = False | 1587 dodiff = False |
1588 else: | 1588 else: |
1589 header.append('deleted file mode %s\n' % | 1589 header.append('deleted file mode %s\n' % |
1590 gitmode[man1.flags(f)]) | 1590 gitmode[man1.flags(f)]) |
1591 elif not to: | 1591 elif not to or util.binary(to): |
1592 # regular diffs cannot represent empty file deletion | 1592 # regular diffs cannot represent empty file deletion |
1593 losedatafn(f) | 1593 losedatafn(f) |
1594 else: | 1594 else: |
1595 oflag = man1.flags(f) | 1595 oflag = man1.flags(f) |
1596 nflag = ctx2.flags(f) | 1596 nflag = ctx2.flags(f) |