exception-safe Component.is_dirty()
authorTimo Savola <tsavola@movial.fi>
Mon, 14 Apr 2008 15:48:48 +0000 (18:48 +0300)
committerTimo Savola <tsavola@movial.fi>
Mon, 14 Apr 2008 15:48:48 +0000 (18:48 +0300)
matrix/components.py

index 6f20b4c..ce8cf67 100644 (file)
@@ -49,11 +49,14 @@ class Component(object):
 
        def is_dirty(self):
                if self.__dirty is None:
-                       self.__dirty = False
                        for repo in (self.source, self.meta):
                                if repo.dirty_files():
                                        self.__dirty = True
                                        break
+
+                       if self.__dirty is None:
+                               self.__dirty = False
+
                return self.__dirty
 
        def add_depend(self, c):