Merge lp:~jelmer/brz/launchpad-git-push into lp:brz/3.1

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/launchpad-git-push
Merge into: lp:brz/3.1
Diff against target: 69 lines (+17/-6)
3 files modified
breezy/git/remote.py (+10/-4)
breezy/plugins/launchpad/hoster.py (+3/-2)
doc/en/release-notes/brz-3.1.txt (+4/-0)
To merge this branch: bzr merge lp:~jelmer/brz/launchpad-git-push
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+388175@code.launchpad.net

Commit message

Fix various issues pushing to Launchpad Git repositories.

Description of the change

Fix various issues pushing to Launchpad 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
1=== modified file 'breezy/git/remote.py'
2--- breezy/git/remote.py 2020-07-15 22:39:05 +0000
3+++ breezy/git/remote.py 2020-07-28 02:42:32 +0000
4@@ -610,11 +610,16 @@
5 push_result.branch_push_result = None
6 repo = self.find_repository()
7 refname = self._get_selected_ref(name)
8- ref_chain, old_sha = self.get_refs_container().follow(refname)
9- if ref_chain:
10- actual_refname = ref_chain[-1]
11- else:
12+ try:
13+ ref_chain, old_sha = self.get_refs_container().follow(refname)
14+ except NotBranchError:
15 actual_refname = refname
16+ old_sha = None
17+ else:
18+ if ref_chain:
19+ actual_refname = ref_chain[-1]
20+ else:
21+ actual_refname = refname
22 if isinstance(source, GitBranch) and lossy:
23 raise errors.LossyPushToSameVCS(source.controldir, self)
24 source_store = get_object_store(source.repository)
25@@ -634,6 +639,7 @@
26 raise errors.NoRoundtrippingSupport(
27 source, self.open_branch(name=name, nascent_ok=True))
28 if not overwrite:
29+ old_sha = remote_refs.get(actual_refname)
30 if remote_divergence(old_sha, new_sha, source_store):
31 raise DivergedBranches(
32 source, self.open_branch(name, nascent_ok=True))
33
34=== modified file 'breezy/plugins/launchpad/hoster.py'
35--- breezy/plugins/launchpad/hoster.py 2020-07-24 17:47:14 +0000
36+++ breezy/plugins/launchpad/hoster.py 2020-07-28 02:42:32 +0000
37@@ -723,7 +723,8 @@
38 revid=self.source_branch.last_revision())
39
40 def create_proposal(self, description, reviewers=None, labels=None,
41- prerequisite_branch=None, commit_message=None):
42+ prerequisite_branch=None, commit_message=None,
43+ work_in_progress=False, allow_collaboration=False):
44 """Perform the submission."""
45 if labels:
46 raise LabelsUnsupported(self)
47@@ -741,7 +742,7 @@
48 merge_prerequisite=prereq_branch_lp,
49 initial_comment=description.strip(),
50 commit_message=commit_message,
51- needs_review=True,
52+ needs_review=(not work_in_progress),
53 reviewers=[self.launchpad.people[reviewer].self_link
54 for reviewer in reviewers],
55 review_types=[None for reviewer in reviewers])
56
57=== modified file 'doc/en/release-notes/brz-3.1.txt'
58--- doc/en/release-notes/brz-3.1.txt 2020-07-28 01:28:20 +0000
59+++ doc/en/release-notes/brz-3.1.txt 2020-07-28 02:42:32 +0000
60@@ -66,6 +66,10 @@
61 * Prevent exceptions during commit when quilt is not installed but
62 the tree contains quilt patches. (Jelmer Vernooij)
63
64+ * Support pushing to Git repositories that do not yet exist,
65+ such as is the case on Launchpad repositories.
66+ (Jelmer Vernooij)
67+
68 Documentation
69 *************
70

Subscribers

People subscribed via source and target branches