Show More
@@ -298,7 +298,8 b' def addremove(repo, pats=[], opts={}, dr' | |||
|
298 | 298 | dry_run = opts.get('dry_run') |
|
299 | 299 | if similarity is None: |
|
300 | 300 | similarity = float(opts.get('similarity') or 0) |
|
301 | unknown, deleted = [], [] | |
|
301 | # we'd use status here, except handling of symlinks and ignore is tricky | |
|
302 | added, unknown, deleted, removed = [], [], [], [] | |
|
302 | 303 | audit_path = util.path_auditor(repo.root) |
|
303 | 304 | m = match(repo, pats, opts) |
|
304 | 305 | for abs in repo.walk(m): |
@@ -314,16 +315,22 b' def addremove(repo, pats=[], opts={}, dr' | |||
|
314 | 315 | unknown.append(abs) |
|
315 | 316 | if repo.ui.verbose or not exact: |
|
316 | 317 | repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) |
|
317 | if repo.dirstate[abs] != 'r' and (not good or not util.lexists(target) | |
|
318 | elif repo.dirstate[abs] != 'r' and (not good or not util.lexists(target) | |
|
318 | 319 | or (os.path.isdir(target) and not os.path.islink(target))): |
|
319 | 320 | deleted.append(abs) |
|
320 | 321 | if repo.ui.verbose or not exact: |
|
321 | 322 | repo.ui.status(_('removing %s\n') % ((pats and rel) or abs)) |
|
323 | # for finding renames | |
|
324 | elif repo.dirstate[abs] == 'r': | |
|
325 | removed.append(abs) | |
|
326 | elif repo.dirstate[abs] == 'a': | |
|
327 | added.append(abs) | |
|
322 | 328 | if not dry_run: |
|
323 | 329 | repo.remove(deleted) |
|
324 | 330 | repo.add(unknown) |
|
325 | 331 | if similarity > 0: |
|
326 |
for old, new, score in findrenames(repo, unknown, |
|
|
332 | for old, new, score in findrenames(repo, added + unknown, | |
|
333 | removed + deleted, similarity): | |
|
327 | 334 | if repo.ui.verbose or not m.exact(old) or not m.exact(new): |
|
328 | 335 | repo.ui.status(_('recording removal of %s as rename to %s ' |
|
329 | 336 | '(%d%% similar)\n') % |
General Comments 0
You need to be logged in to leave comments.
Login now