[Zope3-checkins] CVS: Zope3/src/zope/app/browser/content - fssync.py:1.9
Guido van Rossum
guido@python.org
Thu, 15 May 2003 13:33:16 -0400
Update of /cvs-repository/Zope3/src/zope/app/browser/content
In directory cvs.zope.org:/tmp/cvs-serv5966/browser/content
Modified Files:
fssync.py
Log Message:
Matching hacks to support committing the root folder.
This doesn't make any changes to the root folder, but commits its contents.
=== Zope3/src/zope/app/browser/content/fssync.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/browser/content/fssync.py:1.8 Tue May 13 15:49:12 2003
+++ Zope3/src/zope/app/browser/content/fssync.py Thu May 15 13:32:45 2003
@@ -25,7 +25,7 @@
from zope.publisher.browser import BrowserView
from zope.app.fssync.syncer import toFS, fromFS
-from zope.app.traversing import objectName, getParent
+from zope.app.traversing import objectName, getParent, getRoot
from zope.app.interfaces.exceptions import UserError
class ZipFile(BrowserView):
@@ -169,6 +169,9 @@
# 5) Now call fromFS()
name = objectName(self.context)
container = getParent(self.context)
+ if container is None and name == "":
+ # Hack to get loading the root to work; see top of fromFS().
+ container = getRoot(self.context)
fromFS(container, name, working)
# 6) Return success
return []