Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 873:4480e035d838
addremove was not correctly finding removed files when given
a list of files to look at. These end up with a src of 'f' from
walk() but no longer exist on the filesystem.
Index: mine/mercurial/commands.py
===================================================================
author | mason@suse.com |
---|---|
date | Fri, 12 Aug 2005 09:57:59 -0800 |
parents | 9a0af739cf55 |
children | d4cb383e7de7 |
comparison
equal
deleted
inserted
replaced
872:9a0af739cf55 | 873:4480e035d838 |
---|---|
394 def addremove(ui, repo, *pats, **opts): | 394 def addremove(ui, repo, *pats, **opts): |
395 """add all new files, delete all missing files""" | 395 """add all new files, delete all missing files""" |
396 q = dict(zip(pats, pats)) | 396 q = dict(zip(pats, pats)) |
397 add, remove = [], [] | 397 add, remove = [], [] |
398 for src, abs, rel in walk(repo, pats, opts): | 398 for src, abs, rel in walk(repo, pats, opts): |
399 if src == 'f': | 399 if src == 'f' and repo.dirstate.state(abs) == '?': |
400 if repo.dirstate.state(abs) == '?': | 400 add.append(abs) |
401 add.append(abs) | 401 if rel not in q: ui.status('adding ', rel, '\n') |
402 if rel not in q: ui.status('adding ', rel, '\n') | 402 if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel): |
403 elif repo.dirstate.state(abs) != 'r' and not os.path.exists(rel): | |
404 remove.append(abs) | 403 remove.append(abs) |
405 if rel not in q: ui.status('removing ', rel, '\n') | 404 if rel not in q: ui.status('removing ', rel, '\n') |
406 repo.add(add) | 405 repo.add(add) |
407 repo.remove(remove) | 406 repo.remove(remove) |
408 | 407 |