[Zope3-checkins] CVS: Zope3/src/zope/app/browser/content - fssync.py:1.10

Guido van Rossum guido@python.org
Thu, 15 May 2003 18:10:51 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/content
In directory cvs.zope.org:/tmp/cvs-serv11897

Modified Files:
	fssync.py 
Log Message:
Set the transaction note to "fssync".  (Changing it in the request
doesn't quite work because of the content-type: application/zip in the
request, which stops cgi.py from parsing the URL. :-( )


=== Zope3/src/zope/app/browser/content/fssync.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/content/fssync.py:1.9	Thu May 15 13:32:45 2003
+++ Zope3/src/zope/app/browser/content/fssync.py	Thu May 15 18:10:50 2003
@@ -21,6 +21,8 @@
 import shutil
 import tempfile
 
+from transaction import get_transaction
+
 from zope.fssync.compare import checkUptodate
 
 from zope.publisher.browser import BrowserView
@@ -141,6 +143,10 @@
             return "\n".join(errors)
 
     def do_commit(self, zipdata):
+        # 000) Set transaction note
+        note = self.request.get("note") or "fssync"
+        if note:
+            get_transaction().note(note)
         # 00) Allocate temporary names
         topdir = tempfile.mktemp()
         zipfilename = os.path.join(topdir, "working.zip")