~ubuntu-branches/ubuntu/natty/bzr/natty-proposed

« back to all changes in this revision

Viewing changes to bzrlib/transport/log.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-08-07 00:54:52 UTC
  • mfrom: (1.4.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20100807005452-g4zb99ezl3xn44r4
Tags: 2.2.0-1
* New upstream release.
 + Adds support for setting timestamps to originating revisions.
   Closes: #473450
 + Removes remaining string exception. Closes: #585193, LP: #586926
 + Add C extension to work around Python issue 1628205. LP: #583941,
   Closes: #577110
 + Avoids showing progress bars when --quiet is used. Closes: #542105,
   LP: #320035
 + No longer creates ~/.bazaar as root when run under sudo. LP: #376388
 + 'bzr commit' now supports -p as alternative for --show-diff. LP: #571467
 + 'bzr add' no longer adds .THIS/.BASE/.THEIRS files unless
   explicitly requested. LP: #322767
 + When parsing patch files, Bazaar now supports diff lines before each
   patch. LP: #502076
 + WorkingTrees now no longer requires using signal.signal, so can
   be used in a threaded environment. LP: #521989
 + An assertion error is no longer triggered when pushing to a pre-1.6
   Bazaar server. LP: #528041
* Bump standards version to 3.9.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
26
26
import types
27
27
 
28
28
from bzrlib.trace import mutter
29
 
from bzrlib.transport.decorator import (
30
 
    TransportDecorator,
31
 
    )
32
 
from bzrlib.transport.trace import (
33
 
    DecoratorServer,
34
 
    TransportTraceDecorator,
35
 
    )
36
 
 
37
 
 
38
 
 
39
 
 
40
 
class TransportLogDecorator(TransportDecorator):
 
29
from bzrlib.transport import decorator
 
30
 
 
31
 
 
32
class TransportLogDecorator(decorator.TransportDecorator):
41
33
    """Decorator for Transports that logs interesting operations to .bzr.log.
42
34
 
43
35
    In general we want to log things that usually take a network round trip
136
128
        if False:
137
129
            elapsed = time.time() - before
138
130
            if result_len and elapsed > 0:
139
 
                # this is the rate of higher-level data, not the raw network speed
140
 
                mutter("      %9.03fs %8dKB/s" % (elapsed, result_len/elapsed/1024))
 
131
                # this is the rate of higher-level data, not the raw network
 
132
                # speed using base-10 units (see HACKING.txt).
 
133
                mutter("      %9.03fs %8dkB/s"
 
134
                       % (elapsed, result_len/elapsed/1000))
141
135
            else:
142
136
                mutter("      %9.03fs" % (elapsed))
143
137
        return return_result
154
148
        return t
155
149
 
156
150
 
157
 
class LogDecoratorServer(DecoratorServer):
158
 
    """Server for testing."""
159
 
 
160
 
    def get_decorator_class(self):
161
 
        return TransportLogDecorator
162
 
 
163
 
 
164
151
def get_test_permutations():
165
152
    """Return the permutations to be used in testing."""
166
 
    return [(TransportLogDecorator, LogDecoratorServer)]
 
153
    from bzrlib.tests import test_server
 
154
    return [(TransportLogDecorator, test_server.LogDecoratorServer)]