mercurial/patch.py
branchstable
changeset 12574 77600d697d0e
parent 12344 b6173aee4a47
child 12575 9b3913baba0c
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