[Zope-CVS] CVS: Products/AdaptableStorage/gateway_fs - FSAutoId.py:1.5

Shane Hathaway shane@zope.com
Fri, 10 Jan 2003 13:31:43 -0500


Update of /cvs-repository/Products/AdaptableStorage/gateway_fs
In directory cvs.zope.org:/tmp/cvs-serv2666/gateway_fs

Modified Files:
	FSAutoId.py 
Log Message:
Made move/rename work with objects from the filesystem.  It took some tricks,
but the tricks have unit tests, so it's not so bad. :-)

- Improved reporting of errors in failed attempts to move objects.

- Added a _setOb() patch that copies objects instead of moving or renaming
them, if that's the only thing that can be done.

- Refactored ZODB branch copying into a simple function, copyOf().

- Made FolderItems set a marker that indicates to _setOb() that it has to
copy rather than move.

Since SQL gateways use FolderItemsByKeychain instead of FolderItems, it has
always been possible to move/rename in a SQL database.  None of these
changes affect SQL operations.


=== Products/AdaptableStorage/gateway_fs/FSAutoId.py 1.4 => 1.5 ===
--- Products/AdaptableStorage/gateway_fs/FSAutoId.py:1.4	Tue Dec 31 16:47:44 2002
+++ Products/AdaptableStorage/gateway_fs/FSAutoId.py	Fri Jan 10 13:31:10 2003
@@ -41,6 +41,7 @@
 
     def store(self, event, state):
         id = self.getIdFrom(event)
-        assert state == id, 'Mismatched file ID'
+        if state != id:
+            raise ValueError('Mismatched file ID')
         return id