Merge lp:~jelmer/brz/fix-git-send 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/fix-git-send
Merge into: lp:brz
Diff against target: 32 lines (+6/-4)
1 file modified
breezy/git/send.py (+6/-4)
To merge this branch: bzr merge lp:~jelmer/brz/fix-git-send
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+374755@code.launchpad.net

Commit message

Fix "bzr send" on git repositories.

Description of the change

Fix "bzr send" on git repositories.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/git/send.py'
--- breezy/git/send.py 2019-06-29 21:31:14 +0000
+++ breezy/git/send.py 2019-10-27 04:45:38 +0000
@@ -126,14 +126,15 @@
126 return self.patch.splitlines(True)126 return self.patch.splitlines(True)
127127
128 def to_files(self):128 def to_files(self):
129 return self.patches129 return ((summary, patch.splitlines(True)) for (summary, patch) in self.patches)
130130
131 @classmethod131 @classmethod
132 def _generate_commit(cls, repository, revision_id, num, total):132 def _generate_commit(cls, repository, revision_id, num, total,
133 context=_mod_diff.DEFAULT_CONTEXT_AMOUNT):
133 s = BytesIO()134 s = BytesIO()
134 store = get_object_store(repository)135 store = get_object_store(repository)
135 with store.lock_read():136 with store.lock_read():
136 commit = store[store._lookup_revision_sha1(revision_id)]137 commit = store[repository.lookup_bzr_revision_id(revision_id)[0]]
137 from dulwich.patch import write_commit_patch, get_summary138 from dulwich.patch import write_commit_patch, get_summary
138 try:139 try:
139 lhs_parent = repository.get_revision(revision_id).parent_ids[0]140 lhs_parent = repository.get_revision(revision_id).parent_ids[0]
@@ -143,7 +144,8 @@
143 tree_2 = repository.revision_tree(revision_id)144 tree_2 = repository.revision_tree(revision_id)
144 contents = BytesIO()145 contents = BytesIO()
145 differ = GitDiffTree.from_trees_options(146 differ = GitDiffTree.from_trees_options(
146 tree_1, tree_2, contents, 'utf8', None, 'a/', 'b/', None)147 tree_1, tree_2, contents, 'utf8', None, 'a/', 'b/', None,
148 context_lines=context)
147 differ.show_diff(None, None)149 differ.show_diff(None, None)
148 write_commit_patch(s, commit, contents.getvalue(), (num, total),150 write_commit_patch(s, commit, contents.getvalue(), (num, total),
149 version_tail)151 version_tail)

Subscribers

People subscribed via source and target branches