Rev 4064: Teach trace+ to log rmdir and put_bytes_non_atomic calls. in http://people.ubuntu.com/~robertc/baz2.0/pending/more-trace

Robert Collins robertc at robertcollins.net
Wed Mar 4 22:59:26 GMT 2009


At http://people.ubuntu.com/~robertc/baz2.0/pending/more-trace

------------------------------------------------------------
revno: 4064
revision-id: robertc at robertcollins.net-20090304225918-epumzj9y3f37m0ks
parent: pqm at pqm.ubuntu.com-20090227165204-wtg2koex221f2g8b
committer: Robert Collins <robertc at robertcollins.net>
branch nick: more-trace
timestamp: Thu 2009-03-05 09:59:18 +1100
message:
  Teach trace+ to log rmdir and put_bytes_non_atomic calls.
=== modified file 'NEWS'
--- a/NEWS	2009-02-27 08:29:09 +0000
+++ b/NEWS	2009-03-04 22:59:18 +0000
@@ -175,6 +175,9 @@
     * There is a RemoteSink object which handles pushing to smart servers.
       (Andrew Bennetts, Robert Collins)
 
+    * ``TransportTraceDecorator`` now logs ``put_bytes_non_atomic`` and
+      ``rmdir`` calls. (Robert Collins)
+
     * ``VersionedFiles`` record adapters have had their signature change
       from ``(record, record.get_bytes_as(record.storage_kind))`` to
       ``(record)`` reducing excess duplication and allowing adapters

=== modified file 'bzrlib/transport/trace.py'
--- a/bzrlib/transport/trace.py	2009-01-17 01:30:58 +0000
+++ b/bzrlib/transport/trace.py	2009-03-04 22:59:18 +0000
@@ -104,6 +104,14 @@
         self._trace(('put_bytes', relpath, len(bytes), mode))
         return self._decorated.put_bytes(relpath, bytes, mode)
 
+    def put_bytes_non_atomic(self, relpath, bytes, mode=None,
+        create_parent_dir=False, dir_mode=None):
+        """See Transport.put_bytes_non_atomic."""
+        self._trace(('put_bytes_non_atomic', relpath, len(bytes), mode,
+            create_parent_dir, dir_mode))
+        return self._decorated.put_bytes_non_atomic(relpath, bytes, mode=mode,
+            create_parent_dir=create_parent_dir, dir_mode=dir_mode)
+
     def listable(self):
         """See Transport.listable."""
         return self._decorated.listable()
@@ -134,6 +142,7 @@
 
     def rmdir(self, relpath):
         """See Transport.rmdir."""
+        self._trace(('rmdir', relpath))
         return self._decorated.rmdir(relpath)
 
     def stat(self, relpath):




More information about the bazaar-commits mailing list