Merge lp:~jelmer/brz/iter-bytes into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/iter-bytes
Merge into: lp:brz
Diff against target: 59 lines (+6/-6)
3 files modified
breezy/bzr/vf_repository.py (+1/-1)
breezy/git/object_store.py (+2/-2)
breezy/plugins/commitfromnews/committemplate.py (+3/-3)
To merge this branch: bzr merge lp:~jelmer/brz/iter-bytes
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+378776@code.launchpad.net

Commit message

iter_files_bytes can return iterators.

Description of the change

iter_files_bytes can return iterators.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/bzr/vf_repository.py'
2--- breezy/bzr/vf_repository.py 2020-02-09 01:16:06 +0000
3+++ breezy/bzr/vf_repository.py 2020-02-09 17:13:48 +0000
4@@ -1279,7 +1279,7 @@
5 for record in self.texts.get_record_stream(text_keys, 'unordered', True):
6 if record.storage_kind == 'absent':
7 raise errors.RevisionNotPresent(record.key[1], record.key[0])
8- yield text_keys[record.key], record.get_bytes_as('chunked')
9+ yield text_keys[record.key], record.iter_bytes_as('chunked')
10
11 def _generate_text_key_index(self, text_key_references=None,
12 ancestors=None):
13
14=== modified file 'breezy/git/object_store.py'
15--- breezy/git/object_store.py 2019-11-23 20:50:53 +0000
16+++ breezy/git/object_store.py 2020-02-09 17:13:48 +0000
17@@ -306,7 +306,7 @@
18 for (path, file_id), chunks in tree.iter_files_bytes(
19 [(path, (path, file_id)) for (path, file_id) in new_blobs]):
20 obj = Blob()
21- obj.chunked = chunks
22+ obj.chunked = list(chunks)
23 if add_cache_entry is not None:
24 add_cache_entry(obj, (file_id, tree.get_file_revision(path)), path)
25 yield path, obj, (file_id, tree.get_file_revision(path))
26@@ -567,7 +567,7 @@
27 ((key[0], key[1], key) for key in keys))
28 for (file_id, revision, expected_sha), chunks in stream:
29 blob = Blob()
30- blob.chunked = chunks
31+ blob.chunked = list(chunks)
32 if blob.id != expected_sha and blob.data == b"":
33 # Perhaps it's a symlink ?
34 tree = self.tree_cache.revision_tree(revision)
35
36=== modified file 'breezy/plugins/commitfromnews/committemplate.py'
37--- breezy/plugins/commitfromnews/committemplate.py 2019-03-02 21:46:18 +0000
38+++ breezy/plugins/commitfromnews/committemplate.py 2020-02-09 17:13:48 +0000
39@@ -58,9 +58,9 @@
40 return self.message
41 if found_old_path is None:
42 # New file
43- _, new_chunks = list(
44+ _, new_chunks = next(
45 self.commit.builder.repository.iter_files_bytes(
46- [(found_entry.file_id, found_entry.revision, None)]))[0]
47+ [(found_entry.file_id, found_entry.revision, None)]))
48 content = b''.join(new_chunks).decode('utf-8')
49 return self.merge_message(content)
50 else:
51@@ -76,7 +76,7 @@
52 contents = self.commit.builder.repository.iter_files_bytes(needed)
53 lines = {}
54 for name, chunks in contents:
55- lines[name] = osutils.chunks_to_lines(chunks)
56+ lines[name] = osutils.chunks_to_lines(list(chunks))
57 new = lines['new']
58 sequence_matcher = patiencediff.PatienceSequenceMatcher(
59 None, lines['old'], new)

Subscribers

People subscribed via source and target branches