Rev 2934: New files, same warnings, same fixes. in http://code.launchpad.net/%7Ev-ladeuil/bzr/bzr.python26
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Nov 20 14:11:06 GMT 2007
At http://code.launchpad.net/%7Ev-ladeuil/bzr/bzr.python26
------------------------------------------------------------
revno: 2934
revision-id:v.ladeuil+lp at free.fr-20071120141050-21w0pnh2ydu94vzh
parent: v.ladeuil+lp at free.fr-20071120105942-67u4nr9oay850s6o
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: bzr.python26
timestamp: Tue 2007-11-20 15:10:50 +0100
message:
New files, same warnings, same fixes.
* bzrlib/util/configobj/configobj.py:
(ConfigObjError.__init__): Use msg instead of message (2.6
deprecation).
* bzrlib/errors.py:
(BzrCheckError, ParseConfigError.__init__): Use msg instead of
message (2.6 deprecation).
* bzrlib/tests/test_repository.py:
Update md5 import, fix use.
* bzrlib/repofmt/pack_repo.py:
Update md5 import, fix use. Fix some import ordering too.
modified:
bzrlib/errors.py errors.py-20050309040759-20512168c4e14fbd
bzrlib/repofmt/pack_repo.py pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
bzrlib/util/configobj/configobj.py configobj.py-20051018184548-06992a2246425e3e
-------------- next part --------------
=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py 2007-11-20 10:59:42 +0000
+++ b/bzrlib/errors.py 2007-11-20 14:10:50 +0000
@@ -181,17 +181,17 @@
class AlreadyBuilding(BzrError):
-
+
_fmt = "The tree builder is already building a tree."
class BzrCheckError(InternalBzrError):
-
- _fmt = "Internal check failed: %(message)s"
-
- def __init__(self, message):
+
+ _fmt = "Internal check failed: %(msg)s"
+
+ def __init__(self, msg):
BzrError.__init__(self)
- self.message = message
+ self.msg = msg
class DisabledMethod(InternalBzrError):
@@ -1543,7 +1543,7 @@
if filename is None:
filename = ""
message = "Error(s) parsing config file %s:\n%s" % \
- (filename, ('\n'.join(e.message for e in errors)))
+ (filename, ('\n'.join(e.msg for e in errors)))
BzrError.__init__(self, message)
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py 2007-11-13 21:39:37 +0000
+++ b/bzrlib/repofmt/pack_repo.py 2007-11-20 14:10:50 +0000
@@ -18,23 +18,22 @@
lazy_import(globals(), """
from itertools import izip
import math
-import md5
import time
from bzrlib import (
debug,
+ osutils,
pack,
ui,
)
from bzrlib.index import (
+ CombinedGraphIndex,
+ InMemoryGraphIndex,
GraphIndex,
GraphIndexBuilder,
- InMemoryGraphIndex,
- CombinedGraphIndex,
GraphIndexPrefixAdapter,
)
from bzrlib.knit import KnitGraphIndex, _PackAccess, _KnitData
-from bzrlib.osutils import rand_chars
from bzrlib.pack import ContainerWriter
from bzrlib.store import revision
""")
@@ -224,7 +223,7 @@
# where is the pack renamed to when it is finished?
self.pack_transport = pack_transport
# tracks the content written to the .pack file.
- self._hash = md5.new()
+ self._hash = osutils.md5()
# a four-tuple with the length in bytes of the indices, once the pack
# is finalised. (rev, inv, text, sigs)
self.index_sizes = None
@@ -234,7 +233,7 @@
# under creation.
self._cache_limit = 0
# the temporary pack file name.
- self.random_name = rand_chars(20) + upload_suffix
+ self.random_name = osutils.rand_chars(20) + upload_suffix
# when was this pack started ?
self.start_time = time.time()
# open an output stream for the data added to the pack.
=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py 2007-11-07 13:10:37 +0000
+++ b/bzrlib/tests/test_repository.py 2007-11-20 14:10:50 +0000
@@ -22,7 +22,6 @@
also see this file.
"""
-import md5
from stat import S_ISDIR
from StringIO import StringIO
@@ -47,6 +46,7 @@
bzrdir,
errors,
inventory,
+ osutils,
repository,
revision as _mod_revision,
symbol_versioning,
@@ -1387,7 +1387,7 @@
pack_transport)
self.assertIsInstance(pack.revision_index, InMemoryGraphIndex)
self.assertIsInstance(pack.inventory_index, InMemoryGraphIndex)
- self.assertIsInstance(pack._hash, type(md5.new()))
+ self.assertIsInstance(pack._hash, type(osutils.md5()))
self.assertTrue(pack.upload_transport is upload_transport)
self.assertTrue(pack.index_transport is index_transport)
self.assertTrue(pack.pack_transport is pack_transport)
=== modified file 'bzrlib/util/configobj/configobj.py'
--- a/bzrlib/util/configobj/configobj.py 2007-10-16 17:37:43 +0000
+++ b/bzrlib/util/configobj/configobj.py 2007-11-20 14:10:50 +0000
@@ -160,11 +160,11 @@
Traceback (most recent call last):
ConfigObjError
"""
- def __init__(self, message='', line_number=None, line=''):
+ def __init__(self, msg='', line_number=None, line=''):
self.line = line
self.line_number = line_number
- self.message = message
- SyntaxError.__init__(self, message)
+ self.msg = msg
+ SyntaxError.__init__(self, msg)
class NestingError(ConfigObjError):
"""
More information about the bazaar-commits
mailing list