/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 git_repository.py

Switch to using GitPython rather than our own in-house stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""An adapter between a Git Repository and a Bazaar Branch"""
18
18
 
 
19
import git
19
20
import os
20
21
 
21
22
import bzrlib
34
35
from bzrlib.plugins.git import (
35
36
    cache,
36
37
    ids,
37
 
    model,
38
38
    )
39
39
 
40
40
 
49
49
    def __init__(self, gitdir, lockfiles):
50
50
        self.bzrdir = gitdir
51
51
        self.control_files = lockfiles
52
 
        self._git = self._make_model(gitdir.transport)
 
52
        self._git = git.repo.Repo(gitdir.root_transport.local_abspath("."))
53
53
        self._revision_cache = {}
54
54
        self._blob_cache = {}
55
55
        self._blob_info_cache = {}
60
60
            cachedbs[cache_file] = cache.sqlite3.connect(cache_file)
61
61
        self.cachedb = cachedbs[cache_file]
62
62
        self._init_cachedb()
 
63
        self.texts = None
 
64
        self.signatures = None
 
65
        self.revisions = None
63
66
        self._format = GitFormat()
64
67
 
65
68
    def _init_cachedb(self):
79
82
        """)
80
83
        self.cachedb.commit()
81
84
 
82
 
 
83
 
    @classmethod
84
 
    def _make_model(klass, transport):
85
 
        gitdirectory = transport.local_abspath('.')
86
 
        return model.GitModel(gitdirectory)
87
 
 
88
 
 
89
85
    def _ancestor_revisions(self, revision_ids):
90
86
        if revision_ids is not None:
91
87
            git_revisions = [gitrevid_from_bzr(r) for r in revision_ids]