/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Robert Collins
  • Date: 2007-07-02 05:26:25 UTC
  • mfrom: (2566 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2568.
  • Revision ID: robertc@robertcollins.net-20070702052625-motr7ljwhmqvw9rg
Merge with bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
213
213
    def _tarfile_response(self, tmp_dirname, compression):
214
214
        temp = tempfile.NamedTemporaryFile()
215
215
        try:
216
 
            self._tarball_of_dir(tmp_dirname, compression, temp.name)
 
216
            self._tarball_of_dir(tmp_dirname, compression, temp.file)
217
217
            # all finished; write the tempfile out to the network
218
218
            temp.seek(0)
219
219
            return SuccessfulSmartServerResponse(('ok',), temp.read())
222
222
        finally:
223
223
            temp.close()
224
224
 
225
 
    def _tarball_of_dir(self, dirname, compression, tarfile_name):
226
 
        tarball = tarfile.open(tarfile_name, mode='w:' + compression)
 
225
    def _tarball_of_dir(self, dirname, compression, ofile):
 
226
        tarball = tarfile.open(fileobj=ofile, mode='w|' + compression)
227
227
        try:
228
228
            # The tarball module only accepts ascii names, and (i guess)
229
229
            # packs them with their 8bit names.  We know all the files