/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 breezy/plugins/git/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-15 19:05:51 UTC
  • mfrom: (6968 work)
  • mto: (6973.5.1 python3-c)
  • mto: This revision was merged to the branch mainline in revision 6984.
  • Revision ID: jelmer@jelmer.uk-20180515190551-epr5abd0mtxmrehr
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
from __future__ import absolute_import
21
21
 
22
 
from cStringIO import StringIO
 
22
from io import BytesIO
23
23
 
24
24
import time
25
25
 
27
27
    errors as bzr_errors,
28
28
    tests,
29
29
    )
30
 
from ....tests.features import Feature
 
30
from ....tests.features import (
 
31
    Feature,
 
32
    ModuleAvailableFeature,
 
33
    )
31
34
from .. import (
32
35
    import_dulwich,
33
36
    )
34
 
from fastimport import (
35
 
    commands,
36
 
    )
37
37
 
38
38
TestCase = tests.TestCase
39
39
TestCaseInTempDir = tests.TestCaseInTempDir
54
54
 
55
55
 
56
56
DulwichFeature = _DulwichFeature()
 
57
FastimportFeature = ModuleAvailableFeature('fastimport')
57
58
 
58
59
 
59
60
class GitBranchBuilder(object):
62
63
        self.commit_info = []
63
64
        self.orig_stream = stream
64
65
        if stream is None:
65
 
            self.stream = StringIO()
 
66
            self.stream = BytesIO()
66
67
        else:
67
68
            self.stream = stream
68
69
        self._counter = 0
80
81
 
81
82
    def _create_blob(self, content):
82
83
        self._counter += 1
83
 
        blob = commands.BlobCommand(str(self._counter), content)
 
84
        from fastimport.commands import BlobCommand
 
85
        blob = BlobCommand(str(self._counter), content)
84
86
        self._write(str(blob)+"\n")
85
87
        return self._counter
86
88