~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/upstream_import.py

  • Committer: Aaron Bentley
  • Date: 2011-09-25 01:23:51 UTC
  • mfrom: (778 bzrtools.dev)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: aaron@aaronbentley.com-20110925012351-s3q6441rx3tqyw2n
Merged bzrtools.dev into fix-nick-reference.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    transform
12
12
    )
13
13
from bzrlib.bzrdir import BzrDir
14
 
from bzrlib.export.tar_exporter import export_tarball
 
14
from bzrlib.export import export
15
15
from bzrlib.plugins.bzrtools import errors
16
16
from bzrlib.plugins.bzrtools.upstream_import import (
17
17
    common_directory,
26
26
from bzrlib.tests import (
27
27
    TestCaseInTempDir,
28
28
    TestCaseWithTransport,
29
 
    UnicodeFilenameFeature,
30
29
    )
 
30
try:
 
31
    from bzrlib.tests.features import UnicodeFilenameFeature
 
32
except ImportError: # bzr < 2.5
 
33
    from bzrlib.tests import UnicodeFilenameFeature
31
34
 
32
35
 
33
36
def import_tar_broken(tree, tar_input):
274
277
 
275
278
    def transform_to_tar(self, tt):
276
279
        stream = StringIO()
277
 
        tarball = tarfile.open(None, 'w|', stream)
278
 
        export_tarball(tt.get_preview_tree(), tarball, '')
 
280
        export(tt.get_preview_tree(), root='', fileobj=stream, format='tar',
 
281
               dest=None)
279
282
        return stream
280
283
 
281
284
    def get_empty_tt(self):