/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

More work on roundtrip push support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    Tree,
24
24
    )
25
25
 
 
26
from bzrlib import (
 
27
    annotate,
 
28
    )
 
29
 
26
30
from bzrlib.versionedfile import (
27
31
    AbsentContentFactory,
28
 
    FulltextContentFactory,
 
32
    ChunkedContentFactory,
29
33
    VersionedFiles,
30
34
    )
31
35
 
39
43
    def check(self, progressbar=None):
40
44
        return True
41
45
 
 
46
    def get_annotator(self):
 
47
        return annotate.Annotator(self)
 
48
 
42
49
    def iterkeys(self):
43
50
        for sha in self.object_store:
44
51
            if type(sha) == Commit:
59
66
            except KeyError:
60
67
                yield AbsentContentFactory(key)
61
68
            else:
62
 
                yield FulltextContentFactory(key, 
 
69
                yield ChunkedContentFactory(key, 
63
70
                    tuple([(self.repository.lookup_foreign_revision_id(p, mapping),) for p in commit.parents]), None, 
64
 
                    commit.as_raw_string())
 
71
                    commit.as_raw_chunks())
65
72
 
66
73
    def get_parent_map(self, keys):
67
74
        ret = {}
84
91
    def check(self, progressbar=None):
85
92
        return True
86
93
 
 
94
    def get_annotator(self):
 
95
        return annotate.Annotator(self)
 
96
 
87
97
    def add_mpdiffs(self, records):
88
98
        raise NotImplementedError(self.add_mpdiffs)
89
99
 
94
104
            root_tree = self.object_store[commit_id].tree
95
105
            path = mapping.parse_file_id(fileid)
96
106
            try:
97
 
                (mode, item_id) = tree_lookup_path(
 
107
                obj = tree_lookup_path(
98
108
                    self.object_store.__getitem__, root_tree, path)
99
 
                obj = self.object_store[item_id]
 
109
                if isinstance(obj, tuple):
 
110
                    (mode, item_id) = obj
 
111
                    obj = self.object_store[item_id]
100
112
            except KeyError:
101
113
                yield AbsentContentFactory(key)
102
114
            else:
103
115
                if isinstance(obj, Tree):
104
 
                    yield FulltextContentFactory(key, None, None, "")
 
116
                    yield ChunkedContentFactory(key, None, None, [])
105
117
                elif isinstance(obj, Blob):
106
 
                    yield FulltextContentFactory(key, None, None, obj.data)
 
118
                    yield ChunkedContentFactory(key, None, None, obj.chunked)
107
119
                else:
108
120
                    raise AssertionError("file text resolved to %r" % obj)
109
121