Rev 5454: (gz) Allow arbitrary bytes from version-info rather than throwing in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Oct 1 09:15:57 BST 2010


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

------------------------------------------------------------
revno: 5454 [merge]
revision-id: pqm at pqm.ubuntu.com-20101001081555-t2ohv5uepnfrzbm0
parent: pqm at pqm.ubuntu.com-20101001074020-arbz6k0sl3w7nlrm
parent: polymorphm at gmail.com-20100929235357-5xpgkbutb04ltd84
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-10-01 09:15:55 +0100
message:
  (gz) Allow arbitrary bytes from version-info rather than throwing
   UnicodeDecodeError on a non-utf-8 terminal (Andrej A Antonov)
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/cmd_version_info.py     __init__.py-20051228204928-697d01fdca29c99b
  bzrlib/tests/blackbox/test_version_info.py test_bb_version_info.py-20051228204928-91711c6559d952f7
=== modified file 'NEWS'
--- a/NEWS	2010-09-30 00:29:07 +0000
+++ b/NEWS	2010-10-01 08:15:55 +0000
@@ -34,6 +34,10 @@
   using this, make sure the process holding the lock really is dead.)
   (Martin Pool, #392315)
 
+* Print junk rather than throwing a UnicodeDecodeError from ``bzr version-info``
+  when using the rio format (with non-ascii information) on a non-utf-8 terminal.
+  (Andrej A Antonov, #518609)
+
 * Skip tests that needs a bzr source tree when there isn't one. This is
   needed to succesfully run the test suite for installed versions.
   (Vincent Ladeuil, #644855).

=== modified file 'bzrlib/cmd_version_info.py'
--- a/bzrlib/cmd_version_info.py	2010-04-02 19:12:58 +0000
+++ b/bzrlib/cmd_version_info.py	2010-09-29 23:53:57 +0000
@@ -116,4 +116,4 @@
                 include_revision_history=include_history,
                 include_file_revisions=include_file_revisions,
                 template=template)
-        builder.generate(ui.ui_factory.make_output_stream())
+        builder.generate(self.outf)

=== modified file 'bzrlib/tests/blackbox/test_version_info.py'
--- a/bzrlib/tests/blackbox/test_version_info.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/blackbox/test_version_info.py	2010-09-29 12:13:52 +0000
@@ -151,3 +151,19 @@
             '"{revno} {branch_nick} {clean}\n" branch')
         self.assertEqual("2 branch 0\n", out)
         self.assertEqual("", err)
+    
+    def test_non_ascii(self):
+        """Test that we can output non-ascii data"""
+        
+        commit_message = u'Non-ascii message with character not in latin-1: \u1234'
+        
+        tree = self.make_branch_and_tree('.')
+        self.build_tree(['a_file'])
+        tree.add('a_file')
+        tree.commit(commit_message)
+        out, err = self.run_bzr(
+            ['version-info', '--include-history'], encoding='latin-1')
+        
+        self.assertContainsString(out, commit_message.encode('utf-8'))
+
+




More information about the bazaar-commits mailing list