[PATCH 1 of 2 STABLE] context: make workingctx.forget() really warn about untracked files

Patrick Mezard patrick at mezard.eu
Thu Feb 16 12:06:04 UTC 2012


# HG changeset patch
# User Patrick Mezard <patrick at mezard.eu>
# Date 1329393408 -3600
# Branch stable
# Node ID bf3f2bbe11bc76124b9d8fa98ed71ed2ed41d60b
# Parent  6344043924497cd06d781d9014c66802285072e4
context: make workingctx.forget() really warn about untracked files

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -869,12 +869,12 @@
         wlock = self._repo.wlock()
         try:
             for f in files:
-                if self._repo.dirstate[f] != 'a':
+                if f not in self._repo.dirstate:
+                    self._repo.ui.warn(_("%s not tracked!\n") % f)
+                elif self._repo.dirstate[f] == 'a':
+                    self._repo.dirstate.drop(f)
+                else:
                     self._repo.dirstate.remove(f)
-                elif f not in self._repo.dirstate:
-                    self._repo.ui.warn(_("%s not tracked!\n") % f)
-                else:
-                    self._repo.dirstate.drop(f)
         finally:
             wlock.release()
 



More information about the Mercurial-devel mailing list