Merge lp:brz/3.3 into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7748
Merged at revision: 7674
Proposed branch: lp:brz/3.3
Merge into: lp:brz
Diff against target: 968 lines (+127/-86)
27 files modified
.github/workflows/pythonpackage.yml (+1/-0)
.github/workflows/wheels.yaml (+1/-1)
Cargo.toml (+1/-1)
breezy/__init__.py (+1/-1)
breezy/branch.py (+3/-1)
breezy/bugtracker.py (+3/-6)
breezy/bzr/bzrdir.py (+7/-4)
breezy/bzr_distutils.py (+4/-2)
breezy/chunk_writer.py (+3/-2)
breezy/cmdline.py (+3/-2)
breezy/controldir.py (+33/-24)
breezy/git/hg.py (+3/-3)
breezy/gpg.py (+9/-8)
breezy/hooks.py (+1/-1)
breezy/iterablefile.py (+4/-1)
breezy/osutils.py (+1/-1)
breezy/patches.py (+7/-6)
breezy/plugins/propose/cmds.py (+2/-2)
breezy/registry.py (+3/-2)
breezy/repository.py (+4/-3)
breezy/transport/__init__.py (+9/-2)
breezy/util/simplemapi.py (+2/-2)
breezy/workingtree.py (+13/-7)
doc/developers/releasing.txt (+4/-0)
lib-rio/Cargo.toml (+1/-1)
profile_imports.py (+3/-3)
pyproject.toml (+1/-0)
To merge this branch: bzr merge lp:brz/3.3
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+433825@code.launchpad.net

