Rev 5065: (vila for doxx) Deprecate commands.shlex_split_unicode in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Mar 1 09:58:55 GMT 2010


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

------------------------------------------------------------
revno: 5065 [merge]
revision-id: pqm at pqm.ubuntu.com-20100301095853-c1ffluypw71hgtgc
parent: pqm at pqm.ubuntu.com-20100301034320-01vhbnw7b8mxrmx5
parent: v.ladeuil+lp at free.fr-20100301092739-rpkuu5vfxmkybqti
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2010-03-01 09:58:53 +0000
message:
  (vila for doxx) Deprecate commands.shlex_split_unicode
modified:
  bzrlib/cmdline.py              bzrlibcmdline.py-20100202043522-83yorxx3tcigi7ap-1
  bzrlib/commands.py             bzr.py-20050309040720-d10f4714595cf8c3
  bzrlib/tests/test_cmdline.py   bzrlibteststest_cmdl-20100202043522-83yorxx3tcigi7ap-2
  bzrlib/tests/test_commands.py  test_command.py-20051019190109-3b17be0f52eaa7a8
=== modified file 'bzrlib/cmdline.py'
--- a/bzrlib/cmdline.py	2010-02-12 05:40:17 +0000
+++ b/bzrlib/cmdline.py	2010-03-01 09:02:18 +0000
@@ -26,16 +26,16 @@
     def __init__(self, orig):
         self._iter = iter(orig)
         self._pushback_buffer = []
-        
+
     def next(self):
         if len(self._pushback_buffer) > 0:
             return self._pushback_buffer.pop()
         else:
             return self._iter.next()
-    
+
     def pushback(self, char):
         self._pushback_buffer.append(char)
-        
+
     def __iter__(self):
         return self
 
@@ -77,7 +77,7 @@
     def __init__(self, exit_state):
         self.exit_state = exit_state
         self.count = 1
-        
+
     def process(self, next_char, context):
         if next_char == u'\\':
             self.count += 1
@@ -104,7 +104,7 @@
             # let exit_state handle next_char
             context.seq.pushback(next_char)
             return self.exit_state
-    
+
     def finish(self, context):
         if self.count > 0:
             context.token.append(u'\\' * self.count)
@@ -129,16 +129,16 @@
         self.allowed_quote_chars = u'"'
         if single_quotes_allowed:
             self.allowed_quote_chars += u"'"
-    
+
     def __iter__(self):
         return self
-    
+
     def next(self):
         quoted, token = self._get_token()
         if token is None:
             raise StopIteration
         return quoted, token
-    
+
     def _get_token(self):
         self.quoted = False
         self.token = []

=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2010-02-26 14:14:36 +0000
+++ b/bzrlib/commands.py	2010-03-01 09:27:39 +0000
@@ -372,7 +372,7 @@
         # List of standard options directly supported
         self.supported_std_options = []
         self._operation = cleanup.OperationWithCleanups(self.run)
-    
+
     def add_cleanup(self, cleanup_func, *args, **kwargs):
         """Register a function to call after self.run returns or raises.
 
@@ -392,7 +392,7 @@
         resources (such as writing results to self.outf).
         """
         self._operation.cleanup_now()
-        
+
     @deprecated_method(deprecated_in((2, 1, 0)))
     def _maybe_expand_globs(self, file_list):
         """Glob expand file_list if the platform does not do that itself.
@@ -877,6 +877,7 @@
     return ret
 
 
+ at deprecated_function(deprecated_in((2, 2, 0)))
 def shlex_split_unicode(unsplit):
     return cmdline.split(unsplit)
 

=== modified file 'bzrlib/tests/test_cmdline.py'
--- a/bzrlib/tests/test_cmdline.py	2010-02-18 02:15:48 +0000
+++ b/bzrlib/tests/test_cmdline.py	2010-03-01 09:02:18 +0000
@@ -85,7 +85,7 @@
     def test_double_escape(self):
         self.assertAsTokens([(True, u'foo\\\\bar')], u'"foo\\\\bar"')
         self.assertAsTokens([(False, u'foo\\\\bar')], u"foo\\\\bar")
-        
+
     def test_multiple_quoted_args(self):
         self.assertAsTokens([(True, u'x x'), (True, u'y y')],
             u'"x x" "y y"')

=== modified file 'bzrlib/tests/test_commands.py'
--- a/bzrlib/tests/test_commands.py	2010-02-26 04:43:31 +0000
+++ b/bzrlib/tests/test_commands.py	2010-03-01 09:27:39 +0000
@@ -24,6 +24,7 @@
     config,
     errors,
     option,
+    symbol_versioning,
     tests,
     )
 from bzrlib.commands import display_command
@@ -336,3 +337,10 @@
         cmds = list(commands.all_command_names())
         self.assertEqual(['called'], hook_calls)
         self.assertSubset(['foo', 'bar'], cmds)
+
+class TestDeprecations(tests.TestCase):
+
+    def test_shlex_split_unicode_deprecation(self):
+        res = self.applyDeprecated(
+                symbol_versioning.deprecated_in((2, 2, 0)),
+                commands.shlex_split_unicode, 'whatever')




More information about the bazaar-commits mailing list