Rev 57: Fix minor 2.4 compatibility bug. in http://bazaar.launchpad.net/%7Ebzr-upload-devs/bzr-upload/trunk

Vincent Ladeuil v.ladeuil+lp at free.fr
Sat Feb 28 15:29:08 GMT 2009


At http://bazaar.launchpad.net/%7Ebzr-upload-devs/bzr-upload/trunk

------------------------------------------------------------
revno: 57
revision-id: v.ladeuil+lp at free.fr-20090228152905-r35xzjcwvi911w8y
parent: v.ladeuil+lp at free.fr-20090210084152-h73a2mv2n8xuag3q
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: trunk
timestamp: Sat 2009-02-28 16:29:05 +0100
message:
  Fix minor 2.4 compatibility bug.
  
  * tests/test_upload.py:
  (UploadUtilsMixin.assertUpPathModeEqual): Update comment.
  
  * __init__.py:
  (CannotUploadToWorkingTreeError): Fix 2.4 compatibility
  issue (StandardError, the grand-mother class was a type not an
  object in 2.4, so we can't us super() here). Besides, BzrError
  already provides facilities that doesn't require to redefine
  __init__, keyword arguments can be used in _fmt as long as they
  are passed as keyword arguments at construction time.
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2009-02-10 08:41:52 +0000
+++ b/__init__.py	2009-02-28 15:29:05 +0000
@@ -323,14 +323,11 @@
         finally:
             self.tree.unlock()
 
+
 class CannotUploadToWorkingTreeError(errors.BzrCommandError):
 
     _fmt = 'Cannot upload to a bzr managed working tree: %(url)s".'
 
-    def __init__(self, url):
-        super(CannotUploadToWorkingTreeError, self).__init__(self)
-        self.url = url
-
 
 class cmd_upload(commands.Command):
     """Upload a working tree, as a whole or incrementally.
@@ -402,7 +399,7 @@
             has_wt = True
 
         if has_wt:
-            raise CannotUploadToWorkingTreeError(location)
+            raise CannotUploadToWorkingTreeError(url=location)
 
         if revision is None:
             rev_id = branch.last_revision()

=== modified file 'tests/test_upload.py'
--- a/tests/test_upload.py	2009-02-10 08:41:52 +0000
+++ b/tests/test_upload.py	2009-02-28 15:29:05 +0000
@@ -176,6 +176,8 @@
         # against servers that can't. Note that some bzrlib transports define
         # _can_roundtrip_unix_modebits in a incomplete way, this property
         # should depend on both the client and the server, not the client only.
+        # But the client will know or can find if the server support chmod so
+        # that's the client that will report it anyway.
         full_path = osutils.pathjoin(base, path)
         st = os.stat(full_path)
         mode = st.st_mode & 0777



More information about the bazaar-commits mailing list