[patch 02/10] addremove was not correctly finding removed files when given

Chris Mason mason at suse.com
Tue Aug 9 12:42:55 CDT 2005


# HG changeset patch
# User mason at suse.com

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
===================================================================
--- mine.orig/mercurial/commands.py	2005-08-05 11:34:10.000000000 -0400
+++ mine/mercurial/commands.py	2005-08-07 12:17:45.000000000 -0400
@@ -356,11 +356,10 @@ def addremove(ui, repo, *pats, **opts):
     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)

--


More information about the Mercurial mailing list