Commit message

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 '.github/workflows/pythonpackage.yml'
2--- .github/workflows/pythonpackage.yml 2022-11-17 17:22:45 +0000
3+++ .github/workflows/pythonpackage.yml 2022-11-29 22:50:27 +0000
4@@ -82,6 +82,7 @@
5 PYTHONHASHSEED: random
6 BRZ_PLUGIN_PATH: -site:-user
7 PYTHONPATH: .
8+ shell: bash
9 if: "matrix.os == 'windows-latest'"
10 - name: Run mypy
11 run: |
12
13=== modified file '.github/workflows/wheels.yaml'
14--- .github/workflows/wheels.yaml 2022-11-05 18:57:19 +0000
15+++ .github/workflows/wheels.yaml 2022-11-29 22:50:27 +0000
16@@ -82,4 +82,4 @@
17 env:
18 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
19 TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
20- run: twine upload dist/*.whl
21+ run: twine upload artifact/*.whl
22
23=== modified file 'Cargo.toml'
24--- Cargo.toml 2022-11-03 17:15:34 +0000
25+++ Cargo.toml 2022-11-29 22:50:27 +0000
26@@ -1,6 +1,6 @@
27 [package]
28 name = "breezy"
29-version = "3.3.1"
30+version = "3.3.2"
31 authors = [ "Martin Packman <gzlist@googlemail.com>", "Jelmer Vernooij <jelmer@jelmer.uk>"]
32 edition = "2018"
33 publish = false
34
35=== modified file 'breezy/__init__.py'
36--- breezy/__init__.py 2022-11-22 15:15:26 +0000
37+++ breezy/__init__.py 2022-11-29 22:50:27 +0000
38@@ -51,7 +51,7 @@
39 # Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
40 # releaselevel of 'dev' for unreleased under-development code.
41
42-version_info = (3, 3, 1, 'final', 0)
43+version_info = (3, 3, 2, 'dev', 0)
44
45
46 def _format_version_tuple(version_info):
47
48=== modified file 'breezy/branch.py'
49--- breezy/branch.py 2022-11-15 10:35:17 +0000
50+++ breezy/branch.py 2022-11-29 22:50:27 +0000
51@@ -22,7 +22,6 @@
52 lazy_import(globals(), """
53 from breezy import (
54 debug,
55- repository,
56 transport,
57 ui,
58 )
59@@ -42,6 +41,7 @@
60 controldir,
61 errors,
62 revision as _mod_revision,
63+ repository,
64 registry,
65 urlutils,
66 )
67@@ -92,6 +92,8 @@
68
69 _last_revision_info_cache: Optional[Tuple[int, RevisionID]]
70
71+ repository: repository.Repository
72+
73 @property
74 def control_transport(self):
75 return self._transport
76
77=== modified file 'breezy/bugtracker.py'
78--- breezy/bugtracker.py 2022-10-07 06:34:37 +0000
79+++ breezy/bugtracker.py 2022-11-29 22:50:27 +0000
80@@ -17,11 +17,8 @@
81 from . import (
82 errors,
83 registry,
84+ urlutils,
85 )
86-from .lazy_import import lazy_import
87-lazy_import(globals(), """
88-from breezy import urlutils
89-""")
90
91
92 """Provides a shorthand for referring to bugs on a variety of bug trackers.
93@@ -318,9 +315,9 @@
94 (project, bug_id) = bug_id.rsplit('/', 1)
95 """Return the URL for bug_id."""
96 if '{id}' not in self._base_url:
97- raise InvalidBugTrackerURL(self._abbreviation, self._base_url)
98+ raise InvalidBugTrackerURL(self.abbreviation, self._base_url)
99 if '{project}' not in self._base_url:
100- raise InvalidBugTrackerURL(self._abbreviation, self._base_url)
101+ raise InvalidBugTrackerURL(self.abbreviation, self._base_url)
102 return self._base_url.replace(
103 '{project}', project).replace('{id}', str(bug_id))
104
105
106=== modified file 'breezy/bzr/bzrdir.py'
107--- breezy/bzr/bzrdir.py 2022-10-29 02:25:39 +0000
108+++ breezy/bzr/bzrdir.py 2022-11-29 22:50:27 +0000
109@@ -27,7 +27,7 @@
110
111 import contextlib
112 import sys
113-from typing import Set
114+from typing import Set, TYPE_CHECKING, cast
115
116 from ..lazy_import import lazy_import
117 lazy_import(globals(), """
118@@ -72,6 +72,9 @@
119 local,
120 )
121
122+if TYPE_CHECKING:
123+ from .branch import BzrBranch
124+
125
126 class MissingFeature(errors.BzrError):
127
128@@ -769,7 +772,7 @@
129 raise NotImplementedError(self.get_workingtree_transport)
130
131 @classmethod
132- def create(cls, base, format=None, possible_transports=None):
133+ def create(cls, base, format=None, possible_transports=None) -> "BzrDir":
134 """Create a new BzrDir at the url 'base'.
135
136 :param format: If supplied, the format of branch to create. If not
137@@ -782,8 +785,8 @@
138 "default format, not one of %r" % cls)
139 if format is None:
140 format = BzrDirFormat.get_default_format()
141- return controldir.ControlDir.create(
142- base, format=format, possible_transports=possible_transports)
143+ return cast("BzrDir", controldir.ControlDir.create(
144+ base, format=format, possible_transports=possible_transports))
145
146 def __repr__(self):
147 return "<%s at %r>" % (self.__class__.__name__, self.user_url)
148
149=== modified file 'breezy/bzr_distutils.py'
150--- breezy/bzr_distutils.py 2020-02-18 01:57:45 +0000
151+++ breezy/bzr_distutils.py 2022-11-29 22:50:27 +0000
152@@ -46,17 +46,19 @@
153 ]
154
155 boolean_options = ['force']
156+ source_dir: str
157+ build_dir: str
158
159 def initialize_options(self):
160 self.build_dir = None
161 self.output_base = None
162- self.source_dir = None
163+ self.source_dir = None # type: ignore
164 self.force = None
165 self.lang = None
166
167 def finalize_options(self):
168 self.set_undefined_options('build', ('force', 'force'))
169- self.prj_name = self.distribution.get_name()
170+ self.prj_name = self.distribution.get_name() # type: ignore
171 if self.build_dir is None:
172 self.build_dir = 'breezy/locale'
173 if not self.output_base:
174
175=== modified file 'breezy/chunk_writer.py'
176--- breezy/chunk_writer.py 2020-02-18 01:57:45 +0000
177+++ breezy/chunk_writer.py 2022-11-29 22:50:27 +0000
178@@ -17,6 +17,7 @@
179
180 """ChunkWriter: write compressed data out with a fixed upper bound."""
181
182+from typing import Optional, List
183 import zlib
184 from zlib import Z_FINISH, Z_SYNC_FLUSH
185
186@@ -104,7 +105,7 @@
187 """
188 self.chunk_size = chunk_size
189 self.compressor = zlib.compressobj()
190- self.bytes_in = []
191+ self.bytes_in: Optional[List[bytes]] = []
192 self.bytes_list = []
193 self.bytes_out_len = 0
194 # bytes that have been seen, but not included in a flush to out yet
195@@ -172,7 +173,7 @@
196 Z_SYNC_FLUSH called.
197 """
198 compressor = zlib.compressobj()
199- bytes_out = []
200+ bytes_out: List[bytes] = []
201 append = bytes_out.append
202 compress = compressor.compress
203 for accepted_bytes in self.bytes_in:
204
205=== modified file 'breezy/cmdline.py'
206--- breezy/cmdline.py 2020-02-18 01:57:45 +0000
207+++ breezy/cmdline.py 2022-11-29 22:50:27 +0000
208@@ -21,6 +21,7 @@
209 """
210
211 import re
212+from typing import List
213
214
215 _whitespace_match = re.compile(u'\\s', re.UNICODE).match
216@@ -150,13 +151,13 @@
217
218 def _get_token(self):
219 self.quoted = False
220- self.token = []
221+ self.token: List[str] = []
222 state = _Whitespace()
223 for next_char in self.seq:
224 state = state.process(next_char, self)
225 if state is None:
226 break
227- if state is not None and not getattr(state, 'finish', None) is None:
228+ if state is not None and hasattr(state, 'finish'):
229 state.finish(self)
230 result = u''.join(self.token)
231 if not self.quoted and result == '':
232
233=== modified file 'breezy/controldir.py'
234--- breezy/controldir.py 2022-11-15 18:01:05 +0000
235+++ breezy/controldir.py 2022-11-29 22:50:27 +0000
236@@ -24,7 +24,7 @@
237
238 """
239
240-from typing import List, Type, Optional
241+from typing import List, Type, Optional, TYPE_CHECKING, Dict, Set, Tuple, cast
242
243 from .lazy_import import lazy_import
244 lazy_import(globals(), """
245@@ -35,7 +35,6 @@
246 ui,
247 urlutils,
248 )
249-from breezy.transport import local
250
251 from breezy.i18n import gettext
252 """)
253@@ -49,6 +48,11 @@
254 transport as _mod_transport,
255 )
256
257+if TYPE_CHECKING:
258+ from .branch import Branch
259+ from .repository import Repository
260+ from .workingtree import WorkingTree
261+
262
263 class MustHaveWorkingTree(errors.BzrError):
264
265@@ -134,13 +138,13 @@
266 from."""
267 return True
268
269- def list_branches(self):
270+ def list_branches(self) -> List["Branch"]:
271 """Return a sequence of all branches local to this control directory.
272
273 """
274 return list(self.get_branches().values())
275
276- def branch_names(self):
277+ def branch_names(self) -> List[str]:
278 """List all branch names in this control directory.
279
280 Returns: List of branch names
281@@ -152,7 +156,7 @@
282 else:
283 return [""]
284
285- def get_branches(self):
286+ def get_branches(self) -> Dict[str, "Branch"]:
287 """Get all branches in this control directory, as a dictionary.
288
289 Returns: Dictionary mapping branch names to instances.
290@@ -190,7 +194,7 @@
291 """
292 raise NotImplementedError(self.needs_format_conversion)
293
294- def create_repository(self, shared=False):
295+ def create_repository(self, shared=False) -> "Repository":
296 """Create a new repository in this control directory.
297
298 Args:
299@@ -205,7 +209,7 @@
300 raise NotImplementedError(self.destroy_repository)
301
302 def create_branch(self, name=None, repository=None,
303- append_revisions_only=None):
304+ append_revisions_only=None) -> "Branch":
305 """Create a branch in this ControlDir.
306
307 Args:
308@@ -232,7 +236,7 @@
309 raise NotImplementedError(self.destroy_branch)
310
311 def create_workingtree(self, revision_id=None, from_branch=None,
312- accelerator_tree=None, hardlink=False):
313+ accelerator_tree=None, hardlink=False) -> "WorkingTree":
314 """Create a working tree at this ControlDir.
315
316 Args:
317@@ -304,7 +308,7 @@
318 raise NotImplementedError(self.set_branch_reference)
319
320 def open_branch(self, name=None, unsupported=False,
321- ignore_fallbacks=False, possible_transports=None):
322+ ignore_fallbacks=False, possible_transports=None) -> "Branch":
323 """Open the branch object at this ControlDir if one is present.
324
325 Args:
326@@ -316,7 +320,7 @@
327 """
328 raise NotImplementedError(self.open_branch)
329
330- def open_repository(self, _unsupported=False):
331+ def open_repository(self, _unsupported=False) -> "Repository":
332 """Open the repository object at this ControlDir if one is present.
333
334 This will not follow the Branch object pointer - it's strictly a direct
335@@ -328,7 +332,7 @@
336 """
337 raise NotImplementedError(self.open_repository)
338
339- def find_repository(self):
340+ def find_repository(self) -> "Repository":
341 """Find the repository that should be used.
342
343 This does not require a branch as we use it to find the repo for
344@@ -338,7 +342,7 @@
345 raise NotImplementedError(self.find_repository)
346
347 def open_workingtree(self, unsupported=False,
348- recommend_upgrade=True, from_branch=None):
349+ recommend_upgrade=True, from_branch=None) -> "WorkingTree":
350 """Open the workingtree object at this ControlDir if one is present.
351
352 Args:
353@@ -671,7 +675,8 @@
354 return ret
355
356 @classmethod
357- def create_branch_and_repo(klass, base, force_new_repo=False, format=None):
358+ def create_branch_and_repo(
359+ klass, base, force_new_repo=False, format=None) -> "Branch":
360 """Create a new ControlDir, Branch and Repository at the url 'base'.
361
362 This will use the current default ControlDirFormat unless one is
363@@ -690,7 +695,7 @@
364 """
365 controldir = klass.create(base, format)
366 controldir._find_or_create_repository(force_new_repo)
367- return controldir.create_branch()
368+ return cast("Branch", controldir.create_branch())
369
370 @classmethod
371 def create_branch_convenience(klass, base, force_new_repo=False,
372@@ -723,6 +728,7 @@
373 possible_transports: An optional reusable transports list.
374 """
375 if force_new_tree:
376+ from breezy.transport import local
377 # check for non local urls
378 t = _mod_transport.get_transport(base, possible_transports)
379 if not isinstance(t, local.LocalTransport):
380@@ -739,7 +745,7 @@
381 return result
382
383 @classmethod
384- def create_standalone_workingtree(klass, base, format=None):
385+ def create_standalone_workingtree(klass, base, format=None) -> "WorkingTree":
386 """Create a new ControlDir, WorkingTree, Branch and Repository at 'base'.
387
388 'base' must be a local path or a file:// url.
389@@ -755,6 +761,7 @@
390 Returns: The WorkingTree object.
391 """
392 t = _mod_transport.get_transport(base)
393+ from breezy.transport import local
394 if not isinstance(t, local.LocalTransport):
395 raise errors.NotLocalUrl(base)
396 controldir = klass.create_branch_and_repo(base,
397@@ -769,7 +776,7 @@
398
399 @classmethod
400 def open(klass, base, possible_transports=None, probers=None,
401- _unsupported=False):
402+ _unsupported=False) -> "ControlDir":
403 """Open an existing controldir, rooted at 'base' (url).
404
405 Args:
406@@ -780,8 +787,8 @@
407 _unsupported=_unsupported)
408
409 @classmethod
410- def open_from_transport(klass, transport, _unsupported=False,
411- probers=None):
412+ def open_from_transport(klass, transport: _mod_transport.Transport,
413+ _unsupported=False, probers=None) -> "ControlDir":
414 """Open a controldir within a particular directory.
415
416 Args:
417@@ -813,7 +820,7 @@
418 raise errors.NotBranchError(base)
419
420 format.check_support_status(_unsupported)
421- return format.open(transport, _found=True)
422+ return cast("ControlDir", format.open(transport, _found=True))
423
424 @classmethod
425 def open_containing(klass, url, possible_transports=None):
426@@ -1216,7 +1223,9 @@
427 return result
428
429 @classmethod
430- def find_format(klass, transport, probers=None):
431+ def find_format(klass, transport: _mod_transport.Transport,
432+ probers: Optional[List[Type["Prober"]]] = None
433+ ) -> "ControlDirFormat":
434 """Return the format present at transport."""
435 if probers is None:
436 probers = sorted(
437@@ -1294,7 +1303,7 @@
438 """
439 raise NotImplementedError(self.network_name)
440
441- def open(self, transport, _found=False):
442+ def open(self, transport: _mod_transport.Transport, _found=False) -> "ControlDir":
443 """Return an instance of this format for the dir transport points at.
444 """
445 raise NotImplementedError(self.open)
446@@ -1348,7 +1357,7 @@
447 ControlDirFormat.
448 """
449
450- def probe_transport(self, transport):
451+ def probe_transport(self, transport) -> "ControlDirFormat":
452 """Return the controldir style format present in a directory.
453
454 :raise UnknownFormatError: If a control dir was found but is
455@@ -1359,7 +1368,7 @@
456 raise NotImplementedError(self.probe_transport)
457
458 @classmethod
459- def known_formats(klass):
460+ def known_formats(klass) -> Set["ControlDirFormat"]:
461 """Return the control dir formats known by this prober.
462
463 Multiple probers can return the same formats, so this should
464@@ -1370,7 +1379,7 @@
465 raise NotImplementedError(klass.known_formats)
466
467 @classmethod
468- def priority(klass, transport):
469+ def priority(klass, transport: _mod_transport.Transport) -> int:
470 """Priority of this prober.
471
472 A lower value means the prober gets checked first.
473
474=== modified file 'breezy/git/hg.py'
475--- breezy/git/hg.py 2020-02-18 01:57:45 +0000
476+++ breezy/git/hg.py 2022-11-29 22:50:27 +0000
477@@ -17,7 +17,7 @@
478
479 """Compatibility for hg-git."""
480
481-import urllib
482+import urllib.parse
483
484
485 def format_hg_metadata(renames, branch, extra):
486@@ -42,7 +42,7 @@
487 continue
488 else:
489 extra_message += "extra : " + key + \
490- " : " + urllib.quote(value) + "\n"
491+ " : " + urllib.parse.quote(value) + "\n"
492
493 if extra_message:
494 return "\n--HG--\n" + extra_message
495@@ -75,7 +75,7 @@
496 branch = data
497 elif command == 'extra':
498 before, after = data.split(" : ", 1)
499- extra[before] = urllib.unquote(after)
500+ extra[before] = urllib.parse.unquote(after)
501 else:
502 raise KeyError("unknown hg-git metadata command %s" % command)
503 return (message, renames, branch, extra)
504
505=== modified file 'breezy/gpg.py'
506--- breezy/gpg.py 2022-05-15 14:17:32 +0000
507+++ breezy/gpg.py 2022-11-29 22:50:27 +0000
508@@ -18,12 +18,11 @@
509 """GPG signing and checking logic."""
510
511 import os
512+from typing import Optional, Dict, List
513
514 from breezy.lazy_import import lazy_import
515 lazy_import(globals(), """
516 from breezy import (
517- config,
518- trace,
519 ui,
520 )
521 from breezy.i18n import (
522@@ -33,7 +32,9 @@
523 """)
524
525 from . import (
526+ config,
527 errors,
528+ trace,
529 )
530
531 # verification results
532@@ -180,7 +181,7 @@
533 class GPGStrategy(object):
534 """GPG Signing and checking facilities."""
535
536- acceptable_keys = None
537+ acceptable_keys: Optional[List[str]] = None
538
539 def __init__(self, config_stack):
540 self._config_stack = config_stack
541@@ -410,7 +411,7 @@
542
543 def verbose_expired_key_message(result, repo):
544 """takes a verify result and returns list of expired key info"""
545- signers = {}
546+ signers: Dict[str, int] = {}
547 fingerprint_to_authors = {}
548 for rev_id, validity, fingerprint in result:
549 if validity == SIGNATURE_EXPIRED:
550@@ -431,7 +432,7 @@
551
552 def verbose_valid_message(result):
553 """takes a verify result and returns list of signed commits strings"""
554- signers = {}
555+ signers: Dict[str, int] = {}
556 for rev_id, validity, uid in result:
557 if validity == SIGNATURE_VALID:
558 signers.setdefault(uid, 0)
559@@ -446,7 +447,7 @@
560
561 def verbose_not_valid_message(result, repo):
562 """takes a verify result and returns list of not valid commit info"""
563- signers = {}
564+ signers: Dict[str, int] = {}
565 for rev_id, validity, empty in result:
566 if validity == SIGNATURE_NOT_VALID:
567 revision = repo.get_revision(rev_id)
568@@ -463,7 +464,7 @@
569
570 def verbose_not_signed_message(result, repo):
571 """takes a verify result and returns list of not signed commit info"""
572- signers = {}
573+ signers: Dict[str, int] = {}
574 for rev_id, validity, empty in result:
575 if validity == SIGNATURE_NOT_SIGNED:
576 revision = repo.get_revision(rev_id)
577@@ -480,7 +481,7 @@
578
579 def verbose_missing_key_message(result):
580 """takes a verify result and returns list of missing key info"""
581- signers = {}
582+ signers: Dict[str, int] = {}
583 for rev_id, validity, fingerprint in result:
584 if validity == SIGNATURE_KEY_MISSING:
585 signers.setdefault(fingerprint, 0)
586
587=== modified file 'breezy/hooks.py'
588--- breezy/hooks.py 2022-09-23 03:17:56 +0000
589+++ breezy/hooks.py 2022-11-29 22:50:27 +0000
590@@ -44,7 +44,7 @@
591 self.hook = hook_name
592
593
594-class KnownHooksRegistry(registry.Registry):
595+class KnownHooksRegistry(registry.Registry[str, "Hooks"]):
596 # known_hooks registry contains
597 # tuple of (module, member name) which is the hook point
598 # module where the specific hooks are defined
599
600=== modified file 'breezy/iterablefile.py'
601--- breezy/iterablefile.py 2020-02-18 01:57:45 +0000
602+++ breezy/iterablefile.py 2022-11-29 22:50:27 +0000
603@@ -16,6 +16,9 @@
604 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
605
606
607+from typing import List
608+
609+
610 class IterableFileBase(object):
611 """Create a file-like object from any iterable"""
612
613@@ -251,7 +254,7 @@
614 Traceback (most recent call last):
615 ValueError: File is closed.
616 """
617- lines = []
618+ lines: List[bytes] = []
619 while True:
620 line = self.readline()
621 if line == b"":
622
623=== modified file 'breezy/osutils.py'
624--- breezy/osutils.py 2022-10-06 05:49:43 +0000
625+++ breezy/osutils.py 2022-11-29 22:50:27 +0000
626@@ -25,7 +25,6 @@
627
628 from .lazy_import import lazy_import
629 lazy_import(globals(), """
630-from datetime import datetime
631 import getpass
632 import locale
633 import ntpath
634@@ -766,6 +765,7 @@
635
636 def local_time_offset(t=None):
637 """Return offset of local zone from GMT, either at present or at time t."""
638+ from datetime import datetime
639 if t is None:
640 t = time.time()
641 offset = datetime.fromtimestamp(t) - datetime.utcfromtimestamp(t)
642
643=== modified file 'breezy/patches.py'
644--- breezy/patches.py 2021-01-10 00:25:52 +0000
645+++ breezy/patches.py 2022-11-29 22:50:27 +0000
646@@ -21,6 +21,7 @@
647
648 import os
649 import re
650+from typing import List, Optional
651
652
653 binary_files_re = b'Binary files (.*) and (.*) differ\n'
654@@ -119,11 +120,11 @@
655 tmp = textrange.split(b',')
656 if len(tmp) == 1:
657 pos = tmp[0]
658- range = b"1"
659+ brange = b"1"
660 else:
661- (pos, range) = tmp
662+ (pos, brange) = tmp
663 pos = int(pos)
664- range = int(range)
665+ range = int(brange)
666 return (pos, range)
667
668
669@@ -432,8 +433,8 @@
670 # allow_dirty or restrict those to only being before the patch is found
671 # (as allow_dirty does).
672 regex = re.compile(binary_files_re)
673- saved_lines = []
674- dirty_head = []
675+ saved_lines: List[bytes] = []
676+ dirty_head: List[bytes] = []
677 orig_range = 0
678 beginning = True
679
680@@ -494,7 +495,7 @@
681 applied at any point up until hunk line parsing, and is safe to apply
682 repeatedly.
683 """
684- last_line = None
685+ last_line: Optional[bytes] = None
686 for line in iter_lines:
687 if line == NO_NL:
688 if not last_line.endswith(b'\n'):
689
690=== modified file 'breezy/plugins/propose/cmds.py'
691--- breezy/plugins/propose/cmds.py 2022-11-18 00:36:12 +0000
692+++ breezy/plugins/propose/cmds.py 2022-11-29 22:50:27 +0000
693@@ -220,10 +220,10 @@
694 note(gettext('There is already a branch merge proposal: %s'), e.url)
695 else:
696 note(gettext('Merge proposal created: %s') % proposal.url)
697- web_url = proposal.get_web_url()
698- note(gettext('Opening %s in web browser'), web_url)
699 if open:
700+ web_url = proposal.get_web_url()
701 import webbrowser
702+ note(gettext('Opening %s in web browser'), web_url)
703 webbrowser.open(web_url)
704
705
706
707=== modified file 'breezy/registry.py'
708--- breezy/registry.py 2022-11-15 10:35:17 +0000
709+++ breezy/registry.py 2022-11-29 22:50:27 +0000
710@@ -25,6 +25,7 @@
711 Union,
712 Callable,
713 Dict,
714+ List,
715 Iterator,
716 Tuple,
717 Callable,
718@@ -127,7 +128,7 @@
719 return dict(self._aliases.items())
720
721 def alias_map(self):
722- ret = {}
723+ ret: Dict[str, List[str]] = {}
724 for alias, target in self._aliases.items():
725 ret.setdefault(target, []).append(alias)
726 return ret
727@@ -299,7 +300,7 @@
728 """Registry specialised for handling formats."""
729
730 def __init__(self, other_registry=None):
731- Registry.__init__(self)
732+ super(FormatRegistry, self).__init__()
733 self._other_registry = other_registry
734
735 def register(self, key, obj, help=None, info=None,
736
737=== modified file 'breezy/repository.py'
738--- breezy/repository.py 2022-11-15 21:21:38 +0000
739+++ breezy/repository.py 2022-11-29 22:50:27 +0000
740@@ -16,7 +16,7 @@
741
742 __docformat__ = "google"
743
744-from typing import List, Type
745+from typing import List, Type, TYPE_CHECKING
746
747 from .lazy_import import lazy_import
748 lazy_import(globals(), """
749@@ -43,6 +43,7 @@
750 from .lock import _RelockDebugMixin, LogicalLockResult
751 from .trace import (
752 log_exception_quietly, note, mutter, mutter_callsite, warning)
753+from .revisiontree import RevisionTree
754
755
756 # Old formats display a warning, but only once
757@@ -173,7 +174,7 @@
758 """
759 raise NotImplementedError(self.abort)
760
761- def revision_tree(self):
762+ def revision_tree(self) -> "RevisionTree":
763 """Return the tree that was just committed.
764
765 After calling commit() this can be called to get a
766@@ -1041,7 +1042,7 @@
767 repository.
768 """
769
770- def revision_tree(self, revision_id):
771+ def revision_tree(self, revision_id) -> "RevisionTree":
772 """Return Tree for a revision on this branch.
773
774 `revision_id` may be NULL_REVISION for the empty tree revision.
775
776=== modified file 'breezy/transport/__init__.py'
777--- breezy/transport/__init__.py 2022-11-13 20:26:24 +0000
778+++ breezy/transport/__init__.py 2022-11-29 22:50:27 +0000
779@@ -29,7 +29,7 @@
780 import errno
781 from io import BytesIO
782 import sys
783-from typing import Dict, Any, Callable
784+from typing import Dict, Any, Callable, TypeVar
785
786 from stat import S_ISDIR
787
788@@ -1613,7 +1613,14 @@
789 return None, last_err
790
791
792-def do_catching_redirections(action, transport, redirected):
793+T = TypeVar('T')
794+
795+
796+def do_catching_redirections(
797+ action: Callable[[Transport], T],
798+ transport: Transport,
799+ redirected: Callable[
800+ [Transport, errors.RedirectRequested, str], Transport]) -> T:
801 """Execute an action with given transport catching redirections.
802
803 This is a facility provided for callers needing to follow redirections
804
805=== modified file 'breezy/util/simplemapi.py'
806--- breezy/util/simplemapi.py 2022-10-19 15:50:56 +0000
807+++ breezy/util/simplemapi.py 2022-11-29 22:50:27 +0000
808@@ -155,7 +155,7 @@
809 class MAPIError(WindowsError): # type: ignore
810
811 def __init__(self, code):
812- WindowsError.__init__(self)
813+ WindowsError.__init__(self) # type: ignore
814 self.code = code
815
816 def __str__(self):
817@@ -214,7 +214,7 @@
818 rd.ulRecipClass = MAPI_TO
819 try:
820 rd.lpszName, rd.lpszAddress = _resolveName(session, ra)
821- except WindowsError:
822+ except WindowsError: # type: ignore
823 # work-round for Mozilla Thunderbird
824 rd.lpszName, rd.lpszAddress = None, ra
825 rd.ulEIDSize = 0
826
827=== modified file 'breezy/workingtree.py'
828--- breezy/workingtree.py 2022-11-15 10:35:17 +0000
829+++ breezy/workingtree.py 2022-11-29 22:50:27 +0000
830@@ -33,7 +33,11 @@
831 import errno
832 import os
833 import sys
834-from typing import Optional
835+from typing import Optional, Tuple, TYPE_CHECKING
836+
837+if TYPE_CHECKING:
838+ from .branch import Branch
839+ from .revisiontree import RevisionTree
840
841 import breezy
842
843@@ -90,6 +94,8 @@
844 (as opposed to a URL).
845 """
846
847+ branch: "Branch"
848+
849 # override this to set the strategy for storing views
850 def _make_views(self):
851 return views.DisabledViews(self)
852@@ -145,7 +151,7 @@
853 """
854 return self.controldir.is_control_filename(filename)
855
856- branch = property(
857+ branch = property( # type: ignore
858 fget=lambda self: self._branch,
859 doc="""The branch this WorkingTree is connected to.
860
861@@ -200,7 +206,7 @@
862 return self.branch.get_config_stack()
863
864 @staticmethod
865- def open(path=None, _unsupported=False):
866+ def open(path=None, _unsupported=False) -> "WorkingTree":
867 """Open an existing working tree at path.
868
869 """
870@@ -210,7 +216,7 @@
871 return control.open_workingtree(unsupported=_unsupported)
872
873 @staticmethod
874- def open_containing(path=None):
875+ def open_containing(path: Optional[str] = None) -> Tuple["WorkingTree", str]:
876 """Open an existing working tree which has its root about path.
877
878 This probes for a working tree at path and searches upwards from there.
879@@ -301,7 +307,7 @@
880 return new_list
881
882 @staticmethod
883- def open_downlevel(path=None):
884+ def open_downlevel(path=None) -> "WorkingTree":
885 """Open an unsupported working tree.
886
887 Only intended for advanced situations like upgrading part of a controldir.
888@@ -315,7 +321,7 @@
889 def abspath(self, filename):
890 return osutils.pathjoin(self.basedir, filename)
891
892- def basis_tree(self):
893+ def basis_tree(self) -> "RevisionTree":
894 """Return RevisionTree for the current last revision.
895
896 If the left most parent is a ghost then the returned tree will be an
897@@ -1028,7 +1034,7 @@
898 """Restore uncommitted changes from the branch into the tree."""
899 raise NotImplementedError(self.restore_uncommitted)
900
901- def revision_tree(self, revision_id):
902+ def revision_tree(self, revision_id) -> "RevisionTree":
903 """See Tree.revision_tree.
904
905 For trees that can be obtained from the working tree, this
906
907=== modified file 'doc/developers/releasing.txt'
908--- doc/developers/releasing.txt 2022-11-22 13:24:11 +0000
909+++ doc/developers/releasing.txt 2022-11-29 22:50:27 +0000
910@@ -394,6 +394,10 @@
911 installers won't be made and the download list will stay very small!
912 <https://bugs.launchpad.net/launchpad/+bug/586445>
913
914+#. Run twine to upload to pip::
915+
916+ twine upload breezy-*.tar.gz breezy-*.tar.gz.asc
917+
918
919 Kick off the next cycle
920 -----------------------
921
922=== modified file 'lib-rio/Cargo.toml'
923--- lib-rio/Cargo.toml 2022-10-08 19:29:52 +0000
924+++ lib-rio/Cargo.toml 2022-11-29 22:50:27 +0000
925@@ -1,6 +1,6 @@
926 [package]
927 name = "rio-py"
928-version = "3.3.1"
929+version = "3.3.2"
930 edition = "2018"
931
932 [lib]
933
934=== modified file 'profile_imports.py'
935--- profile_imports.py 2022-09-23 06:44:09 +0000
936+++ profile_imports.py 2022-11-29 22:50:27 +0000
937@@ -24,7 +24,7 @@
938
939
940 _parent_stack: List[Tuple[int, str]] = []
941-_total_stack: Dict[str, str] = {}
942+_total_stack: Dict[Tuple[int, str], List[Tuple[int, str]]] = {}
943 _info = {}
944 _cur_id = 0
945 _timer = time.time
946@@ -192,10 +192,10 @@
947 def install():
948 """Install the hooks for measuring import and regex compile time."""
949 __builtins__['__import__'] = timed_import
950- re._compile = timed_compile
951+ re._compile = timed_compile # type: ignore
952
953
954 def uninstall():
955 """Remove the import and regex compile timing hooks."""
956 __builtins__['__import__'] = _real_import
957- re._compile = _real_compile
958+ re._compile = _real_compile # type: ignore
959
960=== modified file 'pyproject.toml'
961--- pyproject.toml 2022-10-27 11:57:11 +0000
962+++ pyproject.toml 2022-11-29 22:50:27 +0000
963@@ -16,4 +16,5 @@
964 ignore_missing_imports = true
965 warn_return_any = true
966 warn_unused_configs = true
967+#check_untyped_defs = true
968 exclude = ['^breezy/util/simplemapi\.py$']

Subscribers

People subscribed via source and target branches