2) There are no tests for this. the test suite is still pretty new, but its a good idea to test things - in particular in cases like this we need to be fairly confident it will be incremental and not block on the export - I can imagine the wsgi layer buffering everything, for instance. [in fact, I'll lay odds it will unless we fix a few things].
3) The export function is a copy-paste-tweak of the core from bzrlib. This will lead to bugs as that code base evolves - we should instead get a supported function in bzrlib lib that we can import and use.
I'm putting this back to WIP - but its a great start. Please keep at it and just shout if you need pointers.
This looks very interesting.
Three isues:
1) Object( object) :
+class TarExporterFile
+
+ def __init__(self):
+ self._buffer = ''
+
+ def write(self, str):
+ self._buffer += str
+
+ def get_buffer(self):
+ buffer = self._buffer
+ self._buffer = ''
+ return buffer
This is going to be somewhat inefficient. Try this:
+class TarExporterFile Object( object) : append( str) self._buffer)
+
+ def __init__(self):
+ self._buffer = []
+
+ def write(self, str):
+ self._buffer.
+
+ def get_buffer(self):
+ try:
+ return ''.join(
+ finally:
+ self._buffer = []
2) There are no tests for this. the test suite is still pretty new, but its a good idea to test things - in particular in cases like this we need to be fairly confident it will be incremental and not block on the export - I can imagine the wsgi layer buffering everything, for instance. [in fact, I'll lay odds it will unless we fix a few things].
3) The export function is a copy-paste-tweak of the core from bzrlib. This will lead to bugs as that code base evolves - we should instead get a supported function in bzrlib lib that we can import and use.
I'm putting this back to WIP - but its a great start. Please keep at it and just shout if you need pointers.