Rev 3102: Uncommit doesn't throw when it encounters un-encodable characters in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Dec 11 07:29:44 GMT 2007


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

------------------------------------------------------------
revno: 3102
revision-id:pqm at pqm.ubuntu.com-20071211072935-5kj4hhh82rgkqqwb
parent: pqm at pqm.ubuntu.com-20071211022658-n271ob77ifucx9q3
parent: aaron.bentley at utoronto.ca-20071211051336-mc7fscztxvrdxo1h
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2007-12-11 07:29:35 +0000
message:
  Uncommit doesn't throw when it encounters un-encodable characters
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/tests/blackbox/test_uncommit.py test_uncommit.py-20051027212835-84944b63adae51be
    ------------------------------------------------------------
    revno: 3101.1.1
    revision-id:aaron.bentley at utoronto.ca-20071211051336-mc7fscztxvrdxo1h
    parent: pqm at pqm.ubuntu.com-20071211022658-n271ob77ifucx9q3
    committer: Aaron Bentley <aaron.bentley at utoronto.ca>
    branch nick: bzr.ab2
    timestamp: Tue 2007-12-11 00:13:36 -0500
    message:
      Uncommit doesn't throw when it encounters un-encodable characters
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/tests/blackbox/test_uncommit.py test_uncommit.py-20051027212835-84944b63adae51be
=== modified file 'NEWS'
--- a/NEWS	2007-12-10 19:12:00 +0000
+++ b/NEWS	2007-12-11 05:13:36 +0000
@@ -21,6 +21,10 @@
 
    * Fix Makefile rules for doc generation. (Ian Clatworthy, #175207)
 
+   * ``uncommit`` works even when the commit messages of revisions to be
+     removed use characters not supported in the terminal encoding.
+     (Aaron Bentley)
+
   INTERNALS:
 
   API BREAKS:

=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-12-09 06:35:14 +0000
+++ b/bzrlib/builtins.py	2007-12-11 05:13:36 +0000
@@ -3579,6 +3579,7 @@
                     Option('force', help='Say yes to all questions.')]
     takes_args = ['location?']
     aliases = []
+    encoding_type = 'replace'
 
     def run(self, location=None,
             dry_run=False, verbose=False,

=== modified file 'bzrlib/tests/blackbox/test_uncommit.py'
--- a/bzrlib/tests/blackbox/test_uncommit.py	2007-11-01 19:53:57 +0000
+++ b/bzrlib/tests/blackbox/test_uncommit.py	2007-12-11 05:13:36 +0000
@@ -18,6 +18,7 @@
 
 import os
 
+import bzrlib
 from bzrlib import uncommit, workingtree
 from bzrlib.bzrdir import BzrDirMetaFormat1
 from bzrlib.errors import BzrError, BoundBranchOutOfDate
@@ -227,3 +228,14 @@
         out, err = self.run_bzr('uncommit --force -r 2')
 
         self.assertEqual(['a2', 'b3', 'c3', 'c4', 'b4'], wt.get_parent_ids())
+
+    def test_uncommit_nonascii(self):
+        tree = self.make_branch_and_tree('tree')
+        tree.commit(u'\u1234 message')
+        real_encoding = bzrlib.user_encoding
+        bzrlib.user_encoding = 'ascii'
+        try:
+            out, err = self.run_bzr('uncommit --force tree')
+        finally:
+            bzrlib.user_encoding = real_encoding
+        self.assertContainsRe(out, r'\? message')




More information about the bazaar-commits mailing list