/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-07-03 01:42:53 UTC
  • mto: This revision was merged to the branch mainline in revision 7027.
  • Revision ID: jelmer@jelmer.uk-20180703014253-zjckmhgnmb2qsn6x
Disable some flaky tests on python3, allow running without fastimport.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
class GitBranchBuilder(object):
61
61
 
62
62
    def __init__(self, stream=None):
 
63
        if not FastimportFeature.available():
 
64
            raise tests.UnavailableFeature(FastimportFeature)
63
65
        self.commit_info = []
64
66
        self.orig_stream = stream
65
67
        if stream is None:
88
90
 
89
91
    def set_symlink(self, path, content):
90
92
        """Create or update symlink at a given path."""
91
 
        mark = self._create_blob(content)
 
93
        mark = self._create_blob(self._encode_path(content))
92
94
        mode = b'120000'
93
95
        self.commit_info.append(b'M %s :%d %s\n'
94
96
                % (mode, mark, self._encode_path(path)))
103
105
        self.commit_info.append(b'M %s :%d %s\n'
104
106
                                % (mode, mark, self._encode_path(path)))
105
107
 
106
 
    def set_link(self, path, link_target):
107
 
        """Create or update a link at a given path."""
108
 
        mark = self._create_blob(self._encode_path(link_target))
109
 
        self.commit_info.append(b'M 120000 :%d %s\n'
110
 
                                % (mark, self._encode_path(path)))
111
 
 
112
108
    def delete_entry(self, path):
113
109
        """This will delete files or symlinks at the given location."""
114
110
        self.commit_info.append(b'D %s\n' % (self._encode_path(path),))