/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/git/cache.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-16 02:23:42 UTC
  • mfrom: (7340 work)
  • mto: This revision was merged to the branch mainline in revision 7350.
  • Revision ID: jelmer@jelmer.uk-20190616022342-ihxzayq04x5culzd
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    )
31
31
 
32
32
from .. import (
 
33
    bedding,
33
34
    errors as bzr_errors,
34
35
    osutils,
35
36
    registry,
46
47
    viewvalues,
47
48
    )
48
49
from ..transport import (
49
 
    get_transport,
 
50
    get_transport_from_path,
50
51
    )
51
52
 
52
53
 
53
54
def get_cache_dir():
54
 
    try:
55
 
        from xdg.BaseDirectory import xdg_cache_home
56
 
    except ImportError:
57
 
        from ..config import config_dir
58
 
        ret = os.path.join(config_dir(), "git")
59
 
    else:
60
 
        ret = os.path.join(xdg_cache_home, "breezy", "git")
61
 
    if not os.path.isdir(ret):
62
 
        os.makedirs(ret)
63
 
    return ret
 
55
    path = os.path.join(bedding.cache_dir(), "git")
 
56
    if not os.path.isdir(path):
 
57
        os.mkdir(path)
 
58
    return path
64
59
 
65
60
 
66
61
def get_remote_cache_transport(repository):
74
69
        path = os.path.join(get_cache_dir(), uuid)
75
70
        if not os.path.isdir(path):
76
71
            os.mkdir(path)
77
 
    return get_transport(path)
 
72
    return get_transport_from_path(path)
78
73
 
79
74
 
80
75
def check_pysqlite_version(sqlite3):
848
843
            except bzr_errors.FileExists:
849
844
                pass
850
845
            return cls(transport.clone('git'))
851
 
        from ..transport import get_transport
852
 
        return cls(get_transport(get_cache_dir()))
 
846
        return cls(get_transport_from_path(get_cache_dir()))
853
847
 
854
848
    def __repr__(self):
855
849
        if self._transport is not None: