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

  • Committer: Jelmer Vernooij
  • Date: 2009-04-02 16:10:24 UTC
  • mto: (0.200.326 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20090402161024-ngoay3s4mpsq5pts
Add -Dverify flag (not fully implemented yet).

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
default_mapping = BzrGitMappingv1()
142
142
 
143
143
 
 
144
def text_to_blob(text):
 
145
    from dulwich.objects import Blob
 
146
    blob = Blob()
 
147
    blob._text = text
 
148
    return blob
 
149
 
 
150
 
144
151
def inventory_to_tree_and_blobs(repo, mapping, revision_id):
145
 
    from dulwich.objects import Tree, Blob
 
152
    from dulwich.objects import Tree
146
153
    from bzrlib.inventory import InventoryDirectory, InventoryFile
147
154
    import stat
148
155
    stack = []
170
177
        if type(entry) == InventoryFile:
171
178
            #FIXME: We can make potentially make this Lazy to avoid shaing lots of stuff
172
179
            # and having all these objects in memory at once
173
 
            blob = Blob()
174
 
            blob._text = repo.texts.get_record_stream([(entry.file_id, entry.revision)], 'unordered', True).next().get_bytes_as('fulltext')
 
180
            text = repo.texts.get_record_stream([(entry.file_id, entry.revision)], 'unordered', True).next().get_bytes_as('fulltext')
 
181
            blob = text_to_blob(text)
175
182
            sha = blob.id
176
183
            yield sha, blob, path
177
184