Martin Pool wrote:
> 2009/12/1 David Muir <email address hidden>:
>
>> I'm a little confused by terminology... and Python in general...
>> IIUC, the transport assumes append based file streams (because of previous
>> limitations?). So even though the method is called append_file, having it
>> put the file instead is ok?
>>
>
> What's supposed to be happening here is that we are streaming out from
> the groupcompress level, which is going to write one long file in a
> series of chunks. The base class implementation in transport.py and
> AppendBasedFileStream changes them into a sequence of
> transport.append_bytes calls. However, since some servers don't
> support append, we need to make sure that by the time it gets to the
> ftp level we just open the file once and write one long stream.
>
> By the way for openftpd I think there is a configuration option to
> allow appending. But patches to avoid needing to set it would still
> be great.
>
>
Ok, I was able to get it working by skipping the if self._has_append
part, and just using self._fallback_append()
Probably not the ideal solution, but it worked :-)
Let me know if I'm on the right track and how it can be improved.
Martin Pool wrote: Stream changes them into a sequence of append_ bytes calls. However, since some servers don't append( )
> 2009/12/1 David Muir <email address hidden>:
>
>> I'm a little confused by terminology... and Python in general...
>> IIUC, the transport assumes append based file streams (because of previous
>> limitations?). So even though the method is called append_file, having it
>> put the file instead is ok?
>>
>
> What's supposed to be happening here is that we are streaming out from
> the groupcompress level, which is going to write one long file in a
> series of chunks. The base class implementation in transport.py and
> AppendBasedFile
> transport.
> support append, we need to make sure that by the time it gets to the
> ftp level we just open the file once and write one long stream.
>
> By the way for openftpd I think there is a configuration option to
> allow appending. But patches to avoid needing to set it would still
> be great.
>
>
Ok, I was able to get it working by skipping the if self._has_append
part, and just using self._fallback_
Probably not the ideal solution, but it worked :-)
Let me know if I'm on the right track and how it can be improved.
=== modified file 'bzrlib/ transport/ ftp/__init_ _.py' transport/ ftp/__init_ _.py 2009-10-06 08:24:14 +0000 transport/ ftp/__init_ _.py 2009-12-02 01:48:45 +0000 append( relpath, text, mode) append( relpath, text, mode) append( relpath, text, mode) append( relpath, text, mode)
--- bzrlib/
+++ bzrlib/
@@ -397,12 +397,12 @@
result = ftp.size(abspath)
else:
result = 0
-
- if self._has_append:
- mutter("FTP appe to %s", abspath)
- self._try_
- else:
- self._fallback_
+ #is this if/else required anymore?
+ #if self._has_append:
+ # mutter("FTP appe to %s", abspath)
+ # self._try_
+ #else:
+ self._fallback_
return result