Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | 7889 |
Merged at revision: | 7894 |
Proposed branch: | lp:~jelmer/brz/clippy |
Merge into: | lp:brz |
Diff against target: |
158 lines (+29/-16) 9 files modified
breezy/transport/http/response.py (+7/-3) crates/bazaar/src/bencode_serializer.rs (+1/-0) crates/bazaar/src/dirstate.rs (+2/-1) crates/bazaar/src/groupcompress/delta.rs (+1/-1) crates/bazaar/src/xml_serializer.rs (+1/-0) crates/urlutils/src/lib.rs (+3/-3) src/bedding.rs (+6/-6) src/help.rs (+2/-2) src/treebuilder.rs (+6/-0) |
To merge this branch: | bzr merge lp:~jelmer/brz/clippy |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij | Approve | ||
Review via email: mp+454270@code.launchpad.net |
Commit message
Fix some clippy errors
Description of the change
Fix some clippy errors
Jelmer Vernooij (jelmer) : | # |
The Breezy Bot (the-breezy-bot) wrote : | # |
The Breezy Bot (the-breezy-bot) wrote : | # |
The attempt to merge lp:~jelmer/brz/clippy into lp:brz failed. Command exited with 1.
Below is the output from the failed tests.
... OUTPUT TRIMMED ...
File "/tmp/tarmac/
self.
File "/tmp/tarmac/
osutils.
ValueError: Failed to parse datetime string (2023-11-02 00:32:56): input is not enough for unique date and time
=======
ERROR: breezy.
-------
testtools.
0.004 creating repository in file://
0.006 creating branch <breezy.
0.011 opening working tree '/tmp/testbzr-
0.011 write hc
0.017 preparing to commit
INFO Committing to: /tmp/testbzr-
0.018 Selecting files for commit with filter None
INFO added file
INFO Committed revision 1.
0.021 Committed revid b'rev1' as revno 1.
0.024 preparing to commit
INFO Committing to: /tmp/testbzr-
0.026 Selecting files for commit with filter None
INFO Committed revision 2.
0.029 Committed revid b'rev2' as revno 2.
0.034 _handle_next 'message' => ['hello']
0.034 _handle_next 'committer' => '<email address hidden>'
0.034 _handle_next 'date' => 'Thu 2023-11-02 00:32:56.111000061 +0000'
0.034 _handle_next 'revision_id' => 'rev2'
0.034 _handle_next 'sha1' => '3701f43b341d15
0.034 _handle_next 'inventory_sha1' => '369f8c330b66fa
0.034 _handle_next 'parent_ids' => ['rev1']
0.034 _handle_next 'base_id' => 'null:'
0.034 _handle_next 'properties' => ['branch-nick: b1']
0.034 _handle_next 'message' => ['hello']
0.034 _handle_next 'committer' => '<email address hidden>'
0.034 _handle_next 'date' => 'Thu 2023-11-02 00:32:56.104000092 +0000'
0.034 _handle_next 'revision_id' => 'rev1'
0.034 _handle_next 'sha1' => '8aa72b67f3b84e
0.034 _handle_next 'inventory_sha1' => 'a8440513bdbbbf
0.034 _handle_next 'properties' => ['branch-nick: b1']
}}}
Traceback (most recent call last):
File "/tmp/tarmac/
repo = self.make_
File "/tmp/tarmac/
The Breezy Bot (the-breezy-bot) wrote : | # |
Fixup command "sudo apt -y update && sudo apt -y install git quilt cargo rustc python3-venv python3-tdb python3-pyinotify python3-gpg libpython3-dev make python3-
The Breezy Bot (the-breezy-bot) wrote : | # |
The attempt to merge lp:~jelmer/brz/clippy into lp:brz failed. Command exited with 2.
Below is the output from the failed tests.
Collecting setuptools-gettext
Downloading setuptools_
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.
Downloading setuptools_
Installing collected packages: setuptools-gettext
Successfully installed setuptools-
Obtaining file://
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/
Requirement already satisfied: fastbencode in /usr/lib/
Requirement already satisfied: patiencediff in /usr/lib/
Requirement already satisfied: merge3 in /usr/lib/
Requirement already satisfied: dulwich>=0.21.6 in /usr/lib/
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/
Requirement already satisfied: pyyaml in /usr/lib/
Collecting testtools>=0.9.5
Downloading testtools-
Collecting testscenarios
Downloading testscenarios-
Collecting python-subunit
Downloading python_
Collecting cython>=0.29
Using cached Cython-
Requirement already satisfied: ruff in /usr/local/
Collecting docutils
Downloading docutils-
Requirement already satisfied: setuptools in ./lib/python3.
Collecting sphinx
Downloading sphinx-
Collecting sphinx-epytext
Downloading sphinx-
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting fastimport
Downloading fastimport-
━━
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/
Requirement already satisfied: paramiko>=1.6.2 in /usr/local/
Requirement already satisfied: gpg in /usr/lib/
Requi...
The Breezy Bot (the-breezy-bot) wrote : | # |
The attempt to merge lp:~jelmer/brz/clippy into lp:brz failed. Command exited with 1.
Below is the output from the failed tests.
Collecting setuptools-gettext
Downloading setuptools_
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.
Downloading setuptools_
Installing collected packages: setuptools-gettext
Successfully installed setuptools-
Obtaining file://
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/
Requirement already satisfied: fastbencode in /usr/lib/
Requirement already satisfied: patiencediff in /usr/lib/
Requirement already satisfied: merge3 in /usr/lib/
Requirement already satisfied: dulwich>=0.21.6 in /usr/lib/
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/
Requirement already satisfied: pyyaml in /usr/lib/
Collecting testtools>=0.9.5
Downloading testtools-
Collecting testscenarios
Downloading testscenarios-
Collecting python-subunit
Downloading python_
Collecting cython>=0.29
Using cached Cython-
Requirement already satisfied: ruff in /usr/local/
Collecting docutils
Downloading docutils-
Requirement already satisfied: setuptools in ./lib/python3.
Collecting sphinx
Downloading sphinx-
Collecting sphinx-epytext
Downloading sphinx-
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting fastimport
Downloading fastimport-
━━
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/
Requirement already satisfied: paramiko>=1.6.2 in /usr/local/
Requirement already satisfied: gpg in /usr/lib/
Requi...
- 7889. By Jelmer Vernooij
-
Fix test
Preview Diff
1 | === modified file 'breezy/transport/http/response.py' |
2 | --- breezy/transport/http/response.py 2023-11-07 10:54:10 +0000 |
3 | +++ breezy/transport/http/response.py 2023-11-08 21:11:21 +0000 |
4 | @@ -21,7 +21,6 @@ |
5 | responses. |
6 | """ |
7 | |
8 | -import cgi |
9 | import email.utils as email_utils |
10 | import http.client as http_client |
11 | import os |
12 | @@ -392,9 +391,14 @@ |
13 | # 7.2.1. |
14 | # Therefore it is obviously not multipart |
15 | content_type = getheader("content-type", "application/octet-stream") |
16 | - mimetype, options = cgi.parse_header(content_type) |
17 | + from email.message import EmailMessage |
18 | + |
19 | + msg = EmailMessage() |
20 | + msg["content-type"] = content_type |
21 | + params = msg["content-type"].params |
22 | + mimetype = msg.get_content_type() |
23 | if mimetype == "multipart/byteranges": |
24 | - rfile.set_boundary(options["boundary"].encode("ascii")) |
25 | + rfile.set_boundary(params["boundary"].encode("ascii")) |
26 | else: |
27 | # A response to a range request, but not multipart |
28 | content_range = getheader("content-range", None) |
29 | |
30 | === modified file 'crates/bazaar/src/bencode_serializer.rs' |
31 | --- crates/bazaar/src/bencode_serializer.rs 2023-05-10 11:59:06 +0000 |
32 | +++ crates/bazaar/src/bencode_serializer.rs 2023-11-08 21:11:21 +0000 |
33 | @@ -311,4 +311,5 @@ |
34 | } |
35 | } |
36 | |
37 | +#[allow(dead_code)] |
38 | const BENCODE_REVISION_SERIALIZER_V1: BEncodeRevisionSerializer1 = BEncodeRevisionSerializer1 {}; |
39 | |
40 | === modified file 'crates/bazaar/src/dirstate.rs' |
41 | --- crates/bazaar/src/dirstate.rs 2023-06-27 09:33:46 +0000 |
42 | +++ crates/bazaar/src/dirstate.rs 2023-11-08 21:11:21 +0000 |
43 | @@ -1,5 +1,6 @@ |
44 | use crate::inventory::Entry as InventoryEntry; |
45 | use crate::FileId; |
46 | +use base64::engine::Engine; |
47 | use breezy_osutils::sha::{sha_file, sha_file_by_name}; |
48 | use std::cmp::Ordering; |
49 | use std::collections::HashMap; |
50 | @@ -158,7 +159,7 @@ |
51 | mode as u8, |
52 | ]; |
53 | |
54 | - base64::encode(packed_data) |
55 | + base64::engine::general_purpose::STANDARD_NO_PAD.encode(packed_data) |
56 | } |
57 | |
58 | pub fn stat_to_minikind(metadata: &Metadata) -> char { |
59 | |
60 | === modified file 'crates/bazaar/src/groupcompress/delta.rs' |
61 | --- crates/bazaar/src/groupcompress/delta.rs 2023-05-23 09:09:19 +0000 |
62 | +++ crates/bazaar/src/groupcompress/delta.rs 2023-11-08 21:11:21 +0000 |
63 | @@ -1,4 +1,4 @@ |
64 | -use std::io::Read; |
65 | +#![allow(dead_code)] |
66 | |
67 | /// diff-delta.rs: generate a delta between two buffers |
68 | /// |
69 | |
70 | === modified file 'crates/bazaar/src/xml_serializer.rs' |
71 | --- crates/bazaar/src/xml_serializer.rs 2023-07-17 20:32:51 +0000 |
72 | +++ crates/bazaar/src/xml_serializer.rs 2023-11-08 21:11:21 +0000 |
73 | @@ -1,3 +1,4 @@ |
74 | +#![allow(dead_code)] |
75 | use crate::revision::Revision; |
76 | use crate::serializer::{Error, RevisionSerializer}; |
77 | use crate::RevisionId; |
78 | |
79 | === modified file 'crates/urlutils/src/lib.rs' |
80 | --- crates/urlutils/src/lib.rs 2023-11-07 11:23:42 +0000 |
81 | +++ crates/urlutils/src/lib.rs 2023-11-08 21:11:21 +0000 |
82 | @@ -712,10 +712,10 @@ |
83 | |
84 | pub fn local_path_from_url(url: &str) -> std::result::Result<PathBuf, super::Error> { |
85 | let url = super::strip_segment_parameters(url); |
86 | - let path = if url.starts_with(FILE_LOCALHOST_PREFIX) { |
87 | - &url[FILE_LOCALHOST_PREFIX.len()..] |
88 | + let path = if let Some(suffix) = url.strip_prefix(FILE_LOCALHOST_PREFIX) { |
89 | + suffix |
90 | } else if url.starts_with(PLAIN_FILE_PREFIX) { |
91 | - &url[7..] |
92 | + &url[PLAIN_FILE_PREFIX.len() - 1..] |
93 | } else { |
94 | return Err(super::Error::NotLocalUrl(url.to_string())); |
95 | }; |
96 | |
97 | === modified file 'src/bedding.rs' |
98 | --- src/bedding.rs 2023-11-07 16:08:34 +0000 |
99 | +++ src/bedding.rs 2023-11-08 21:11:21 +0000 |
100 | @@ -210,11 +210,11 @@ |
101 | } |
102 | |
103 | pub fn cache_dir() -> std::io::Result<PathBuf> { |
104 | - // Return the cache directory to use. |
105 | - let mut base: Option<PathBuf> = env::var("BRZ_HOME").ok().map(PathBuf::from); |
106 | + let mut base: Option<PathBuf>; |
107 | |
108 | #[cfg(windows)] |
109 | { |
110 | + let mut base: Option<PathBuf> = env::var("BRZ_HOME").ok().map(PathBuf::from); |
111 | if base.is_none() { |
112 | base = win32utils::get_local_appdata_location(); |
113 | } |
114 | @@ -225,11 +225,11 @@ |
115 | |
116 | #[cfg(not(windows))] |
117 | { |
118 | - if let Ok(xdg_cache_home) = env::var("XDG_CACHE_HOME") { |
119 | - base = Some(PathBuf::from(xdg_cache_home)); |
120 | + base = if let Ok(xdg_cache_home) = env::var("XDG_CACHE_HOME") { |
121 | + Some(PathBuf::from(xdg_cache_home)) |
122 | } else { |
123 | - base = None; |
124 | - } |
125 | + None |
126 | + }; |
127 | if base.is_none() { |
128 | base = Some( |
129 | breezy_osutils::get_home_dir() |
130 | |
131 | === modified file 'src/help.rs' |
132 | --- src/help.rs 2023-06-24 13:01:43 +0000 |
133 | +++ src/help.rs 2023-11-08 21:11:21 +0000 |
134 | @@ -144,8 +144,8 @@ |
135 | let lines = text.split('\n'); |
136 | let mut ret = lines |
137 | .map(|l| { |
138 | - let l = if l.starts_with(':') { |
139 | - l[1..].to_string() |
140 | + let l = if let Some(suffix) = l.strip_prefix(':') { |
141 | + suffix.to_string() |
142 | } else if l.ends_with("::") { |
143 | l[..l.len() - 1].to_string() |
144 | } else { |
145 | |
146 | === modified file 'src/treebuilder.rs' |
147 | --- src/treebuilder.rs 2023-06-08 19:35:24 +0000 |
148 | +++ src/treebuilder.rs 2023-11-08 21:11:21 +0000 |
149 | @@ -66,3 +66,9 @@ |
150 | Ok(()) |
151 | } |
152 | } |
153 | + |
154 | +impl<T: MutableTree> Default for TreeBuilder<T> { |
155 | + fn default() -> Self { |
156 | + Self::new() |
157 | + } |
158 | +} |
The attempt to merge lp:~jelmer/brz/clippy into lp:brz failed. Command exited with 2.
Below is the output from the failed tests.
Collecting setuptools-gettext gettext- 0.1.7-py3- none-any. whl.metadata (1.5 kB) 11/site- packages (from setuptools-gettext) (68.1.2) gettext- 0.1.7-py3- none-any. whl (5.5 kB) gettext- 0.1.7 /tmp/tarmac/ branch. v96kn59x python3/ dist-packages (5.0.8) python3/ dist-packages (0.2) python3/ dist-packages (0.2.13) python3/ dist-packages (0.0.8) 0.21.6- cp311-cp311- manylinux_ 2_17_x86_ 64.manylinux201 4_x86_64. whl.metadata (4.3 kB) python3/ dist-packages (1.26.12) python3/ dist-packages (6.0) 2.6.0-py3- none-any. whl (182 kB) 0.5.0-py2. py3-none- any.whl (21 kB) subunit- 1.4.3-py3- none-any. whl.metadata (22 kB) python3/ dist-packages (5.0.4) 3.0.5-cp311- cp311-manylinux _2_17_x86_ 64.manylinux201 4_x86_64. whl.metadata (3.2 kB) 1.3-py3- none-manylinux_ 2_17_x86_ 64.manylinux201 4_x86_64. whl.metadata (22 kB) 0.20.1- py3-none- any.whl. metadata (2.8 kB) 11/site- packages (68.1.2) 7.2.6-py3- none-any. whl.metadata (5.9 kB) epytext- 0.0.4-py3- none-any. whl 0.9.14- py2.py3- none-any. whl python3/ dist-packages (1.11.0) lib/python3. 11/dist- packages (3.1.0) python3/ dist-packages (1.18.0) python3/ dist-packages (from launchpadlib> =1.6.3) (0.20.4)
Using cached setuptools_
Requirement already satisfied: setuptools>=46.1 in ./lib/python3.
Using cached setuptools_
Installing collected packages: setuptools-gettext
Successfully installed setuptools-
Obtaining file://
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/
Requirement already satisfied: fastbencode in /usr/lib/
Requirement already satisfied: patiencediff in /usr/lib/
Requirement already satisfied: merge3 in /usr/lib/
Collecting dulwich>=0.21.6
Using cached dulwich-
Requirement already satisfied: urllib3>=1.24.1 in /usr/lib/
Requirement already satisfied: pyyaml in /usr/lib/
Collecting testtools>=0.9.5
Using cached testtools-
Collecting testscenarios
Using cached testscenarios-
Collecting python-subunit
Using cached python_
Requirement already satisfied: flake8 in /usr/lib/
Collecting cython>=0.29
Using cached Cython-
Collecting ruff
Using cached ruff-0.
Collecting docutils
Using cached docutils-
Requirement already satisfied: setuptools in ./lib/python3.
Collecting sphinx
Using cached sphinx-
Collecting sphinx-epytext
Using cached sphinx_
Collecting fastimport
Using cached fastimport-
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/
Requirement already satisfied: paramiko>=1.6.2 in /usr/local/
Requirement already satisfied: gpg in /usr/lib/
Requirement already satisfied: httplib2 in /usr/lib/
Requirement already sa...