1204 if fparent2 == nullid or crev is None: # copied on remote side |
1204 if fparent2 == nullid or crev is None: # copied on remote side |
1205 if cfname in manifest2: |
1205 if cfname in manifest2: |
1206 crev = manifest2[cfname] |
1206 crev = manifest2[cfname] |
1207 newfparent = fparent1 |
1207 newfparent = fparent1 |
1208 |
1208 |
1209 # find source in nearest ancestor if we've lost track |
1209 # Here, we used to search backwards through history to try to find |
1210 if not crev: |
1210 # where the file copy came from if the source of a copy was not in |
1211 self.ui.debug(" %s: searching for copy revision for %s\n" % |
1211 # the parent diretory. However, this doesn't actually make sense to |
1212 (fname, cfname)) |
1212 # do (what does a copy from something not in your working copy even |
1213 for ancestor in self[None].ancestors(): |
1213 # mean?) and it causes bugs (eg, issue4476). Instead, we will warn |
1214 if cfname in ancestor: |
1214 # the user that copy information was dropped, so if they didn't |
1215 crev = ancestor[cfname].filenode() |
1215 # expect this outcome it can be fixed, but this is the correct |
1216 break |
1216 # behavior in this circumstance. |
1217 |
1217 |
1218 if crev: |
1218 if crev: |
1219 self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev))) |
1219 self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev))) |
1220 meta["copy"] = cfname |
1220 meta["copy"] = cfname |
1221 meta["copyrev"] = hex(crev) |
1221 meta["copyrev"] = hex(crev) |