~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/trace.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-25 21:13:22 UTC
  • mto: This revision was merged to the branch mainline in revision 4051.
  • Revision ID: john@arbash-meinel.com-20090225211322-qc94czk3s1g7nliq
Some direct tests for _group_keys_for_io

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Implementation of Transport that traces transport operations.
18
18
 
33
33
    Not all operations are logged at this point, if you need an unlogged
34
34
    operation please add a test to the tests of this transport, for the logging
35
35
    of the operation you want logged.
36
 
 
37
 
    See also TransportLogDecorator, that records a machine-readable log in 
38
 
    memory for eg testing.
39
36
    """
40
37
 
41
38
    def __init__(self, url, _decorated=None, _from_transport=None):
107
104
        self._trace(('put_bytes', relpath, len(bytes), mode))
108
105
        return self._decorated.put_bytes(relpath, bytes, mode)
109
106
 
110
 
    def put_bytes_non_atomic(self, relpath, bytes, mode=None,
111
 
        create_parent_dir=False, dir_mode=None):
112
 
        """See Transport.put_bytes_non_atomic."""
113
 
        self._trace(('put_bytes_non_atomic', relpath, len(bytes), mode,
114
 
            create_parent_dir, dir_mode))
115
 
        return self._decorated.put_bytes_non_atomic(relpath, bytes, mode=mode,
116
 
            create_parent_dir=create_parent_dir, dir_mode=dir_mode)
117
 
 
118
107
    def listable(self):
119
108
        """See Transport.listable."""
120
109
        return self._decorated.listable()
129
118
 
130
119
    def readv(self, relpath, offsets, adjust_for_latency=False,
131
120
        upper_limit=None):
132
 
        # we override at the readv() level rather than _readv() so that any
133
 
        # latency adjustments will be done by the underlying transport
 
121
        """See Transport.readv."""
134
122
        self._trace(('readv', relpath, offsets, adjust_for_latency,
135
123
            upper_limit))
136
124
        return self._decorated.readv(relpath, offsets, adjust_for_latency,
146
134
 
147
135
    def rmdir(self, relpath):
148
136
        """See Transport.rmdir."""
149
 
        self._trace(('rmdir', relpath))
150
137
        return self._decorated.rmdir(relpath)
151
138
 
152
139
    def stat(self, relpath):