context: make workingctx.forget() really warn about untracked files stable
authorPatrick Mezard <patrick@mezard.eu>
Thu, 16 Feb 2012 12:56:48 +0100
branchstable
changeset 16111 131d1a09108a
parent 16110 41417443b7d0
child 16112 d7829b2ecf32
context: make workingctx.forget() really warn about untracked files
mercurial/context.py
--- a/mercurial/context.py	Wed Feb 15 23:01:09 2012 +0900
+++ b/mercurial/context.py	Thu Feb 16 12:56:48 2012 +0100
@@ -906,11 +906,11 @@
         try:
             rejected = []
             for f in files:
-                if self._repo.dirstate[f] != 'a':
-                    self._repo.dirstate.remove(f)
-                elif f not in self._repo.dirstate:
+                if f not in self._repo.dirstate:
                     self._repo.ui.warn(_("%s not tracked!\n") % join(f))
                     rejected.append(f)
+                elif self._repo.dirstate[f] != 'a':
+                    self._repo.dirstate.remove(f)
                 else:
                     self._repo.dirstate.drop(f)
             return rejected