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

  • Committer: Jelmer Vernooij
  • Date: 2020-08-10 15:00:17 UTC
  • mfrom: (7490.40.99 work)
  • mto: This revision was merged to the branch mainline in revision 7521.
  • Revision ID: jelmer@jelmer.uk-20200810150017-vs7xnrd1vat4iktg
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Map from Git sha's to Bazaar objects."""
19
19
 
20
 
from __future__ import absolute_import
21
 
 
22
20
from dulwich.objects import (
23
21
    Blob,
24
22
    Commit,
46
44
from ..revision import (
47
45
    NULL_REVISION,
48
46
    )
49
 
from ..sixish import viewitems
50
47
from ..tree import InterTree
51
48
from ..bzr.testament import (
52
49
    StrictTestament3,
312
309
    for (path, file_id), chunks in tree.iter_files_bytes(
313
310
            [(path, (path, file_id)) for (path, file_id) in new_blobs]):
314
311
        obj = Blob()
315
 
        obj.chunked = chunks
 
312
        obj.chunked = list(chunks)
316
313
        if add_cache_entry is not None:
317
314
            add_cache_entry(obj, (file_id, tree.get_file_revision(path)), path)
318
315
        yield path, obj, (file_id, tree.get_file_revision(path))
405
402
 
406
403
    def __iter__(self):
407
404
        return ((self.store[object_id], path) for (object_id, path) in
408
 
                viewitems(self.objects))
 
405
                self.objects.items())
409
406
 
410
407
 
411
408
class BazaarObjectStore(BaseObjectStore):
573
570
            ((key[0], key[1], key) for key in keys))
574
571
        for (file_id, revision, expected_sha), chunks in stream:
575
572
            blob = Blob()
576
 
            blob.chunked = chunks
 
573
            blob.chunked = list(chunks)
577
574
            if blob.id != expected_sha and blob.data == b"":
578
575
                # Perhaps it's a symlink ?
579
576
                tree = self.tree_cache.revision_tree(revision)