~cjwatson/brz-svn/fix-http-probe

« back to all changes in this revision

Viewing changes to cache/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-03 09:16:45 UTC
  • Revision ID: jelmer@jelmer.uk-20200203091645-q0f1yq77zkr1s3cz
More Python3 / formatting / breezy fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    )
33
33
from breezy.sixish import text_type
34
34
 
35
 
from breezy.plugins.svn import version_info
 
35
from .. import version_info
36
36
 
37
37
 
38
38
class CacheConcurrencyError(Exception):
114
114
 
115
115
    def create_cache_dir(self):
116
116
        cache_dir = create_cache_dir()
117
 
        assert isinstance(cache_dir, str)
118
 
        dir = os.path.join(cache_dir, str(self.uuid))
 
117
        dir = os.path.join(cache_dir, str(self.uuid).encode('ascii'))
119
118
        if not os.path.exists(dir):
120
119
            trace.note("Initialising Subversion metadata cache in %s.",
121
120
                       dir.decode(osutils._fs_enc))
127
126
            self.create_cache_dir().decode(osutils._fs_enc))
128
127
 
129
128
    def open_fileid_map(self):
130
 
        from breezy.plugins.svn.fileids import FileIdMapCache
 
129
        from ..fileids import FileIdMapCache
131
130
        return FileIdMapCache(self.open_transport())
132
131
 
133
132
    def open_revid_map(self):
146
145
        pass
147
146
 
148
147
try:
149
 
    from breezy.plugins.svn.cache.tdbcache import TdbRepositoryCache
 
148
    from ..cache.tdbcache import TdbRepositoryCache
150
149
    cache_cls = TdbRepositoryCache
151
150
except ImportError:
152
 
    from breezy.plugins.svn.cache.sqlitecache import SqliteRepositoryCache
 
151
    from ..cache.sqlitecache import SqliteRepositoryCache
153
152
    cache_cls = SqliteRepositoryCache
154
153
 
155
154
def get_cache(uuid):