Merge lp:~jelmer/brz/merge-3.3 into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 7665
Proposed branch: lp:~jelmer/brz/merge-3.3
Merge into: lp:brz
Diff against target: 212 lines (+69/-12)
7 files modified
.github/workflows/wheels.yaml (+3/-1)
Cargo.toml (+0/-1)
breezy/forge.py (+28/-3)
breezy/main.rs (+3/-4)
breezy/plugins/github/forge.py (+20/-0)
breezy/plugins/launchpad/forge.py (+5/-1)
breezy/plugins/propose/cmds.py (+10/-2)
To merge this branch: bzr merge lp:~jelmer/brz/merge-3.3
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+432559@code.launchpad.net

Commit message

Description of the change

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 :
Download full text (13.6 KiB)

The attempt to merge lp:~jelmer/brz/merge-3.3 into lp:brz failed. Command exited with 142.
Below is the output from the failed tests.

Collecting setuptools-gettext
  Downloading setuptools_gettext-0.1.1-py3-none-any.whl (10 kB)
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.10/site-packages (from setuptools-gettext) (65.5.0)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.1
Obtaining file:///tmp/tarmac/branch.yo2dq1va
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Checking if build backend supports build_editable: started
  Checking if build backend supports build_editable: finished with status 'done'
  Getting requirements to build editable: started
  Getting requirements to build editable: finished with status 'done'
  Preparing editable metadata (pyproject.toml): started
  Preparing editable metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
