[PATCH 07 of 13] Use "f in dirstate" instead of "dirstate.state(f) == '?'"

Emanuele Aina faina.mail at tiscali.it
Tue Feb 27 01:06:07 CST 2007


# HG changeset patch
# User Emanuele Aina <em at nerd.ocracy.org>
# Date 1172563536 -3600
# Node ID b9949d8f4dbdd6296bcf85cb5924da10d1a63558
# Parent  f3c1feb50c63c43233c5d6ddfa70248cf73612a8
Use "f in dirstate" instead of "dirstate.state(f) == '?'"

diff --git a/contrib/purge/purge.py b/contrib/purge/purge.py
--- a/contrib/purge/purge.py
+++ b/contrib/purge/purge.py
@@ -65,9 +65,7 @@ class Purge(object):
             self._ui.warn(_('warning: %s\n') % msg)
 
     def _remove_file(self, name):
-        # dirstate.state() requires a path relative to the root
-        # directory.
-        if self._repo.dirstate.state(name) != '?':
+        if name in self._repo.dirstate:
             return
         self._ui.note(_('Removing file %s\n') % name)
         if self._act:


More information about the Mercurial-devel mailing list