Merge lp:~jelmer/brz/api-updates into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7925
Merged at revision: 7923
Proposed branch: lp:~jelmer/brz/api-updates
Merge into: lp:brz
Diff against target: 139 lines (+40/-10)
7 files modified
breezy/bzr/groupcompress.py (+1/-0)
breezy/bzr/tests/test_bzrdir.py (+1/-1)
breezy/git/dir.py (+2/-1)
breezy/git/workingtree.py (+2/-3)
breezy/tests/__init__.py (+9/-3)
breezy/tests/test__known_graph.py (+0/-2)
src/location.rs (+25/-0)
To merge this branch: bzr merge lp:~jelmer/brz/api-updates
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+457693@code.launchpad.net

Commit message

Add AsLocation

Description of the change

Add AsLocation

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 (171.5 KiB)

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

Collecting setuptools-gettext
  Downloading setuptools_gettext-0.1.8-py3-none-any.whl.metadata (1.9 kB)
Requirement already satisfied: setuptools>=60.8 in ./lib/python3.11/site-packages (from setuptools-gettext) (68.1.2)
Downloading setuptools_gettext-0.1.8-py3-none-any.whl (12 kB)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.8
Obtaining file:///tmp/tarmac/branch.wua269zw
  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'
  Installing backend dependencies: started
  Installing backend dependencies: 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 (5.0.8)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (0.2)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (0.2.13)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (0.0.8)
Requirement already satisfied: dulwich>=0.21.6 in /usr/lib/python3/dist-packages (0.21.6)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (1.26.18)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (6.0.1)
Collecting testtools>=0.9.5
  Downloading testtools-2.7.1-py3-none-any.whl.metadata (5.3 kB)
Collecting testscenarios
  Downloading testscenarios-0.5.0-py2.py3-none-any.whl (21 kB)
Collecting python-subunit
  Downloading python_subunit-1.4.4-py3-none-any.whl.metadata (22 kB)
Collecting cython>=0.29
  Using cached Cython-3.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
Requirement already satisfied: ruff in /usr/local/lib/python3.11/dist-packages (0.1.9)
Collecting docutils
  Downloading docutils-0.20.1-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: setuptools in ./lib/python3.11/site-packages (68.1.2)
Collecting sphinx
  Downloading sphinx-7.2.6-py3-none-any.whl.metadata (5.9 kB)
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'
Collecting fastimport
  Downloading fastimport-0.9.14.tar.gz (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.8/41.8 kB 1.7 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (1.11.0)
Requirement already satisfied: paramiko>=1.6.2 in /usr/local/lib/python3.11/dist-packages (3.3.1)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (1.18.0)
R...

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :
Download full text (10.9 KiB)

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

Collecting setuptools-gettext
  Downloading setuptools_gettext-0.1.8-py3-none-any.whl.metadata (1.9 kB)
Requirement already satisfied: setuptools>=60.8 in ./lib/python3.11/site-packages (from setuptools-gettext) (68.1.2)
Downloading setuptools_gettext-0.1.8-py3-none-any.whl (12 kB)
Installing collected packages: setuptools-gettext
Successfully installed setuptools-gettext-0.1.8
Obtaining file:///tmp/tarmac/branch.ofqfo5re
  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'
  Installing backend dependencies: started
  Installing backend dependencies: 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 (5.0.8)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (0.2)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (0.2.13)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (0.0.8)
Requirement already satisfied: dulwich>=0.21.6 in /usr/lib/python3/dist-packages (0.21.6)
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/python3/dist-packages (1.26.18)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (6.0.1)
Collecting testtools>=0.9.5
  Downloading testtools-2.7.1-py3-none-any.whl.metadata (5.3 kB)
Collecting testscenarios
  Downloading testscenarios-0.5.0-py2.py3-none-any.whl (21 kB)
Collecting python-subunit
  Downloading python_subunit-1.4.4-py3-none-any.whl.metadata (22 kB)
Collecting cython>=0.29
  Using cached Cython-3.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.2 kB)
Requirement already satisfied: ruff in /usr/local/lib/python3.11/dist-packages (0.1.9)
Collecting docutils
  Downloading docutils-0.20.1-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: setuptools in ./lib/python3.11/site-packages (68.1.2)
