Rev 5392: (jameinel) `decode` parameter to get() method in FtpTransport and in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Fri Aug 27 21:47:34 BST 2010
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5392 [merge]
revision-id: pqm at pqm.ubuntu.com-20100827204731-42zzp1f2yyg3jowf
parent: pqm at pqm.ubuntu.com-20100827192648-asy9uzwe4w25v6mq
parent: bialix at ukr.net-20100825102117-9dfoca8dbjwdsh15
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2010-08-27 21:47:31 +0100
message:
(jameinel) `decode` parameter to get() method in FtpTransport and
GioTransport classes is deprecated. (Alexander Belchenko)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
bzrlib/transport/gio_transport.py __init__.py-20100430125031-jb4f7q7mtyz55kz3-2
=== modified file 'NEWS'
--- a/NEWS 2010-08-24 23:20:14 +0000
+++ b/NEWS 2010-08-25 10:21:17 +0000
@@ -20,6 +20,9 @@
is now named "msg" instead of earlier "message".
(Parth Malwankar, #603461)
+* `decode` parameter to get() method in FtpTransport and GioTransport classes
+ is deprecated. (Alexander Belchenko)
+
* `FileInWrongBranch` is deprecated in favour of `PathNotChild` and no
longer raised.
(Martin Pool)
=== modified file 'bzrlib/transport/ftp/__init__.py'
--- a/bzrlib/transport/ftp/__init__.py 2010-08-18 01:29:12 +0000
+++ b/bzrlib/transport/ftp/__init__.py 2010-08-25 10:21:17 +0000
@@ -40,6 +40,12 @@
osutils,
urlutils,
)
+from bzrlib.symbol_versioning import (
+ DEPRECATED_PARAMETER,
+ deprecated_in,
+ deprecated_passed,
+ warn,
+ )
from bzrlib.trace import mutter, warning
from bzrlib.transport import (
AppendBasedFileStream,
@@ -235,7 +241,7 @@
mutter("FTP has not: %s: %s", abspath, e)
return False
- def get(self, relpath, decode=False, retries=0):
+ def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
"""Get the file at the given relative path.
:param relpath: The relative path to the file
@@ -245,7 +251,10 @@
We're meant to return a file-like object which bzr will
then read from. For now we do this via the magic of StringIO
"""
- # TODO: decode should be deprecated
+ if deprecated_passed(decode):
+ warn(deprecated_in((2,3,0)) %
+ '"decode" parameter to FtpTransport.get()',
+ DeprecationWarning, stacklevel=2)
try:
mutter("FTP get: %s", self._remote_path(relpath))
f = self._get_FTP()
=== modified file 'bzrlib/transport/gio_transport.py'
--- a/bzrlib/transport/gio_transport.py 2010-05-28 18:52:03 +0000
+++ b/bzrlib/transport/gio_transport.py 2010-08-25 10:21:17 +0000
@@ -43,6 +43,12 @@
debug,
ui,
)
+from bzrlib.symbol_versioning import (
+ DEPRECATED_PARAMETER,
+ deprecated_in,
+ deprecated_passed,
+ warn,
+ )
from bzrlib.trace import mutter, warning
from bzrlib.transport import (
FileStream,
@@ -262,7 +268,7 @@
else:
self._translate_gio_error(e, relpath)
- def get(self, relpath, decode=False, retries=0):
+ def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
"""Get the file at the given relative path.
:param relpath: The relative path to the file
@@ -272,6 +278,10 @@
We're meant to return a file-like object which bzr will
then read from. For now we do this via the magic of StringIO
"""
+ if deprecated_passed(decode):
+ warn(deprecated_in((2,3,0)) %
+ '"decode" parameter to GioTransport.get()',
+ DeprecationWarning, stacklevel=2)
try:
if 'gio' in debug.debug_flags:
mutter("GIO get: %s" % relpath)
More information about the bazaar-commits
mailing list