Requirement already satisfied: dulwich>=0.20.46 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.20.46)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.2.3)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.4.1)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.8)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.26.12)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
Collecting fastimport
  Downloading fastimport-0.9.14.tar.gz (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.8/41.8 kB 1.1 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Collecting python-subunit
  Downloading python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.1/106.1 kB 3.3 MB/s eta 0:00:00
Collecting testtools
  Downloading testtools-2.5.0-py3-none-any.whl (181 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.0/182.0 kB 8.6 MB/s eta 0:00:00
Requirement already satisfied: paramiko in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (2.10.4)
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.10.17)
Collecting sphinx
  Downloading sphinx-5.3.0-py3-none-any.whl (3.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 8.3 MB/s eta 0:00:00
Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Collecting sphinx-epytext
  Downloading sphinx-epytext-0.0.4.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from l...

lp:~jelmer/brz/merge-3.3 updated
7665. By Ondřej Pohořelský

Merge lp:brz/3.3

by jelmer review by jelmer

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.github/workflows/wheels.yaml'
2--- .github/workflows/wheels.yaml 2022-10-21 07:48:29 +0000
3+++ .github/workflows/wheels.yaml 2022-11-03 21:05:37 +0000
4@@ -43,7 +43,9 @@
5 - name: Build wheels
6 run: python -m cibuildwheel --output-dir wheelhouse
7 env:
8- CIBW_ARCHS_LINUX: x86_64 aarch64
9+ CIBW_ARCHS_LINUX: x86_64
10+ # ARM builds fail at the moment:
11+ # CIBW_ARCHS_LINUX: x86_64 aarch64
12 CIBW_ARCHS_MACOS: x86_64 arm64 universal2
13 CIBW_SKIP: '*-win32'
14 CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH"'
15
16=== modified file 'Cargo.toml'
17--- Cargo.toml 2022-10-29 18:49:13 +0000
18+++ Cargo.toml 2022-11-03 21:05:37 +0000
19@@ -19,5 +19,4 @@
20 path = "breezy/main.rs"
21
22 [dependencies]
23-pkg-version = "1.0.0"
24 pyo3 = ">=0.14,<0.16"
25
26=== modified file 'breezy/forge.py'
27--- breezy/forge.py 2022-11-02 11:49:27 +0000
28+++ breezy/forge.py 2022-11-03 21:05:37 +0000
29@@ -221,7 +221,7 @@
30 raise NotImplementedError(self.post_comment)
31
32 def reopen(self):
33- """Reopen the merge proposal if it is closed."""
34+ """Reopen this merge proposal."""
35 raise NotImplementedError(self.reopen)
36
37
38@@ -366,7 +366,7 @@
39 def probe_from_hostname(cls, hostname, possible_transports=None):
40 """Create a Forge object if this forge knows about a hostname.
41 """
42- raise NotImplementedError(self.probe_from_hostname)
43+ raise NotImplementedError(cls.probe_from_hostname)
44
45 @classmethod
46 def probe_from_branch(cls, branch):
47@@ -379,7 +379,7 @@
48 def probe_from_url(cls, url, possible_transports=None):
49 """Create a Forge object if this forge knows about a URL."""
50 hostname = urlutils.URL.from_string(url).host
51- return cls.probe_from_hostname(hostname, possible_forges)
52+ return cls.probe_from_hostname(hostname, possible_transports=possible_transports)
53
54 def iter_my_proposals(self, status='open', author=None):
55 """Iterate over the proposals created by the currently logged in user.
56@@ -406,6 +406,11 @@
57 """
58 raise NotImplementedError(self.delete_project)
59
60+ def create_project(self, name):
61+ """Create a project.
62+ """
63+ raise NotImplementedError(self.create_project)
64+
65 @classmethod
66 def iter_instances(cls):
67 """Iterate instances.
68@@ -505,4 +510,24 @@
69 raise UnsupportedForge(url)
70
71
72+def create_project(url: str) -> None:
73+ """Create a project.
74+
75+ Args:
76+ url: URL of project to create
77+ """
78+ parsed_url = urlutils.URL.from_string(url)
79+ hostname = parsed_url.host
80+ for name, forge_cls in forges.items():
81+ try:
82+ hoster = forge_cls.probe_from_url(url)
83+ except UnsupportedForge:
84+ pass
85+ else:
86+ hoster.create_project(parsed_url.path)
87+ break
88+ else:
89+ raise UnsupportedForge(url)
90+
91+
92 forges = registry.Registry()
93
94=== modified file 'breezy/main.rs'
95--- breezy/main.rs 2021-11-20 02:18:52 +0000
96+++ breezy/main.rs 2022-11-03 21:05:37 +0000
97@@ -1,13 +1,12 @@
98-use pkg_version::*;
99 use pyo3::prelude::*;
100 use pyo3::types::*;
101 use std::path::*;
102
103-const MAJOR: u32 = pkg_version_major!();
104-const MINOR: u32 = pkg_version_minor!();
105-const PATCH: u32 = pkg_version_patch!();
106
107 fn check_version(py: Python<'_>) -> PyResult<()> {
108+ let MAJOR: u32 = env!("CARGO_PKG_VERSION_MAJOR").parse::<u32>().unwrap();
109+ let MINOR: u32 = env!("CARGO_PKG_VERSION_MINOR").parse::<u32>().unwrap();
110+ let PATCH: u32 = env!("CARGO_PKG_VERSION_PATCH").parse::<u32>().unwrap();
111 let breezy = PyModule::import(py, "breezy").map_err(|e| {
112 eprintln!(
113 "brz: ERROR: Couldn't import breezy and dependencies.\n\
114
115=== modified file 'breezy/plugins/github/forge.py'
116--- breezy/plugins/github/forge.py 2022-11-01 10:25:33 +0000
117+++ breezy/plugins/github/forge.py 2022-11-03 21:05:37 +0000
118@@ -708,6 +708,26 @@
119 return json.loads(response.text)
120 raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
121
122+ def create_project(self, path, *, description=None, homepage=None,
123+ private=False, has_issues=True, has_projects=False,
124+ has_wiki=False):
125+ owner, name = path.split('/')
126+ path = 'repos'
127+ data = {
128+ "name": "name",
129+ "description": description,
130+ "homepage": homepage,
131+ "private": private,
132+ "has_issues": has_issues,
133+ "has_projects": has_projects,
134+ "has_wiki": has_wiki,
135+ }
136+ response = self._api_request(
137+ 'POST', path, body=json.dumps(data).encode('utf-8'))
138+ if response.status != 201:
139+ return json.loads(response.text)
140+ raise UnexpectedHttpStatus(path, response.status, headers=response.getheaders())
141+
142 def get_current_user(self):
143 if self._token is not None:
144 return self.current_user['login']
145
146=== modified file 'breezy/plugins/launchpad/forge.py'
147--- breezy/plugins/launchpad/forge.py 2022-11-01 10:25:33 +0000
148+++ breezy/plugins/launchpad/forge.py 2022-11-03 21:05:37 +0000
149@@ -110,7 +110,7 @@
150 self._mp = mp
151
152 def get_web_url(self):
153- return self.web_link
154+ return self._mp.web_link
155
156 def get_source_branch_url(self):
157 if self._mp.source_branch:
158@@ -545,6 +545,10 @@
159 mp = self.launchpad.load(api_url)
160 return LaunchpadMergeProposal(mp)
161
162+ def create_project(self, path):
163+ self.launchpad.projects.new_project(
164+ display_name=path, name=path, summary=path, title=path)
165+
166
167 class LaunchpadBazaarMergeProposalBuilder(MergeProposalBuilder):
168
169
170=== modified file 'breezy/plugins/propose/cmds.py'
171--- breezy/plugins/propose/cmds.py 2022-10-31 16:47:31 +0000
172+++ breezy/plugins/propose/cmds.py 2022-11-03 21:05:37 +0000
173@@ -162,6 +162,7 @@
174 Option('allow-empty',
175 help='Do not prevent empty merge proposals.'),
176 Option('overwrite', help="Overwrite existing commits."),
177+ Option('open', help='Open merge proposal in web browser'),
178 ]
179 takes_args = ['submit_branch?']
180
181@@ -170,7 +171,8 @@
182 def run(self, submit_branch=None, directory='.', forge=None,
183 reviewers=None, name=None, no_allow_lossy=False, description=None,
184 labels=None, prerequisite=None, commit_message=None, wip=False,
185- allow_collaboration=False, allow_empty=False, overwrite=False):
186+ allow_collaboration=False, allow_empty=False, overwrite=False,
187+ open=False):
188 tree, branch, relpath = (
189 controldir.ControlDir.open_containing_tree_or_branch(directory))
190 if submit_branch is None:
191@@ -194,7 +196,8 @@
192 overwrite=overwrite)
193 branch.set_push_location(remote_branch.user_url)
194 branch.set_submit_branch(target.user_url)
195- note(gettext('Published branch to %s') % public_branch_url)
196+ note(gettext('Published branch to %s'),
197+ forge.get_web_url(remote_branch) or public_branch_url)
198 if prerequisite is not None:
199 prerequisite_branch = _mod_branch.Branch.open(prerequisite)
200 else:
201@@ -217,6 +220,11 @@
202 note(gettext('There is already a branch merge proposal: %s'), e.url)
203 else:
204 note(gettext('Merge proposal created: %s') % proposal.url)
205+ if open:
206+ web_url = proposal.get_web_url()
207+ note(gettext('Opening %s in web browser'), web_url)
208+ import webbrowser
209+ webbrowser.open(web_url)
210
211
212 class cmd_find_merge_proposal(Command):

Subscribers

People subscribed via source and target branches