Rev 32: Restore verbose as the default mode. in http://code.launchpad.net/%7Ebzr-upload-devs/bzr-upload/trunk

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Apr 25 23:39:55 BST 2008


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

------------------------------------------------------------
revno: 32
revision-id: v.ladeuil+lp at free.fr-20080425223950-7c6304jwrrh1mvq4
parent: v.ladeuil+lp at free.fr-20080425222613-xmek7epzhc00fr7s
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: upload
timestamp: Sat 2008-04-26 00:39:50 +0200
message:
  Restore verbose as the default mode.
  
  * test_upload.py:
  (TestUploadMixin._get_cmd_upload): Cleanly set outf.
  (TestUploadMixin.do_full_upload,
  TestUploadMixin.do_incremental_upload): Force verbose to False.
  
  * __init__.py:
  (cmd_upload): Make verbose True by default. Remove test fixture
  work-around.
modified:
  __init__.py                    __init__.py-20080307145942-xx1xgifrreovahgz-1
  test_upload.py                 test_upload.py-20080307145942-xx1xgifrreovahgz-2
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2008-04-25 22:26:13 +0000
+++ b/__init__.py	2008-04-25 22:39:50 +0000
@@ -75,11 +75,8 @@
        ]
 
     def run(self, location=None, full=False, revision=None, remember=None,
-            directory=None, verbose=False,
+            directory=None, verbose=True,
             ):
-        # XXX: Ugly hack to make tests pass
-        if not self.__dict__.has_key('outf'):
-            self._setup_outf()
         if directory is None:
             directory = u'.'
 

=== modified file 'test_upload.py'
--- a/test_upload.py	2008-04-25 22:26:13 +0000
+++ b/test_upload.py	2008-04-25 22:39:50 +0000
@@ -15,6 +15,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 import os
+import sys
 
 
 from bzrlib import (
@@ -186,19 +187,29 @@
         os.mkdir(base + name)
         self.tree.commit('change %s from file to dir' % name)
 
+    def _get_cmd_upload(self):
+        upload = cmd_upload()
+        # We don't want to use run_bzr here because redirected output are a
+        # pain to debug. But we need to provides a valid outf.
+        # XXX: Should a bug against bzr be filled about that ?
+        upload._setup_outf()
+        return upload
+
     def do_full_upload(self, *args, **kwargs):
-        upload = cmd_upload()
+        upload = self._get_cmd_upload()
         up_url = self.get_transport(self.upload_dir).external_url()
         if kwargs.get('directory', None) is None:
             kwargs['directory'] = 'branch'
         kwargs['full'] = True
+        kwargs['verbose'] = False
         upload.run(up_url, *args, **kwargs)
 
     def do_incremental_upload(self, *args, **kwargs):
-        upload = cmd_upload()
+        upload = self._get_cmd_upload()
         up_url = self.get_transport(self.upload_dir).external_url()
         if kwargs.get('directory', None) is None:
             kwargs['directory'] = 'branch'
+        kwargs['verbose'] = False
         upload.run(up_url, *args, **kwargs)
 
     def test_create_file(self):



More information about the bazaar-commits mailing list