Rev 5923: (vila) Fix some imports and other pyflakes failures. (Martin Pool) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri May 27 00:22:31 UTC 2011


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

------------------------------------------------------------
revno: 5923 [merge]
revision-id: pqm at pqm.ubuntu.com-20110527002226-47nfzevxy52b4pn1
parent: pqm at pqm.ubuntu.com-20110526230055-llm6blihy5oflj2b
parent: mbp at canonical.com-20110520144602-bqli0t6dj01gl0pv
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-05-27 00:22:26 +0000
message:
  (vila) Fix some imports and other pyflakes failures. (Martin Pool)
modified:
  bzrlib/atomicfile.py           atomicfile.py-20050509044450-dbd24e6c564f7c66
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
  bzrlib/chk_map.py              chk_map.py-20081001014447-ue6kkuhofvdecvxa-1
  bzrlib/config.py               config.py-20051011043216-070c74f4e9e338e8
  bzrlib/conflicts.py            conflicts.py-20051001061850-78ef952ba63d2b42
  bzrlib/crash.py                crash.py-20090812083334-d6volool4lktdjcx-1
=== modified file 'bzrlib/atomicfile.py'
--- a/bzrlib/atomicfile.py	2010-04-30 11:03:59 +0000
+++ b/bzrlib/atomicfile.py	2011-05-20 14:46:02 +0000
@@ -20,7 +20,6 @@
 from bzrlib.lazy_import import lazy_import
 lazy_import(globals(), """
 import stat
-import socket
 import warnings
 
 from bzrlib import (

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2011-05-18 12:18:39 +0000
+++ b/bzrlib/builtins.py	2011-05-20 14:39:50 +0000
@@ -44,7 +44,6 @@
     rename_map,
     revision as _mod_revision,
     static_tuple,
-    symbol_versioning,
     timestamp,
     transport,
     ui,
@@ -72,6 +71,9 @@
     _parse_revision_str,
     )
 from bzrlib.trace import mutter, note, warning, is_quiet, get_verbosity_level
+from bzrlib import (
+    symbol_versioning,
+    )
 
 
 @symbol_versioning.deprecated_function(symbol_versioning.deprecated_in((2, 3, 0)))
@@ -3646,10 +3648,10 @@
         if typestring == "sftp":
             from bzrlib.tests import stub_sftp
             return stub_sftp.SFTPAbsoluteServer
-        if typestring == "memory":
+        elif typestring == "memory":
             from bzrlib.tests import test_server
             return memory.MemoryServer
-        if typestring == "fakenfs":
+        elif typestring == "fakenfs":
             from bzrlib.tests import test_server
             return test_server.FakeNFSServer
         msg = "No known transport type %s. Supported types are: sftp\n" %\
@@ -5636,7 +5638,7 @@
             unstacked=None):
         directory = bzrdir.BzrDir.open(location)
         if stacked_on and unstacked:
-            raise BzrCommandError("Can't use both --stacked-on and --unstacked")
+            raise errors.BzrCommandError("Can't use both --stacked-on and --unstacked")
         elif stacked_on is not None:
             reconfigure.ReconfigureStackedOn().apply(directory, stacked_on)
         elif unstacked:

=== modified file 'bzrlib/bzrdir.py'
--- a/bzrlib/bzrdir.py	2011-05-18 16:42:48 +0000
+++ b/bzrlib/bzrdir.py	2011-05-20 14:46:02 +0000
@@ -33,8 +33,6 @@
 from bzrlib import (
     branch as _mod_branch,
     cleanup,
-    config,
-    controldir,
     errors,
     fetch,
     graph,
@@ -65,6 +63,8 @@
     )
 
 from bzrlib import (
+    config,
+    controldir,
     hooks,
     registry,
     )
@@ -1416,7 +1416,7 @@
     @classmethod
     def get_format_string(cls):
         """Return the ASCII format string that identifies this format."""
-        raise NotImplementedError(self.get_format_string)
+        raise NotImplementedError(cls.get_format_string)
 
     def initialize_on_transport(self, transport):
         """Initialize a new bzrdir in the base directory of a Transport."""

=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py	2011-04-07 10:36:24 +0000
+++ b/bzrlib/chk_map.py	2011-05-20 14:46:02 +0000
@@ -47,6 +47,7 @@
     )
 """)
 from bzrlib import (
+    errors,
     lru_cache,
     osutils,
     registry,

=== modified file 'bzrlib/config.py'
--- a/bzrlib/config.py	2011-05-05 10:48:13 +0000
+++ b/bzrlib/config.py	2011-05-20 14:46:02 +0000
@@ -84,7 +84,6 @@
     mail_client,
     mergetools,
     osutils,
-    registry,
     symbol_versioning,
     trace,
     transport,
@@ -94,6 +93,9 @@
     )
 from bzrlib.util.configobj import configobj
 """)
+from bzrlib import (
+    registry,
+    )
 
 
 CHECK_IF_POSSIBLE=0
@@ -1477,7 +1479,7 @@
     try:
         w = pwd.getpwuid(uid)
     except KeyError:
-        mutter('no passwd entry for uid %d?' % uid)
+        trace.mutter('no passwd entry for uid %d?' % uid)
         return None, None
 
     # we try utf-8 first, because on many variants (like Linux),
@@ -1492,12 +1494,12 @@
             encoding = osutils.get_user_encoding()
             gecos = w.pw_gecos.decode(encoding)
         except UnicodeError, e:
-            mutter("cannot decode passwd entry %s" % w)
+            trace.mutter("cannot decode passwd entry %s" % w)
             return None, None
     try:
         username = w.pw_name.decode(encoding)
     except UnicodeError, e:
-        mutter("cannot decode passwd entry %s" % w)
+        trace.mutter("cannot decode passwd entry %s" % w)
         return None, None
 
     comma = gecos.find(',')

=== modified file 'bzrlib/conflicts.py'
--- a/bzrlib/conflicts.py	2011-05-21 16:43:19 +0000
+++ b/bzrlib/conflicts.py	2011-05-27 00:22:26 +0000
@@ -25,7 +25,6 @@
 
 from bzrlib import (
     cleanup,
-    commands,
     errors,
     osutils,
     rio,
@@ -35,6 +34,7 @@
     )
 """)
 from bzrlib import (
+    commands,
     option,
     registry,
     )

=== modified file 'bzrlib/crash.py'
--- a/bzrlib/crash.py	2011-04-05 12:23:03 +0000
+++ b/bzrlib/crash.py	2011-05-20 14:46:02 +0000
@@ -120,8 +120,9 @@
     # this function is based on apport_package_hook.py, but omitting some of the
     # Ubuntu-specific policy about what to report and when
 
-    # if the import fails, the exception will be caught at a higher level and
-    # we'll report the error by other means
+    # This import is apparently not used, but we're doing it so that if the
+    # import fails, the exception will be caught at a higher level and we'll
+    # report the error by other means.
     import apport
 
     crash_filename = _write_apport_report_to_file(exc_info)




More information about the bazaar-commits mailing list