changeset 4522:591322269fed

Use absolute paths in addremove. This is more consistent with other places in the code, which only use the "relpath" returned by cmdutil.walk for display purposes.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Fri, 08 Jun 2007 23:49:12 -0300
parents d634b61e9cec
children b9d311928caf
files mercurial/cmdutil.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -186,13 +186,15 @@ def addremove(repo, pats=[], opts={}, wl
     add, remove = [], []
     mapping = {}
     for src, abs, rel, exact in walk(repo, pats, opts):
+        target = repo.wjoin(abs)
         if src == 'f' and repo.dirstate.state(abs) == '?':
             add.append(abs)
             mapping[abs] = rel, exact
             if repo.ui.verbose or not exact:
                 repo.ui.status(_('adding %s\n') % ((pats and rel) or abs))
-        islink = os.path.islink(rel)
-        if repo.dirstate.state(abs) != 'r' and not islink and not os.path.exists(rel):
+        islink = os.path.islink(target)
+        if (repo.dirstate.state(abs) != 'r' and not islink
+            and not os.path.exists(target)):
             remove.append(abs)
             mapping[abs] = rel, exact
             if repo.ui.verbose or not exact: