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

Partially fix pull.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
from bzrlib.revision import (
18
 
    NULL_REVISION,
19
 
    )
20
 
from bzrlib.versionedfile import (
21
 
    AbsentContentFactory,
22
 
    FulltextContentFactory,
23
 
    VersionedFiles,
24
 
    )
25
 
 
26
 
from bzrlib.plugins.git.converter import (
27
 
    GitObjectConverter,
28
 
    )
 
17
from bzrlib.revision import NULL_REVISION
 
18
from bzrlib.versionedfile import VersionedFiles, AbsentContentFactory
29
19
 
30
20
class GitTexts(VersionedFiles):
31
21
 
32
22
    def __init__(self, repository):
33
23
        self.repository = repository
34
 
        
35
24
 
36
25
    def check(self, progressbar=None):
37
26
        return True
41
30
 
42
31
    def get_record_stream(self, keys, ordering, include_delta_closure):
43
32
        for key in keys:
44
 
            (fileid, revid) = key
45
 
            (foreign_revid, mapping) = self.repository.revision_id_bzr_to_foreign(revid)
46
 
            idmap = GitObjectConverter(self.repository, mapping)._idmap
47
 
            path = mapping.parse_file_id(fileid)
48
 
            try:
49
 
                sha = idmap.lookup_tree(path, revid)
50
 
            except KeyError:
51
 
                try:
52
 
                    sha = idmap.lookup_blob(fileid, revid)
53
 
                except KeyError:
54
 
                    yield AbsentContentFactory(key)
55
 
                else:
56
 
                    blob = self.repository.object_store[sha]
57
 
                    yield FulltextContentFactory(key, None, None, "")
58
 
            else:
59
 
                yield FulltextContentFactory(key, None, None, blob)
 
33
            yield AbsentContentFactory(key)
60
34
 
61
35
    def get_parent_map(self, keys):
62
36
        raise NotImplementedError(self.get_parent_map)
63
37
 
 
38
 
 
39