Collecting sphinx
  Downloading sphinx-7.2.6-py3-none-any.whl.metadata (5.9 kB)
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'
Collecting fastimport
  Downloading fastimport-0.9.14.tar.gz (41 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.8/41.8 kB 1.4 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (1.11.0)
Requirement already satisfied: paramiko>=1.6.2 in /usr/local/lib/python3.11/dist-packages (3.3.1)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (1.18.0)
R...

lp:~jelmer/brz/api-updates updated
7925. By Jelmer Vernooij

Format

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/bzr/groupcompress.py'
2--- breezy/bzr/groupcompress.py 2023-11-28 14:31:46 +0000
3+++ breezy/bzr/groupcompress.py 2023-12-23 18:21:26 +0000
4@@ -850,6 +850,7 @@
5 """
6
7 chunks: list[bytes]
8+
9 def __init__(self, settings=None):
10 """Create a GroupCompressor."""
11 self._last = None
12
13=== modified file 'breezy/bzr/tests/test_bzrdir.py'
14--- breezy/bzr/tests/test_bzrdir.py 2023-11-16 15:15:02 +0000
15+++ breezy/bzr/tests/test_bzrdir.py 2023-12-23 18:21:26 +0000
16@@ -491,7 +491,7 @@
17 self.assertRaises(errors.NoRepositoryPresent, branch.controldir.open_repository)
18
19 def test_create_branch_convenience_under_shared_repo_no_tree_policy_force_tree(
20- self
21+ self,
22 ):
23 # inside a repo the default convenience output is a branch+ follow the
24 # repo tree policy but we can override that
25
26=== modified file 'breezy/git/dir.py'
27--- breezy/git/dir.py 2023-11-28 16:06:28 +0000
28+++ breezy/git/dir.py 2023-12-23 18:21:26 +0000
29@@ -160,7 +160,8 @@
30 self.root_transport.rename(".git", to_path)
31 trace.note(
32 "renamed {} to {}".format(
33- self.root_transport.abspath(".git"), to_path)
34+ self.root_transport.abspath(".git"), to_path
35+ )
36 )
37 return
38 except (brz_errors.TransportError, OSError, brz_errors.PathError):
39
40=== modified file 'breezy/git/workingtree.py'
41--- breezy/git/workingtree.py 2023-11-28 14:31:46 +0000
42+++ breezy/git/workingtree.py 2023-12-23 18:21:26 +0000
43@@ -1636,13 +1636,12 @@
44
45 ids = {}
46 for p, e in other_tree.index.iteritems():
47- newp = other_tree_bytes + b"/" + p
48+ newp = other_tree_bytes + b"/" + p
49 self.index[newp] = e
50 self._index_dirty = True
51 ids[e.sha] = newp
52
53- self.store.add_objects(
54- [(other_tree.store[i], p) for (i, p) in ids.items()])
55+ self.store.add_objects([(other_tree.store[i], p) for (i, p) in ids.items()])
56
57 other_tree.controldir.retire_controldir()
58
59
60=== modified file 'breezy/tests/__init__.py'
61--- breezy/tests/__init__.py 2023-11-22 19:02:16 +0000
62+++ breezy/tests/__init__.py 2023-12-23 18:21:26 +0000
63@@ -334,9 +334,15 @@
64 )
65 # We don't report the main thread as an active one.
66 self.stream.write(
67- "%d non-main threads were left active in the end: %r.\n"
68- % (len(self._active_threads) - 1,
69- [t for t in self._active_threads if not isinstance(t, threading._MainThread)])
70+ "%d non-main threads were left active in the end: %r.\n"
71+ % (
72+ len(self._active_threads) - 1,
73+ [
74+ t
75+ for t in self._active_threads
76+ if not isinstance(t, threading._MainThread)
77+ ],
78+ )
79 )
80
81 def getDescription(self, test):
82
83=== modified file 'breezy/tests/test__known_graph.py'
84--- breezy/tests/test__known_graph.py 2023-11-26 10:39:48 +0000
85+++ breezy/tests/test__known_graph.py 2023-12-23 18:21:26 +0000
86@@ -34,7 +34,6 @@
87
88
89 class TestCaseWithKnownGraph(tests.TestCase):
90-
91 def make_known_graph(self, ancestry):
92 return KnownGraph(ancestry)
93
94@@ -167,7 +166,6 @@
95
96
97 class TestKnownGraphHeads(TestCaseWithKnownGraph):
98-
99 def test_heads_null(self):
100 graph = self.make_known_graph(test_graph.ancestry_1)
101 self.assertEqual({b"null:"}, graph.heads([b"null:"]))
102
103=== modified file 'src/location.rs'
104--- src/location.rs 2023-06-04 13:13:35 +0000
105+++ src/location.rs 2023-12-23 18:21:26 +0000
106@@ -1,4 +1,5 @@
107 use percent_encoding::{utf8_percent_encode, CONTROLS};
108+use pyo3::prelude::*;
109 use url::Url;
110
111 use regex::Regex;
112@@ -101,3 +102,27 @@
113 .map_err(|e| Error(format!("Invalid URL: {}", e)))?;
114 Ok(url)
115 }
116+
117+pub trait AsLocation {
118+ fn as_location(&self) -> PyObject;
119+}
120+
121+impl AsLocation for &url::Url {
122+ fn as_location(&self) -> PyObject {
123+ Python::with_gil(|py| {
124+ pyo3::types::PyString::new(py, self.to_string().as_str()).to_object(py)
125+ })
126+ }
127+}
128+
129+impl AsLocation for &str {
130+ fn as_location(&self) -> PyObject {
131+ Python::with_gil(|py| pyo3::types::PyString::new(py, self).to_object(py))
132+ }
133+}
134+
135+impl AsLocation for &std::path::Path {
136+ fn as_location(&self) -> PyObject {
137+ Python::with_gil(|py| pyo3::types::PyString::new(py, self.to_str().unwrap()).to_object(py))
138+ }
139+}

Subscribers

People subscribed via source and target branches