changeset 16111:131d1a09108a stable

context: make workingctx.forget() really warn about untracked files
author Patrick Mezard <patrick@mezard.eu>
date Thu, 16 Feb 2012 12:56:48 +0100
parents 41417443b7d0
children d7829b2ecf32
files mercurial/context.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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