Rev 4079: (robertc) Add put_bytes_non_atomic and rmdir to the trace+ transport in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Mar 5 03:30:34 GMT 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4079
revision-id: pqm at pqm.ubuntu.com-20090305033030-065loicjpjmivxq1
parent: pqm at pqm.ubuntu.com-20090304163710-r7hhqdi9f3jsbe5g
parent: robertc at robertcollins.net-20090304225918-epumzj9y3f37m0ks
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2009-03-05 03:30:30 +0000
message:
  (robertc) Add put_bytes_non_atomic and rmdir to the trace+ transport
  	decorator. (Robert Collins)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/transport/trace.py      trace.py-20070828055009-7kt0bbc4t4b92apz-1
    ------------------------------------------------------------
    revno: 4063.2.1
    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:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/transport/trace.py      trace.py-20070828055009-7kt0bbc4t4b92apz-1
=== modified file 'NEWS'
--- a/NEWS	2009-03-04 16:37:10 +0000
+++ b/NEWS	2009-03-05 03:30:30 +0000
@@ -214,6 +214,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