[Commits] (vajda) cleaned up saved status flags mess

commits at osafoundation.org commits at osafoundation.org
Mon Aug 30 17:19:58 PDT 2004


Commit by: vajda
Modified files:
chandler/repository/item/Item.py 1.155 1.156
chandler/repository/persistence/XMLRepositoryView.py 1.51 1.52

Log message:
cleaned up saved status flags mess

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/repository/item/Item.py.diff?r1=text&tr1=1.155&r2=text&tr2=1.156
http://cvs.osafoundation.org/index.cgi/chandler/repository/persistence/XMLRepositoryView.py.diff?r1=text&tr1=1.51&r2=text&tr2=1.52

Index: chandler/repository/persistence/XMLRepositoryView.py
diff -u chandler/repository/persistence/XMLRepositoryView.py:1.51 chandler/repository/persistence/XMLRepositoryView.py:1.52
--- chandler/repository/persistence/XMLRepositoryView.py:1.51	Mon Aug 30 14:27:16 2004
+++ chandler/repository/persistence/XMLRepositoryView.py	Mon Aug 30 17:19:56 2004
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.51 $"
-__date__      = "$Date: 2004/08/30 21:27:16 $"
+__revision__  = "$Revision: 1.52 $"
+__date__      = "$Date: 2004/08/31 00:19:56 $"
 __copyright__ = "Copyright (c) 2002 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -247,10 +247,8 @@
             for item in self._log:
                 if not item._status & Item.MERGED:
                     item._version = newVersion
-                item._status &= ~(Item.NEW | Item.DIRTY |
-                                  Item.MERGED | Item.SAVED)
-                item._values._clearDirties()
-                item._references._clearDirties()
+                item.setDirty(0, None)
+                item._status &= ~(Item.NEW | Item.MERGED | Item.SAVED)
             del self._log[:]
 
         if newVersion > self.version:
@@ -328,7 +326,7 @@
 
         store.saveItem(xml, uuid, newVersion,
                        (item.itsParent.itsUUID, item._name), origPN,
-                       item._status,
+                       item._status & Item.SAVEMASK,
                        item._values._getDirties(),
                        item._references._getDirties())
 

Index: chandler/repository/item/Item.py
diff -u chandler/repository/item/Item.py:1.155 chandler/repository/item/Item.py:1.156
--- chandler/repository/item/Item.py:1.155	Mon Aug 30 14:27:15 2004
+++ chandler/repository/item/Item.py	Mon Aug 30 17:19:56 2004
@@ -1,6 +1,6 @@
 
-__revision__  = "$Revision: 1.155 $"
-__date__      = "$Date: 2004/08/30 21:27:15 $"
+__revision__  = "$Revision: 1.156 $"
+__date__      = "$Date: 2004/08/31 00:19:56 $"
 __copyright__ = "Copyright (c) 2002 Open Source Applications Foundation"
 __license__   = "http://osafoundation.org/Chandler_0.1_license_terms.htm"
 
@@ -1349,8 +1349,11 @@
                         repository.logger.error('logging of new item %s failed', self.itsPath)
             else:
                 self._status |= dirty
+
         else:
-            self._status &= ~Item.DIRTY
+            self._status &= ~(Item.DIRTY | Item.ADIRTY)
+            self._values._clearDirties()
+            self._references._clearDirties()
 
         return False
 
@@ -2356,7 +2359,7 @@
     Nil        = nil()
     
     DELETED    = 0x0001
-    VDIRTY     = 0x0002           # literal value(s) changed
+    VDIRTY     = 0x0002           # literal or ref changed
     DELETING   = 0x0004
     RAW        = 0x0008
     ATTACHING  = 0x0010
@@ -2365,7 +2368,7 @@
     STALE      = 0x0080
     SDIRTY     = 0x0100           # name of sibling(s) changed
     CDIRTY     = 0x0200           # parent or first/last child changed
-    RDIRTY     = 0x0400           # ref or ref collection value changed
+    RDIRTY     = 0x0400           # ref collection changed
     MERGED     = 0x0800
     SAVED      = 0x1000
     ADIRTY     = 0x2000           # acl(s) changed
@@ -2373,7 +2376,8 @@
     NODIRTY    = 0x8000           # turn off dirtying
     
     VRDIRTY    = VDIRTY | RDIRTY
-    DIRTY      = VDIRTY | SDIRTY | CDIRTY | RDIRTY
+    DIRTY      = VDIRTY | RDIRTY | SDIRTY | CDIRTY
+    SAVEMASK   = DIRTY | ADIRTY | NEW | DELETED | SCHEMA
 
     __access__ = 0L
 



More information about the Commits mailing list