Rev 4909: Use clear() so that we clear a progress bar, but don't introduce a newline. in http://bazaar.launchpad.net/~jameinel/bzr/2.1.0rc1-dbytes

John Arbash Meinel john at arbash-meinel.com
Fri Dec 18 17:19:35 GMT 2009


At http://bazaar.launchpad.net/~jameinel/bzr/2.1.0rc1-dbytes

------------------------------------------------------------
revno: 4909
revision-id: john at arbash-meinel.com-20091218171934-l7og4as9pj7pyqr5
parent: john at arbash-meinel.com-20091218171609-gpft7w4hvt1zj827
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1.0rc1-dbytes
timestamp: Fri 2009-12-18 11:19:34 -0600
message:
  Use clear() so that we clear a progress bar, but don't introduce a newline.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_uifactory/__init__.py'
--- a/bzrlib/tests/per_uifactory/__init__.py	2009-12-18 17:16:09 +0000
+++ b/bzrlib/tests/per_uifactory/__init__.py	2009-12-18 17:19:34 +0000
@@ -165,8 +165,8 @@
 
     def _check_log_transport_activity_display(self):
         self.assertEqual('', self.stdout.getvalue())
-        # Displaying the result should do something
-        self.assertEqual('\nTotal byte count: 0.003MiB (3000B)\n',
+        # Displaying the result should write to the progress stream
+        self.assertEqual('Total byte count: 0.003MiB (3000B)\n',
                          self.stderr.getvalue())
 
 

=== modified file 'bzrlib/ui/text.py'
--- a/bzrlib/ui/text.py	2009-12-18 17:16:09 +0000
+++ b/bzrlib/ui/text.py	2009-12-18 17:19:34 +0000
@@ -414,7 +414,8 @@
                         self._total_byte_count)
         trace.mutter(byte_message)
         if display:
-            self._term_file.write('\n%s\n' % (byte_message,))
+            self.clear()
+            self._term_file.write('%s\n' % (byte_message,))
 
 
 class TextUIOutputStream(object):



More information about the bazaar-commits mailing list