[Commits] (pavlov) keep track of the shared uuid so that we don't overwrite it and confuse ourselves

commits at osafoundation.org commits at osafoundation.org
Mon Aug 23 17:23:10 PDT 2004


Commit by: pavlov
Modified files:
chandler/parcels/osaf/framework/webdav/Sync.py 1.14 1.15

Log message:
keep track of the shared uuid so that we don't overwrite it and confuse ourselves


ViewCVS links:
http://cvs.osafoundation.org/index.cgi/chandler/parcels/osaf/framework/webdav/Sync.py.diff?r1=text&tr1=1.14&r2=text&tr2=1.15

Index: chandler/parcels/osaf/framework/webdav/Sync.py
diff -u chandler/parcels/osaf/framework/webdav/Sync.py:1.14 chandler/parcels/osaf/framework/webdav/Sync.py:1.15
--- chandler/parcels/osaf/framework/webdav/Sync.py:1.14	Mon Aug 23 16:49:01 2004
+++ chandler/parcels/osaf/framework/webdav/Sync.py	Mon Aug 23 17:23:08 2004
@@ -96,12 +96,17 @@
     kind = item.itsKind
 
     # build a giant property string and then do a PROPPATCH
+
+    # we don't ever want to actually change the UUID value on the server
+    # so if we already have one here use it
+    uuid = item.getAttributeValue('sharedUUID', default=item.itsUUID)
     props = makePropString('kind', '//core', kind.itsPath) + \
-            makePropString('uuid', '//core', item.itsUUID.str16())
+            makePropString('uuid', '//core', uuid)
 
     for (name, value) in item.iterAttributeValues():
         # don't export these local attributes
-        if name in [u'etag', u'lastModified', u'sharedVersion', u'sharedURL']:
+        if name in [u'etag', u'lastModified', u'sharedVersion',
+                    u'sharedURL', u'sharedUUID']:
             continue
 
         # the attribute's namespace is its path...
@@ -134,7 +139,7 @@
                 except AttributeError:
                     durl = defaultURL
                     print 'Cant export %s -- Not a ContentItem' % (str(value))
-                    
+
                 props += makePropString(name, namespace, '<itemref>%s</itemref>' % (unicode(durl)))
                     
             else:
@@ -283,6 +288,7 @@
         kind = davItem.itsKind
         newItem = kind.newItem(None, repository.findPath('//userdata/contentitems'))
         newItem.sharedURL = dav.url
+        newItem.sharedUUID = origUUID
         # set the version to avoid sync thinking there are local changes
         newItem.sharedVersion = newItem._version
         # set a bogus etag so it doesn't try to put



More information about the Commits mailing list