comparison mercurial/commands.py @ 880:409a9a7b0da2

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 07:12:08 -0800
parents 953ccddd57bd
children 63ca8a68d59e
comparison
equal deleted inserted replaced
879:953ccddd57bd 880:409a9a7b0da2
391 def addremove(ui, repo, *pats, **opts): 391 def addremove(ui, repo, *pats, **opts):
392 """add all new files, delete all missing files""" 392 """add all new files, delete all missing files"""
393 q = dict(zip(pats, pats)) 393 q = dict(zip(pats, pats))
394 add, remove = [], [] 394 add, remove = [], []
395 for src, abs, rel in walk(repo, pats, opts): 395 for src, abs, rel in walk(repo, pats, opts):
396 if src == 'f': 396 if src == 'f' and repo.dirstate.state(abs) == '?':
397 if repo.dirstate.state(abs) == '?': 397 add.append(abs)
398 add.append(abs) 398 if rel not in q: ui.status('adding ', rel, '\n')
399 if rel not in q: ui.status('adding ', rel, '\n') 399 if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel):
400 elif repo.dirstate.state(abs) != 'r' and not os.path.exists(rel):
401 remove.append(abs) 400 remove.append(abs)
402 if rel not in q: ui.status('removing ', rel, '\n') 401 if rel not in q: ui.status('removing ', rel, '\n')
403 repo.add(add) 402 repo.add(add)
404 repo.remove(remove) 403 repo.remove(remove)
405 404