changeset 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
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Fri Aug 12 07:10:21 2005 -0800
+++ b/mercurial/commands.py	Fri Aug 12 07:12:08 2005 -0800
@@ -393,11 +393,10 @@
     q = dict(zip(pats, pats))
     add, remove = [], []
     for src, abs, rel in walk(repo, pats, opts):
-        if src == 'f':
-            if repo.dirstate.state(abs) == '?':
-                add.append(abs)
-                if rel not in q: ui.status('adding ', rel, '\n')
-        elif repo.dirstate.state(abs) != 'r' and not os.path.exists(rel):
+        if src == 'f' and repo.dirstate.state(abs) == '?':
+            add.append(abs)
+            if rel not in q: ui.status('adding ', rel, '\n')
+        if repo.dirstate.state(abs) != 'r' and not os.path.exists(rel):
             remove.append(abs)
             if rel not in q: ui.status('removing ', rel, '\n')
     repo.add(add)