/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-07-05 12:50:01 UTC
  • mfrom: (7490.40.46 work)
  • mto: (7490.40.48 work)
  • mto: This revision was merged to the branch mainline in revision 7519.
  • Revision ID: jelmer@jelmer.uk-20200705125001-7s3vo0p55szbbws7
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
 
20
22
from dulwich.objects import (
21
23
    Blob,
22
24
    Commit,
44
46
from ..revision import (
45
47
    NULL_REVISION,
46
48
    )
 
49
from ..sixish import viewitems
47
50
from ..tree import InterTree
48
51
from ..bzr.testament import (
49
52
    StrictTestament3,
309
312
    for (path, file_id), chunks in tree.iter_files_bytes(
310
313
            [(path, (path, file_id)) for (path, file_id) in new_blobs]):
311
314
        obj = Blob()
312
 
        obj.chunked = list(chunks)
 
315
        obj.chunked = chunks
313
316
        if add_cache_entry is not None:
314
317
            add_cache_entry(obj, (file_id, tree.get_file_revision(path)), path)
315
318
        yield path, obj, (file_id, tree.get_file_revision(path))
402
405
 
403
406
    def __iter__(self):
404
407
        return ((self.store[object_id], path) for (object_id, path) in
405
 
                self.objects.items())
 
408
                viewitems(self.objects))
406
409
 
407
410
 
408
411
class BazaarObjectStore(BaseObjectStore):
570
573
            ((key[0], key[1], key) for key in keys))
571
574
        for (file_id, revision, expected_sha), chunks in stream:
572
575
            blob = Blob()
573
 
            blob.chunked = list(chunks)
 
576
            blob.chunked = chunks
574
577
            if blob.id != expected_sha and blob.data == b"":
575
578
                # Perhaps it's a symlink ?
576
579
                tree = self.tree_cache.revision_tree(revision)