264 if src == 'f' and abs not in repo.dirstate: |
264 if src == 'f' and abs not in repo.dirstate: |
265 add.append(abs) |
265 add.append(abs) |
266 mapping[abs] = rel, exact |
266 mapping[abs] = rel, exact |
267 if repo.ui.verbose or not exact: |
267 if repo.ui.verbose or not exact: |
268 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) |
268 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) |
269 if repo.dirstate[abs] != 'r' and not util.lexists(target): |
269 if repo.dirstate[abs] != 'r' and (not util.lexists(target) |
|
270 or (os.path.isdir(target) and not os.path.islink(target))): |
270 remove.append(abs) |
271 remove.append(abs) |
271 mapping[abs] = rel, exact |
272 mapping[abs] = rel, exact |
272 if repo.ui.verbose or not exact: |
273 if repo.ui.verbose or not exact: |
273 repo.ui.status(_('removing %s\n') % ((pats and rel) or abs)) |
274 repo.ui.status(_('removing %s\n') % ((pats and rel) or abs)) |
274 if not dry_run: |
275 if not dry_run: |
|
276 repo.remove(remove) |
275 repo.add(add) |
277 repo.add(add) |
276 repo.remove(remove) |
|
277 if similarity > 0: |
278 if similarity > 0: |
278 for old, new, score in findrenames(repo, add, remove, similarity): |
279 for old, new, score in findrenames(repo, add, remove, similarity): |
279 oldrel, oldexact = mapping[old] |
280 oldrel, oldexact = mapping[old] |
280 newrel, newexact = mapping[new] |
281 newrel, newexact = mapping[new] |
281 if repo.ui.verbose or not oldexact or not newexact: |
282 if repo.ui.verbose or not oldexact or not newexact: |