Show More
@@ -298,7 +298,8 b' def addremove(repo, pats=[], opts={}, dr' | |||||
298 | dry_run = opts.get('dry_run') |
|
298 | dry_run = opts.get('dry_run') | |
299 | if similarity is None: |
|
299 | if similarity is None: | |
300 | similarity = float(opts.get('similarity') or 0) |
|
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 | audit_path = util.path_auditor(repo.root) |
|
303 | audit_path = util.path_auditor(repo.root) | |
303 | m = match(repo, pats, opts) |
|
304 | m = match(repo, pats, opts) | |
304 | for abs in repo.walk(m): |
|
305 | for abs in repo.walk(m): | |
@@ -314,16 +315,22 b' def addremove(repo, pats=[], opts={}, dr' | |||||
314 | unknown.append(abs) |
|
315 | unknown.append(abs) | |
315 | if repo.ui.verbose or not exact: |
|
316 | if repo.ui.verbose or not exact: | |
316 | repo.ui.status(_('adding %s\n') % ((pats and rel) or abs)) |
|
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 | or (os.path.isdir(target) and not os.path.islink(target))): |
|
319 | or (os.path.isdir(target) and not os.path.islink(target))): | |
319 | deleted.append(abs) |
|
320 | deleted.append(abs) | |
320 | if repo.ui.verbose or not exact: |
|
321 | if repo.ui.verbose or not exact: | |
321 | repo.ui.status(_('removing %s\n') % ((pats and rel) or abs)) |
|
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 | if not dry_run: |
|
328 | if not dry_run: | |
323 | repo.remove(deleted) |
|
329 | repo.remove(deleted) | |
324 | repo.add(unknown) |
|
330 | repo.add(unknown) | |
325 | if similarity > 0: |
|
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 | if repo.ui.verbose or not m.exact(old) or not m.exact(new): |
|
334 | if repo.ui.verbose or not m.exact(old) or not m.exact(new): | |
328 | repo.ui.status(_('recording removal of %s as rename to %s ' |
|
335 | repo.ui.status(_('recording removal of %s as rename to %s ' | |
329 | '(%d%% similar)\n') % |
|
336 | '(%d%% similar)\n') % |
General Comments 0
You need to be logged in to leave comments.
Login now