mercurial/cmdutil.py
changeset 5487 7a64931e2d76
parent 5248 5517aa5aafb0
child 5545 5a124ce4602a
equal deleted inserted replaced
5486:48c22c719f8c 5487:7a64931e2d76
   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: