Merge lp:~bialix/bzr/deprecate into lp:bzr

Proposed by Alexander Belchenko
Status: Merged
Approved by: John A Meinel
Approved revision: no longer in the source branch.
Merged at revision: 5392
Proposed branch: lp:~bialix/bzr/deprecate
Merge into: lp:bzr
Diff against target: 88 lines (+25/-3)
3 files modified
NEWS (+3/-0)
bzrlib/transport/ftp/__init__.py (+11/-2)
bzrlib/transport/gio_transport.py (+11/-1)
To merge this branch: bzr merge lp:~bialix/bzr/deprecate
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+33624@code.launchpad.net

Commit message

`decode` parameter to get() method in FtpTransport and GioTransport classes is deprecated.

Description of the change

this patch fixes todo in FtpTransport.get() about decode parameter. That parameter is not used actually. While fixing this I found that GioTransport has the same parameter (I smell copy-paste ;-). So I've deprecated decode there as well.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/25/2010 5:26 AM, Alexander Belchenko wrote:
> Alexander Belchenko has proposed merging lp:~bialix/bzr/deprecate into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
>
> this patch fixes todo in FtpTransport.get() about decode parameter. That parameter is not used actually. While fixing this I found that GioTransport has the same parameter (I smell copy-paste ;-). So I've deprecated decode there as well.

I really don't know what 'decode' was meant to be doing, as at present
there are no calls *to* get that pass decode.

We should check that it isn't used by bzr-upload or something like that.
Otherwise, looks good to me.

 merge: approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx1HuIACgkQJdeBCYSNAANFpQCgyPeWt9BuEXVIGTGy4ken6fzD
JngAoIvoHHCse4WFMTqe7OBH4yJJ2Srf
=Yr01
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
Alexander Belchenko (bialix) wrote :

I've checked upload plugin sources, and as I can see there is no use of transport.get, only transport.get_bytes.

Revision history for this message
Vincent Ladeuil (vila) wrote :

>>>>> John A Meinel <email address hidden> writes:

    > Review: Approve
    > On 8/25/2010 5:26 AM, Alexander Belchenko wrote:
    >> Alexander Belchenko has proposed merging lp:~bialix/bzr/deprecate into lp:bzr.
    >>
    >> Requested reviews:
    >> bzr-core (bzr-core)
    >>
    >>
    >> this patch fixes todo in FtpTransport.get() about decode parameter. That parameter is not used actually. While fixing this I found that GioTransport has the same parameter (I smell copy-paste ;-). So I've deprecated decode there as well.

    > I really don't know what 'decode' was meant to be doing, as at present
    > there are no calls *to* get that pass decode.

    > We should check that it isn't used by bzr-upload or something like that.

Nope. No idea what it means (though I could guess ;)

Revision history for this message
John A Meinel (jameinel) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-08-24 23:20:14 +0000
+++ NEWS 2010-08-25 10:25:58 +0000
@@ -20,6 +20,9 @@
20 is now named "msg" instead of earlier "message".20 is now named "msg" instead of earlier "message".
21 (Parth Malwankar, #603461)21 (Parth Malwankar, #603461)
2222
23* `decode` parameter to get() method in FtpTransport and GioTransport classes
24 is deprecated. (Alexander Belchenko)
25
23* `FileInWrongBranch` is deprecated in favour of `PathNotChild` and no26* `FileInWrongBranch` is deprecated in favour of `PathNotChild` and no
24 longer raised.27 longer raised.
25 (Martin Pool)28 (Martin Pool)
2629
=== modified file 'bzrlib/transport/ftp/__init__.py'
--- bzrlib/transport/ftp/__init__.py 2010-08-18 01:29:12 +0000
+++ bzrlib/transport/ftp/__init__.py 2010-08-25 10:25:58 +0000
@@ -40,6 +40,12 @@
40 osutils,40 osutils,
41 urlutils,41 urlutils,
42 )42 )
43from bzrlib.symbol_versioning import (
44 DEPRECATED_PARAMETER,
45 deprecated_in,
46 deprecated_passed,
47 warn,
48 )
43from bzrlib.trace import mutter, warning49from bzrlib.trace import mutter, warning
44from bzrlib.transport import (50from bzrlib.transport import (
45 AppendBasedFileStream,51 AppendBasedFileStream,
@@ -235,7 +241,7 @@
235 mutter("FTP has not: %s: %s", abspath, e)241 mutter("FTP has not: %s: %s", abspath, e)
236 return False242 return False
237243
238 def get(self, relpath, decode=False, retries=0):244 def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
239 """Get the file at the given relative path.245 """Get the file at the given relative path.
240246
241 :param relpath: The relative path to the file247 :param relpath: The relative path to the file
@@ -245,7 +251,10 @@
245 We're meant to return a file-like object which bzr will251 We're meant to return a file-like object which bzr will
246 then read from. For now we do this via the magic of StringIO252 then read from. For now we do this via the magic of StringIO
247 """253 """
248 # TODO: decode should be deprecated254 if deprecated_passed(decode):
255 warn(deprecated_in((2,3,0)) %
256 '"decode" parameter to FtpTransport.get()',
257 DeprecationWarning, stacklevel=2)
249 try:258 try:
250 mutter("FTP get: %s", self._remote_path(relpath))259 mutter("FTP get: %s", self._remote_path(relpath))
251 f = self._get_FTP()260 f = self._get_FTP()
252261
=== modified file 'bzrlib/transport/gio_transport.py'
--- bzrlib/transport/gio_transport.py 2010-05-28 18:52:03 +0000
+++ bzrlib/transport/gio_transport.py 2010-08-25 10:25:58 +0000
@@ -43,6 +43,12 @@
43 debug,43 debug,
44 ui,44 ui,
45 )45 )
46from bzrlib.symbol_versioning import (
47 DEPRECATED_PARAMETER,
48 deprecated_in,
49 deprecated_passed,
50 warn,
51 )
46from bzrlib.trace import mutter, warning52from bzrlib.trace import mutter, warning
47from bzrlib.transport import (53from bzrlib.transport import (
48 FileStream,54 FileStream,
@@ -262,7 +268,7 @@
262 else:268 else:
263 self._translate_gio_error(e, relpath)269 self._translate_gio_error(e, relpath)
264270
265 def get(self, relpath, decode=False, retries=0):271 def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0):
266 """Get the file at the given relative path.272 """Get the file at the given relative path.
267273
268 :param relpath: The relative path to the file274 :param relpath: The relative path to the file
@@ -272,6 +278,10 @@
272 We're meant to return a file-like object which bzr will278 We're meant to return a file-like object which bzr will
273 then read from. For now we do this via the magic of StringIO279 then read from. For now we do this via the magic of StringIO
274 """280 """
281 if deprecated_passed(decode):
282 warn(deprecated_in((2,3,0)) %
283 '"decode" parameter to GioTransport.get()',
284 DeprecationWarning, stacklevel=2)
275 try:285 try:
276 if 'gio' in debug.debug_flags:286 if 'gio' in debug.debug_flags:
277 mutter("GIO get: %s" % relpath)287 mutter("GIO get: %s" % relpath)