Mercurial > hg
comparison mercurial/patch.py @ 12574:77600d697d0e stable
patch: fix rename text to binary file (issue2400)
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 27 Sep 2010 22:47:10 +0200 |
parents | b6173aee4a47 |
children | 9b3913baba0c |
comparison
equal
deleted
inserted
replaced
12571:2702bea2ee76 | 12574:77600d697d0e |
---|---|
1182 elif state == 'git': | 1182 elif state == 'git': |
1183 for gp in values: | 1183 for gp in values: |
1184 gp.path = pathstrip(gp.path, strip - 1)[1] | 1184 gp.path = pathstrip(gp.path, strip - 1)[1] |
1185 if gp.oldpath: | 1185 if gp.oldpath: |
1186 gp.oldpath = pathstrip(gp.oldpath, strip - 1)[1] | 1186 gp.oldpath = pathstrip(gp.oldpath, strip - 1)[1] |
1187 if gp.op in ('COPY', 'RENAME'): | 1187 # Binary patches really overwrite target files, copying them |
1188 # will just make it fails with "target file exists" | |
1189 if gp.op in ('COPY', 'RENAME') and not gp.binary: | |
1188 copyfn(gp.oldpath, gp.path, cwd) | 1190 copyfn(gp.oldpath, gp.path, cwd) |
1189 changed[gp.path] = gp | 1191 changed[gp.path] = gp |
1190 else: | 1192 else: |
1191 raise util.Abort(_('unsupported parser state: %s') % state) | 1193 raise util.Abort(_('unsupported parser state: %s') % state) |
1192 | 1194 |