Rev 31: Various cleanups left uncommitted for far too long. in file:///net/bigmamac/Volumes/home/vila/.bazaar/plugins/transportstats/

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Mar 18 14:14:30 GMT 2009


At file:///net/bigmamac/Volumes/home/vila/.bazaar/plugins/transportstats/

------------------------------------------------------------
revno: 31
revision-id: v.ladeuil+lp at free.fr-20090318141429-xdyajahxyv8qq5et
parent: v.ladeuil+lp at free.fr-20071207135112-wuaf24l9ovhcypz6
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: transportstats
timestamp: Wed 2009-03-18 15:14:29 +0100
message:
  Various cleanups left uncommitted for far too long.
-------------- next part --------------
=== modified file 'TODO'
--- a/TODO	2007-12-04 10:55:55 +0000
+++ b/TODO	2009-03-18 14:14:29 +0000
@@ -36,7 +36,7 @@
    That could even be the default mode of operation, collecting stats for
    several bzr commands is less commonly needed.
 
-   May b the default mode should be to use a global bzr option and either
+   May be the default mode should be to use a global bzr option and either
    instrument all transports or only the one(s) explicitely decorated.
 
 * instrument more objects than transport (repository, branch,

=== modified file 'commands.py'
--- a/commands.py	2007-12-07 11:09:23 +0000
+++ b/commands.py	2009-03-18 14:14:29 +0000
@@ -14,23 +14,17 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-"""Commands to handle statistics collected with a 'stats+' decorator."""
-
-# Statistics collection and display are separated to simplify user interaction:
-# 
-# - It's easier to use a decorator to restrict the collection to a particular
-#   branch.
-# 
-# - It allows running several bzr commands while collecting into the same
-#   file.
-# 
-# - It permits to propose specific options when displaying the results with the
-#   standard option mechanism.
-# 
-# from bzrlib import (
-#     osutils,
-#     )
-
+"""Commands to handle statistics collected with a 'stats+' decorator.
+
+Statistics collection and display are separated to simplify user interaction:
+- It's easier to use a decorator to restrict the collection to a particular
+  branch.
+- It allows running several bzr commands while collecting into the same
+  file.
+- It allows proposing specific options when displaying the results with the
+  standard option mechanism.
+
+"""
 import bzrlib.commands
 
 class cmd_ts_reset(bzrlib.commands.Command):

=== modified file 'decorator.py'
--- a/decorator.py	2007-12-07 13:51:12 +0000
+++ b/decorator.py	2009-03-18 14:14:29 +0000
@@ -16,7 +16,7 @@
 
 """A decorator that adapts another transport to collect info.
 
-Once collected the info are aggregated in various ways to provides statistics
+Once collected the info are aggregated in various ways to provide statistics
 about the operations done by the transport.
 
 The focus here is to collect data while respecting the contract of the
@@ -203,7 +203,7 @@
         """See Transport.put_file()."""
         saved_pos = f.tell()
         temp_file, nb_bytes = self._pump_to_tmp(f)
-        self.__start()
+        self._start()
         try:
             ret = self._decorated.put_file(relpath, temp_file, mode)
         except:
@@ -348,8 +348,8 @@
             # Multiple parts response
             temp = tempfile.TemporaryFile()
             # RangeFile has already consumed the beginning of the first range
-            # (including te boundary line) for its own setup. We need to put an
-            # equivalent at the beginning of our copy
+            # (including the boundary line) for its own setup. We need to put
+            # an equivalent at the beginning of our copy
             temp.write('--' + resp._boundary + '\r\n')
             temp.write(''.join(resp._headers.headers) + '\r\n')
             # Copy the rest of the body bypassing RangeFile.read() to get the

=== modified file 'statsfile.py'
--- a/statsfile.py	2007-12-05 09:19:43 +0000
+++ b/statsfile.py	2009-03-18 14:14:29 +0000
@@ -226,7 +226,7 @@
 class _file_wrapper(object):
     """Isolate the wrapper itself to make the file use transparent.
 
-    Daughter classes can ovveride any method and/or directly call the _file
+    Daughter classes can override any method and/or directly call the _file
     methods.
     """
 

=== modified file 'tests/test_stats.py'
--- a/tests/test_stats.py	2007-10-07 19:52:40 +0000
+++ b/tests/test_stats.py	2009-03-18 14:14:29 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Canonical Ltd
+# Copyright (C) 2007, 2009 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,6 +29,7 @@
 class TestStats(tests.TestCase):
 
     def setUp(self):
+        tests.TestCase.setUp(self)
         # We don't want to pollute the directory where the tests are run
         self._test_dir = osutils.mkdtemp(prefix='testbzrts-', suffix='.tmp')
         self._orig_dir = os.getcwdu()
@@ -37,6 +38,7 @@
     def tearDown(self):
         os.chdir(self._orig_dir)
         osutils.rmtree(self._test_dir)
+        tests.TestCase.tearDown(self)
 
     def test_cant_open_in_both_modes(self):
         st = stats.get_stats()

=== modified file 'tests/test_statsfile.py'
--- a/tests/test_statsfile.py	2007-11-20 10:34:20 +0000
+++ b/tests/test_statsfile.py	2009-03-18 14:14:29 +0000
@@ -107,6 +107,7 @@
 class TestFile(tests.TestCase):
 
     def setUp(self):
+        tests.TestCase.setUp(self)
         self.marker= '\xde\xad\xbe\xef'
         self.encoded_marker = '\x04' + self.marker
 



More information about the bazaar-commits mailing list