Merge lp:~jelmer/brz/mypy into lp:brz/3.3

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7664
Merged at revision: 7692
Proposed branch: lp:~jelmer/brz/mypy
Merge into: lp:brz/3.3
Diff against target: 3473 lines (+421/-577)
123 files modified
.github/workflows/pythonpackage.yml (+4/-1)
Makefile (+3/-0)
breezy/__init__.py (+1/-1)
breezy/__main__.py (+1/-1)
breezy/_known_graph_py.py (+1/-4)
breezy/branch.py (+9/-3)
breezy/builtins.py (+3/-7)
breezy/bzr/branch.py (+1/-1)
breezy/bzr/btree_index.py (+2/-2)
breezy/bzr/bzrdir.py (+5/-23)
breezy/bzr/groupcompress.py (+7/-3)
breezy/bzr/inventory.py (+1/-4)
breezy/bzr/inventorytree.py (+2/-10)
breezy/bzr/knit.py (+3/-1)
breezy/bzr/knitrepo.py (+4/-3)
breezy/bzr/pack_repo.py (+23/-20)
breezy/bzr/remote.py (+4/-3)
breezy/bzr/smart/client.py (+1/-1)
breezy/bzr/smart/medium.py (+1/-4)
breezy/bzr/smart/message.py (+1/-4)
breezy/bzr/smart/protocol.py (+1/-4)
breezy/bzr/smart/server.py (+1/-1)
breezy/bzr/tests/test__simple_set.py (+1/-1)
breezy/bzr/tests/test__static_tuple.py (+1/-4)
breezy/bzr/tests/test_btree_index.py (+0/-20)
breezy/bzr/tests/test_bundle.py (+2/-2)
breezy/bzr/tests/test_inv.py (+1/-1)
breezy/bzr/tests/test_pack.py (+0/-10)
breezy/bzr/tests/test_repository.py (+2/-48)
breezy/bzr/tests/test_smart_transport.py (+8/-7)
breezy/bzr/versionedfile.py (+4/-1)
breezy/bzr/workingtree.py (+36/-5)
breezy/bzr/workingtree_4.py (+4/-4)
breezy/bzr/xml8.py (+4/-4)
breezy/bzr/xml_serializer.py (+7/-19)
breezy/cache_utf8.py (+4/-4)
breezy/commands.py (+9/-6)
breezy/config.py (+3/-3)
breezy/controldir.py (+5/-3)
breezy/diff.py (+1/-0)
breezy/doc_generate/conf.py (+5/-2)
breezy/errors.py (+2/-0)
breezy/filters/__init__.py (+8/-2)
breezy/foreign.py (+2/-2)
breezy/forge.py (+6/-6)
breezy/git/__init__.py (+1/-5)
breezy/git/branch.py (+2/-1)
breezy/git/dir.py (+1/-4)
breezy/git/remote.py (+1/-5)
breezy/git/repository.py (+2/-1)
breezy/git/tests/test_remote.py (+2/-2)
breezy/git/transportgit.py (+1/-4)
breezy/git/tree.py (+5/-3)
breezy/git/workingtree.py (+1/-1)
breezy/graph.py (+1/-1)
breezy/hooks.py (+3/-1)
breezy/ignores.py (+2/-1)
breezy/lock.py (+7/-5)
breezy/lsprof.py (+3/-5)
breezy/merge.py (+1/-1)
breezy/merge_directive.py (+1/-1)
breezy/mutabletree.py (+1/-1)
breezy/option.py (+3/-2)
breezy/osutils.py (+8/-7)
breezy/plugins/darcs/__init__.py (+0/-4)
breezy/plugins/flake8/__init__.py (+1/-1)
breezy/plugins/launchpad/forge.py (+0/-2)
breezy/plugins/launchpad/lp_registration.py (+3/-4)
breezy/plugins/repodebug/check_chk.py (+0/-1)
breezy/plugins/weave_fmt/bzrdir.py (+1/-1)
breezy/plugins/weave_fmt/test_store.py (+2/-2)
breezy/plugins/weave_fmt/xml4.py (+3/-1)
breezy/repository.py (+26/-24)
breezy/revision.py (+6/-6)
breezy/revisionspec.py (+9/-22)
breezy/tag.py (+2/-1)
breezy/tests/TestUtil.py (+2/-1)
breezy/tests/__init__.py (+7/-6)
breezy/tests/blackbox/test_push.py (+1/-1)
breezy/tests/blackbox/test_remember_option.py (+5/-4)
breezy/tests/blackbox/test_serve.py (+1/-2)
breezy/tests/blackbox/test_switch.py (+0/-15)
breezy/tests/blackbox/test_upgrade.py (+2/-2)
breezy/tests/fake_command.py (+1/-1)
breezy/tests/https_server.py (+2/-2)
breezy/tests/per_interbranch/__init__.py (+3/-1)
breezy/tests/per_transport.py (+0/-8)
breezy/tests/stub_sftp.py (+1/-1)
breezy/tests/test__annotator.py (+2/-2)
breezy/tests/test_atomicfile.py (+0/-3)
breezy/tests/test_config.py (+2/-9)
breezy/tests/test_conflicts.py (+9/-4)
breezy/tests/test_foreign.py (+2/-1)
breezy/tests/test_forge.py (+2/-1)
breezy/tests/test_hooks.py (+5/-2)
breezy/tests/test_http.py (+3/-3)
breezy/tests/test_lazy_import.py (+1/-1)
breezy/tests/test_lazy_regex.py (+2/-2)
breezy/tests/test_lsprof.py (+1/-4)
breezy/tests/test_merge.py (+0/-27)
breezy/tests/test_osutils_encodings.py (+3/-2)
breezy/tests/test_patch.py (+0/-3)
breezy/tests/test_plugins.py (+2/-1)
breezy/tests/test_shelf.py (+0/-9)
breezy/tests/test_ssh_transport.py (+1/-1)
breezy/tests/test_tree.py (+3/-2)
breezy/tests/test_url_policy_open.py (+3/-1)
breezy/tests/test_utextwrap.py (+3/-3)
breezy/tests/test_win32utils.py (+2/-1)
breezy/transport/__init__.py (+2/-1)
breezy/transport/decorator.py (+2/-1)
breezy/transport/http/urllib.py (+4/-4)
breezy/transport/memory.py (+4/-9)
breezy/transport/ssh.py (+6/-5)
breezy/tree.py (+14/-10)
breezy/util/simplemapi.py (+2/-2)
breezy/version_info_formats/format_rio.py (+1/-1)
breezy/version_info_formats/format_yaml.py (+1/-1)
breezy/workingtree.py (+5/-34)
breezy/workspace.py (+3/-2)
profile_imports.py (+6/-5)
pyproject.toml (+7/-0)
setup.cfg (+0/-1)
To merge this branch: bzr merge lp:~jelmer/brz/mypy
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+432235@code.launchpad.net

This proposal supersedes a proposal from 2022-09-24.

Commit message

Add basic typing, make mypy pass

Description of the change

Add basic typing, make mypy pass.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : Posted in a previous version of this proposal
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Attempt to merge into lp:brz/3.3 failed due to conflicts:

text conflict in .github/workflows/pythonpackage.yml
text conflict in pyproject.toml

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Attempt to merge into lp:brz/3.3 failed due to conflicts:

text conflict in .github/workflows/pythonpackage.yml
text conflict in pyproject.toml

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Attempt to merge into lp:brz/3.3 failed due to conflicts:

contents conflict in byov.conf

Revision history for this message
The Breezy Bot (the-breezy-bot) wrote :

Attempt to merge into lp:brz/3.3 failed due to conflicts:

contents conflict in byov.conf

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

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

Collecting setuptools-gettext
  Using cached 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.ltkpxegk
  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: 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: dulwich>=0.20.46 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.20.46)
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
Requirement already satisfied: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.2.3)
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Collecting sphinx-epytext
  Using cached sphinx-epytext-0.0.4.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting python-subunit
  Using cached python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Requirement already satisfied: paramiko in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (2.10.4)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.10.17)
Collecting fastimport
  Using cached fastimport-0.9.14.tar.gz (41 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 launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.20.4)
Collecting keyring
  Using cached keyring-23.9.3-py3-none-any.whl (35 kB)
Requirement already satisfied: lazr.restfulclient>=0.9.19 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.14.5)
Requirement already satisfied: lazr.uri in /us...

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

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

Collecting setuptools-gettext
  Using cached 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.sxcupdyw
  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: 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: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.8)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
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: dulwich>=0.20.46 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.20.46)
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.10.17)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Collecting fastimport
  Using cached fastimport-0.9.14.tar.gz (41 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: paramiko in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (2.10.4)
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Collecting sphinx-epytext
  Using cached sphinx-epytext-0.0.4.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting python-subunit
  Using cached python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.20.4)
Collecting keyring
  Using cached keyring-23.9.3-py3-none-any.whl (35 kB)
Requirement already satisfied: lazr.restfulclient>=0.9.19 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.14.5)
Requirement already satisfied: lazr.uri in /us...

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

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

Collecting setuptools-gettext
  Using cached 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.5i99lzof
  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: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.2.3)
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: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
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: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.4.1)
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)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Collecting sphinx-epytext
  Using cached 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: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Collecting fastimport
  Using cached fastimport-0.9.14.tar.gz (41 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Collecting python-subunit
  Using cached python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.20.4)
Collecting keyring
  Using cached keyring-23.9.3-py3-none-any.whl (35 kB)
Requirement already satisfied: lazr.restfulclient>=0.9.19 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.14.5)
Requirement already satisfied: lazr.uri in /us...

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

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

Collecting setuptools-gettext
  Using cached 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.sd8v0hwq
  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: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.2.3)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.8)
Requirement already satisfied: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
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: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.4.1)
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: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.10.17)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Collecting python-subunit
  Using cached python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Collecting sphinx-epytext
  Using cached sphinx-epytext-0.0.4.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Requirement already satisfied: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Collecting fastimport
  Using cached fastimport-0.9.14.tar.gz (41 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: paramiko in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (2.10.4)
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.20.4)
Collecting keyring
  Using cached keyring-23.9.3-py3-none-any.whl (35 kB)
Requirement already satisfied: lazr.restfulclient>=0.9.19 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.14.5)
Requirement already satisfied: lazr.uri in /us...

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

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

Collecting setuptools-gettext
  Using cached 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._6cdo0n2
  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: patiencediff in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.2.3)
Requirement already satisfied: merge3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.8)
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: configobj in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.0.6)
Requirement already satisfied: fastbencode in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (0.0.12)
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: pyyaml in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (5.4.1)
Requirement already satisfied: paramiko in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (2.10.4)
Collecting sphinx-epytext
  Using cached 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: setuptools in ./lib/python3.10/site-packages (from breezy==3.3.1.dev0) (65.5.0)
Collecting sphinx
  Using cached sphinx-5.3.0-py3-none-any.whl (3.2 MB)
Requirement already satisfied: gpg in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.18.0)
Requirement already satisfied: launchpadlib>=1.6.3 in /usr/lib/python3/dist-packages (from breezy==3.3.1.dev0) (1.10.17)
Collecting fastimport
  Using cached fastimport-0.9.14.tar.gz (41 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting testtools
  Using cached testtools-2.5.0-py3-none-any.whl (181 kB)
Collecting python-subunit
  Using cached python_subunit-1.4.0-py2.py3-none-any.whl (106 kB)
Requirement already satisfied: httplib2 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.20.4)
Collecting keyring
  Using cached keyring-23.9.3-py3-none-any.whl (35 kB)
Requirement already satisfied: lazr.restfulclient>=0.9.19 in /usr/lib/python3/dist-packages (from launchpadlib>=1.6.3->breezy==3.3.1.dev0) (0.14.5)
Requirement already satisfied: lazr.uri in /us...

lp:~jelmer/brz/mypy updated
7664. By Jelmer Vernooij

Fix remaining tests.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.github/workflows/pythonpackage.yml'
--- .github/workflows/pythonpackage.yml 2022-10-18 20:35:20 +0000
+++ .github/workflows/pythonpackage.yml 2022-10-29 02:25:56 +0000
@@ -33,7 +33,7 @@
33 run: |33 run: |
34 python -m pip install --upgrade pip34 python -m pip install --upgrade pip
35 pip install -U pip "setuptools>=60" setuptools-gettext35 pip install -U pip "setuptools>=60" setuptools-gettext
36 pip install -U pip coverage codecov flake8 testtools paramiko fastbencode fastimport configobj cython testscenarios six docutils $TEST_REQUIRE sphinx sphinx_epytext launchpadlib patiencediff pyinotify git+https://github.com/dulwich/dulwich setuptools-rust pyyaml merge336 pip install -U pip coverage codecov flake8 testtools paramiko fastbencode fastimport configobj cython testscenarios six docutils $TEST_REQUIRE sphinx sphinx_epytext launchpadlib patiencediff pyinotify git+https://github.com/dulwich/dulwich setuptools-rust pyyaml merge3 mypy
37 - name: Build docs37 - name: Build docs
38 run: |38 run: |
39 make docs PYTHON=python39 make docs PYTHON=python
@@ -48,3 +48,6 @@
48 PYTHONHASHSEED: random48 PYTHONHASHSEED: random
49 BRZ_PLUGIN_PATH: -site:-user49 BRZ_PLUGIN_PATH: -site:-user
50 PYTHONPATH: .50 PYTHONPATH: .
51 - name: Run mypy
52 run: |
53 python -m mypy breezy
5154
=== modified file 'Makefile'
--- Makefile 2022-10-18 18:12:47 +0000
+++ Makefile 2022-10-29 02:25:56 +0000
@@ -71,6 +71,9 @@
71flake8:71flake8:
72 flake872 flake8
7373
74mypy:
75 mypy breezy
76
74clean:77clean:
75 $(PYTHON) setup.py clean78 $(PYTHON) setup.py clean
76 -find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f79 -find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
7780
=== modified file 'breezy/__init__.py'
--- breezy/__init__.py 2022-10-08 07:04:57 +0000
+++ breezy/__init__.py 2022-10-29 02:25:56 +0000
@@ -156,7 +156,7 @@
156_fs_enc = sys.getfilesystemencoding()156_fs_enc = sys.getfilesystemencoding()
157if getattr(sys, "_brz_default_fs_enc", None) is not None:157if getattr(sys, "_brz_default_fs_enc", None) is not None:
158 if (_fs_enc is None or codecs.lookup(_fs_enc).name == "ascii"):158 if (_fs_enc is None or codecs.lookup(_fs_enc).name == "ascii"):
159 _fs_enc = _patch_filesystem_default_encoding(sys._brz_default_fs_enc)159 _fs_enc = _patch_filesystem_default_encoding(sys._brz_default_fs_enc) # type: ignore
160if _fs_enc is None:160if _fs_enc is None:
161 _fs_enc = "ascii"161 _fs_enc = "ascii"
162else:162else:
163163
=== modified file 'breezy/__main__.py'
--- breezy/__main__.py 2022-10-06 05:52:17 +0000
+++ breezy/__main__.py 2022-10-29 02:25:56 +0000
@@ -43,7 +43,7 @@
43 # Use better default than ascii with posix filesystems that deal in bytes43 # Use better default than ascii with posix filesystems that deal in bytes
44 # natively even when the C locale or no locale at all is given. Note that44 # natively even when the C locale or no locale at all is given. Note that
45 # we need an immortal string for the hack, hence the lack of a hyphen.45 # we need an immortal string for the hack, hence the lack of a hyphen.
46 sys._brz_default_fs_enc = "utf8"46 sys._brz_default_fs_enc = "utf8" # type: ignore
4747
4848
49def main():49def main():
5050
=== modified file 'breezy/_known_graph_py.py'
--- breezy/_known_graph_py.py 2020-02-18 01:57:45 +0000
+++ breezy/_known_graph_py.py 2022-10-29 02:25:56 +0000
@@ -17,10 +17,7 @@
17"""Implementation of Graph algorithms when we have already loaded everything.17"""Implementation of Graph algorithms when we have already loaded everything.
18"""18"""
1919
20try:20from collections import deque
21 from collections.abc import deque
22except ImportError: # python < 3.7
23 from collections import deque
24from . import (21from . import (
25 errors,22 errors,
26 revision,23 revision,
2724
=== modified file 'breezy/branch.py'
--- breezy/branch.py 2022-10-07 06:34:37 +0000
+++ breezy/branch.py 2022-10-29 02:25:56 +0000
@@ -14,7 +14,7 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from typing import Optional, Tuple17from typing import Optional, Tuple, List, Type
1818
19from .lazy_import import lazy_import19from .lazy_import import lazy_import
20lazy_import(globals(), """20lazy_import(globals(), """
@@ -83,6 +83,12 @@
8383
84 name: Optional[str]84 name: Optional[str]
8585
86 base: str
87
88 _format: "BranchFormat"
89
90 _last_revision_info_cache: Optional[Tuple[int, RevisionID]]
91
86 @property92 @property
87 def control_transport(self):93 def control_transport(self):
88 return self._transport94 return self._transport
@@ -1758,7 +1764,7 @@
17581764
17591765
1760# install the default hooks into the Branch class.1766# install the default hooks into the Branch class.
1761Branch.hooks = BranchHooks()1767Branch.hooks = BranchHooks() # type: ignore
17621768
17631769
1764class ChangeBranchTipParams(object):1770class ChangeBranchTipParams(object):
@@ -2063,7 +2069,7 @@
2063 can be carried out on.2069 can be carried out on.
2064 """2070 """
20652071
2066 _optimisers = []2072 _optimisers: List[Type["InterBranch"]] = []
2067 """The available optimised InterBranch types."""2073 """The available optimised InterBranch types."""
20682074
2069 @classmethod2075 @classmethod
20702076
=== modified file 'breezy/builtins.py'
--- breezy/builtins.py 2022-10-28 19:54:38 +0000
+++ breezy/builtins.py 2022-10-29 02:25:56 +0000
@@ -924,7 +924,6 @@
924 """924 """
925925
926 takes_args = ['names*']926 takes_args = ['names*']
927 takes_options = []
928 aliases = ['copy']927 aliases = ['copy']
929 encoding_type = 'replace'928 encoding_type = 'replace'
930929
@@ -2085,7 +2084,7 @@
2085 help='Specify a format for this branch. '2084 help='Specify a format for this branch. '
2086 'See "help formats" for a full list.',2085 'See "help formats" for a full list.',
2087 lazy_registry=('breezy.controldir', 'format_registry'),2086 lazy_registry=('breezy.controldir', 'format_registry'),
2088 converter=lambda name: controldir.format_registry.make_controldir(2087 converter=lambda name: controldir.format_registry.make_controldir( # type: ignore
2089 name),2088 name),
2090 value_switches=True,2089 value_switches=True,
2091 title="Branch format",2090 title="Branch format",
@@ -2208,7 +2207,7 @@
2208 ' "brz help formats" for details.',2207 ' "brz help formats" for details.',
2209 lazy_registry=(2208 lazy_registry=(
2210 'breezy.controldir', 'format_registry'),2209 'breezy.controldir', 'format_registry'),
2211 converter=lambda name: controldir.format_registry.make_controldir(2210 converter=lambda name: controldir.format_registry.make_controldir( # type: ignore
2212 name),2211 name),
2213 value_switches=True, title='Repository format'),2212 value_switches=True, title='Repository format'),
2214 Option('no-trees',2213 Option('no-trees',
@@ -3895,7 +3894,7 @@
3895 help='Upgrade to a specific format. See "brz help'3894 help='Upgrade to a specific format. See "brz help'
3896 ' formats" for details.',3895 ' formats" for details.',
3897 lazy_registry=('breezy.controldir', 'format_registry'),3896 lazy_registry=('breezy.controldir', 'format_registry'),
3898 converter=lambda name: controldir.format_registry.make_controldir(3897 converter=lambda name: controldir.format_registry.make_controldir( # type: ignore
3899 name),3898 name),
3900 value_switches=True, title='Branch format'),3899 value_switches=True, title='Branch format'),
3901 Option('clean',3900 Option('clean',
@@ -5415,7 +5414,6 @@
5415 """5414 """
54165415
5417 _see_also = ['checkouts', 'bind']5416 _see_also = ['checkouts', 'bind']
5418 takes_args = []
5419 takes_options = ['directory']5417 takes_options = ['directory']
54205418
5421 def run(self, directory=u'.'):5419 def run(self, directory=u'.'):
@@ -5456,7 +5454,6 @@
5456 ),5454 ),
5457 ]5455 ]
5458 takes_args = ['location?']5456 takes_args = ['location?']
5459 aliases = []
5460 encoding_type = 'replace'5457 encoding_type = 'replace'
54615458
5462 def run(self, location=None, dry_run=False, verbose=False,5459 def run(self, location=None, dry_run=False, verbose=False,
@@ -6456,7 +6453,6 @@
6456 brz view --delete --all6453 brz view --delete --all
6457 """6454 """
64586455
6459 _see_also = []
6460 takes_args = ['file*']6456 takes_args = ['file*']
6461 takes_options = [6457 takes_options = [
6462 Option('all',6458 Option('all',
64636459
=== modified file 'breezy/bzr/branch.py'
--- breezy/bzr/branch.py 2022-10-07 06:34:37 +0000
+++ breezy/bzr/branch.py 2022-10-29 02:25:56 +0000
@@ -107,7 +107,7 @@
107 """Returns the directory containing the control directory."""107 """Returns the directory containing the control directory."""
108 return self._base108 return self._base
109109
110 base = property(_get_base, doc="The URL for the root of this branch.")110 base = property(_get_base, doc="The URL for the root of this branch.") # type: ignore
111111
112 @property112 @property
113 def user_transport(self):113 def user_transport(self):
114114
=== modified file 'breezy/bzr/btree_index.py'
--- breezy/bzr/btree_index.py 2022-10-07 06:34:37 +0000
+++ breezy/bzr/btree_index.py 2022-10-29 02:25:56 +0000
@@ -1557,8 +1557,8 @@
1557_gcchk_factory = _LeafNode1557_gcchk_factory = _LeafNode
15581558
1559try:1559try:
1560 from . import _btree_serializer_pyx as _btree_serializer1560 from . import _btree_serializer_pyx as _btree_serializer # type: ignore
1561 _gcchk_factory = _btree_serializer._parse_into_chk1561 _gcchk_factory = _btree_serializer._parse_into_chk # type: ignore
1562except ImportError as e:1562except ImportError as e:
1563 osutils.failed_to_load_extension(e)1563 osutils.failed_to_load_extension(e)
1564 from . import _btree_serializer_py as _btree_serializer1564 from . import _btree_serializer_py as _btree_serializer
15651565
=== modified file 'breezy/bzr/bzrdir.py'
--- breezy/bzr/bzrdir.py 2022-10-08 17:38:06 +0000
+++ breezy/bzr/bzrdir.py 2022-10-29 02:25:56 +0000
@@ -25,12 +25,12 @@
25objects returned.25objects returned.
26"""26"""
2727
28import contextlib
28import sys29import sys
30from typing import Set
2931
30from ..lazy_import import lazy_import32from ..lazy_import import lazy_import
31lazy_import(globals(), """33lazy_import(globals(), """
32import contextlib
33
34from breezy import (34from breezy import (
35 branch as _mod_branch,35 branch as _mod_branch,
36 lockable_files,36 lockable_files,
@@ -44,13 +44,13 @@
44from breezy.bzr import (44from breezy.bzr import (
45 branch as _mod_bzrbranch,45 branch as _mod_bzrbranch,
46 fetch,46 fetch,
47 fullhistory as fullhistorybranch,
48 knitpack_repo,
47 remote,49 remote,
48 vf_search,50 vf_search,
49 workingtree_3,51 workingtree_3,
50 workingtree_4,52 workingtree_4,
51 )53 )
52from breezy.bzr import fullhistory as fullhistorybranch
53from breezy.bzr import knitpack_repo
54from breezy.i18n import gettext54from breezy.i18n import gettext
55""")55""")
5656
@@ -1144,7 +1144,7 @@
1144 :ivar features: Dictionary mapping feature names to their necessity1144 :ivar features: Dictionary mapping feature names to their necessity
1145 """1145 """
11461146
1147 _present_features = set()1147 _present_features: Set[str] = set()
11481148
1149 def __init__(self):1149 def __init__(self):
1150 self.features = {}1150 self.features = {}
@@ -1850,24 +1850,6 @@
1850 return BzrDir.open_from_transport(to_convert.root_transport)1850 return BzrDir.open_from_transport(to_convert.root_transport)
18511851
18521852
1853class ConvertMetaToColo(controldir.Converter):
1854 """Convert a 'development-colo' bzrdir to a '2a' bzrdir."""
1855
1856 def __init__(self, target_format):
1857 """Create a converter that converts a 'development-colo' metadir
1858 to a '2a' metadir.
1859
1860 :param target_format: The final metadir format that is desired.
1861 """
1862 self.target_format = target_format
1863
1864 def convert(self, to_convert, pb):
1865 """See Converter.convert()."""
1866 to_convert.transport.put_bytes('branch-format',
1867 self.target_format.as_string())
1868 return BzrDir.open_from_transport(to_convert.root_transport)
1869
1870
1871class CreateRepository(controldir.RepositoryAcquisitionPolicy):1853class CreateRepository(controldir.RepositoryAcquisitionPolicy):
1872 """A policy of creating a new repository"""1854 """A policy of creating a new repository"""
18731855
18741856
=== modified file 'breezy/bzr/groupcompress.py'
--- breezy/bzr/groupcompress.py 2022-10-08 17:38:06 +0000
+++ breezy/bzr/groupcompress.py 2022-10-29 02:25:56 +0000
@@ -17,6 +17,7 @@
17"""Core compression logic for compressing streams of related files."""17"""Core compression logic for compressing streams of related files."""
1818
19import time19import time
20from typing import Type
20import zlib21import zlib
2122
22from ..lazy_import import lazy_import23from ..lazy_import import lazy_import
@@ -25,7 +26,6 @@
25 annotate,26 annotate,
26 config,27 config,
27 debug,28 debug,
28 trace,
29 tsort,29 tsort,
30 )30 )
31from breezy.bzr import (31from breezy.bzr import (
@@ -41,7 +41,8 @@
41from .. import (41from .. import (
42 errors,42 errors,
43 osutils,43 osutils,
44 )44 trace,
45)
45from .btree_index import BTreeBuilder46from .btree_index import BTreeBuilder
46from ..lru_cache import LRUSizeCache47from ..lru_cache import LRUSizeCache
47from .versionedfile import (48from .versionedfile import (
@@ -53,7 +54,7 @@
53 FulltextContentFactory,54 FulltextContentFactory,
54 VersionedFilesWithFallbacks,55 VersionedFilesWithFallbacks,
55 UnavailableRepresentation,56 UnavailableRepresentation,
56 )57)
5758
58# Minimum number of uncompressed bytes to try fetch at once when retrieving59# Minimum number of uncompressed bytes to try fetch at once when retrieving
59# groupcompress blocks.60# groupcompress blocks.
@@ -2244,6 +2245,9 @@
2244 key_dependencies.add_references(node[1], node[3][0])2245 key_dependencies.add_references(node[1], node[3][0])
22452246
22462247
2248GroupCompressor: Type[_CommonGroupCompressor]
2249
2250
2247from ._groupcompress_py import (2251from ._groupcompress_py import (
2248 apply_delta,2252 apply_delta,
2249 apply_delta_to_source,2253 apply_delta_to_source,
22502254
=== modified file 'breezy/bzr/inventory.py'
--- breezy/bzr/inventory.py 2022-07-16 12:50:01 +0000
+++ breezy/bzr/inventory.py 2022-10-29 02:25:56 +0000
@@ -27,10 +27,7 @@
27# created, but it's not for now.27# created, but it's not for now.
28ROOT_ID = b"TREE_ROOT"28ROOT_ID = b"TREE_ROOT"
2929
30try:30from collections import deque
31 from collections.abc import deque
32except ImportError: # python < 3.7
33 from collections import deque
3431
3532
36from ..lazy_import import lazy_import33from ..lazy_import import lazy_import
3734
=== modified file 'breezy/bzr/inventorytree.py'
--- breezy/bzr/inventorytree.py 2022-10-28 17:29:17 +0000
+++ breezy/bzr/inventorytree.py 2022-10-29 02:25:56 +0000
@@ -17,13 +17,11 @@
17"""Tree classes, representing directory at point in time.17"""Tree classes, representing directory at point in time.
18"""18"""
1919
20try:20from collections import deque
21 from collections.abc import deque
22except ImportError: # python < 3.7
23 from collections import deque
2421
25import os22import os
26import re23import re
24from typing import Type, TYPE_CHECKING, Optional
2725
2826
29from .. import (27from .. import (
@@ -1147,12 +1145,6 @@
1147 """InterTree implementation for InventoryTree objects.1145 """InterTree implementation for InventoryTree objects.
11481146
1149 """1147 """
1150 # Formats that will be used to test this InterTree. If both are
1151 # None, this InterTree will not be tested (e.g. because a complex
1152 # setup is required)
1153 _matching_from_tree_format = None
1154 _matching_to_tree_format = None
1155
1156 @classmethod1148 @classmethod
1157 def is_compatible(kls, source, target):1149 def is_compatible(kls, source, target):
1158 # The default implementation is naive and uses the public API, so1150 # The default implementation is naive and uses the public API, so
11591151
=== modified file 'breezy/bzr/knit.py'
--- breezy/bzr/knit.py 2022-08-22 18:19:46 +0000
+++ breezy/bzr/knit.py 2022-10-29 02:25:56 +0000
@@ -68,7 +68,6 @@
68 ui,68 ui,
69 )69 )
70from breezy.bzr import (70from breezy.bzr import (
71 index as _mod_index,
72 pack,71 pack,
73 static_tuple,72 static_tuple,
74 tuned_gzip,73 tuned_gzip,
@@ -108,6 +107,9 @@
108 UnavailableRepresentation,107 UnavailableRepresentation,
109 VersionedFilesWithFallbacks,108 VersionedFilesWithFallbacks,
110 )109 )
110from . import (
111 index as _mod_index,
112 )
111113
112114
113# TODO: Split out code specific to this format into an associated object.115# TODO: Split out code specific to this format into an associated object.
114116
=== modified file 'breezy/bzr/knitrepo.py'
--- breezy/bzr/knitrepo.py 2022-10-08 14:19:59 +0000
+++ breezy/bzr/knitrepo.py 2022-10-29 02:25:56 +0000
@@ -47,10 +47,11 @@
47 IsInWriteGroupError,47 IsInWriteGroupError,
48 Repository,48 Repository,
49 )49 )
50from ..bzr.repository import (50from .repository import (
51 RepositoryFormatMetaDir,51 RepositoryFormatMetaDir,
52 )52 )
53from ..bzr.vf_repository import (53from .serializer import Serializer
54from .vf_repository import (
54 InterSameDataRepository,55 InterSameDataRepository,
55 MetaDirVersionedFileRepository,56 MetaDirVersionedFileRepository,
56 MetaDirVersionedFileRepositoryFormat,57 MetaDirVersionedFileRepositoryFormat,
@@ -123,7 +124,7 @@
123 # them, or a subclass fails to call the constructor, that an error will124 # them, or a subclass fails to call the constructor, that an error will
124 # occur rather than the system working but generating incorrect data.125 # occur rather than the system working but generating incorrect data.
125 _commit_builder_class: Type[VersionedFileCommitBuilder]126 _commit_builder_class: Type[VersionedFileCommitBuilder]
126 _serializer: Type[serializer.Serializer]127 _serializer: Serializer
127128
128 def __init__(self, _format, a_controldir, control_files, _commit_builder_class,129 def __init__(self, _format, a_controldir, control_files, _commit_builder_class,
129 _serializer):130 _serializer):
130131
=== modified file 'breezy/bzr/pack_repo.py'
--- breezy/bzr/pack_repo.py 2022-08-22 18:19:46 +0000
+++ breezy/bzr/pack_repo.py 2022-10-29 02:25:56 +0000
@@ -16,6 +16,7 @@
1616
17import re17import re
18import sys18import sys
19from typing import Type
1920
20from ..lazy_import import lazy_import21from ..lazy_import import lazy_import
21lazy_import(globals(), """22lazy_import(globals(), """
@@ -44,6 +45,7 @@
44 transport as _mod_transport,45 transport as _mod_transport,
45 )46 )
46from ..bzr import (47from ..bzr import (
48 index,
47 btree_index,49 btree_index,
48 )50 )
4951
@@ -55,11 +57,12 @@
55 _LazyListJoin,57 _LazyListJoin,
56 RepositoryWriteLockResult,58 RepositoryWriteLockResult,
57 )59 )
58from ..bzr.repository import (60from .repository import (
59 MetaDirRepository,61 MetaDirRepository,
60 RepositoryFormatMetaDir,62 RepositoryFormatMetaDir,
61 )63 )
62from ..bzr.vf_repository import (64from .serializer import Serializer
65from .vf_repository import (
63 MetaDirVersionedFileRepository,66 MetaDirVersionedFileRepository,
64 MetaDirVersionedFileRepositoryFormat,67 MetaDirVersionedFileRepositoryFormat,
65 VersionedFileCommitBuilder,68 VersionedFileCommitBuilder,
@@ -811,10 +814,10 @@
811 :ivar _names: map of {pack_name: (index_size,)}814 :ivar _names: map of {pack_name: (index_size,)}
812 """815 """
813816
814 pack_factory = None817 pack_factory: Type[NewPack]
815 resumed_pack_factory = None818 resumed_pack_factory: Type[ResumedPack]
816 normal_packer_class = None819 normal_packer_class: Type[Packer]
817 optimising_packer_class = None820 optimising_packer_class: Type[Packer]
818821
819 def __init__(self, repo, transport, index_transport, upload_transport,822 def __init__(self, repo, transport, index_transport, upload_transport,
820 pack_transport, index_builder_class, index_class,823 pack_transport, index_builder_class, index_class,
@@ -1721,8 +1724,8 @@
1721 # them to None ensures that if the constructor is changed to not initialize1724 # them to None ensures that if the constructor is changed to not initialize
1722 # them, or a subclass fails to call the constructor, that an error will1725 # them, or a subclass fails to call the constructor, that an error will
1723 # occur rather than the system working but generating incorrect data.1726 # occur rather than the system working but generating incorrect data.
1724 _commit_builder_class = None1727 _commit_builder_class: Type[VersionedFileCommitBuilder]
1725 _serializer = None1728 _serializer: Serializer
17261729
1727 def __init__(self, _format, a_controldir, control_files, _commit_builder_class,1730 def __init__(self, _format, a_controldir, control_files, _commit_builder_class,
1728 _serializer):1731 _serializer):
@@ -1912,27 +1915,27 @@
19121915
1913 # Set this attribute in derived classes to control the repository class1916 # Set this attribute in derived classes to control the repository class
1914 # created by open and initialize.1917 # created by open and initialize.
1915 repository_class = None1918 repository_class: Type[PackRepository]
1916 # Set this attribute in derived classes to control the1919 # Set this attribute in derived classes to control the
1917 # _commit_builder_class that the repository objects will have passed to1920 # _commit_builder_class that the repository objects will have passed to
1918 # their constructor.1921 # their constructor.
1919 _commit_builder_class = None1922 _commit_builder_class: Type[VersionedFileCommitBuilder]
1920 # Set this attribute in derived clases to control the _serializer that the1923 # Set this attribute in derived clases to control the _serializer that the
1921 # repository objects will have passed to their constructor.1924 # repository objects will have passed to their constructor.
1922 _serializer = None1925 _serializer: Serializer
1923 # Packs are not confused by ghosts.1926 # Packs are not confused by ghosts.
1924 supports_ghosts = True1927 supports_ghosts: bool = True
1925 # External references are not supported in pack repositories yet.1928 # External references are not supported in pack repositories yet.
1926 supports_external_lookups = False1929 supports_external_lookups: bool = False
1927 # Most pack formats do not use chk lookups.1930 # Most pack formats do not use chk lookups.
1928 supports_chks = False1931 supports_chks: bool = False
1929 # What index classes to use1932 # What index classes to use
1930 index_builder_class = None1933 index_builder_class: Type[index.GraphIndexBuilder]
1931 index_class = None1934 index_class: Type[object]
1932 _fetch_uses_deltas = True1935 _fetch_uses_deltas: bool = True
1933 fast_deltas = False1936 fast_deltas: bool = False
1934 supports_funky_characters = True1937 supports_funky_characters: bool = True
1935 revision_graph_can_have_wrong_parents = True1938 revision_graph_can_have_wrong_parents: bool = True
19361939
1937 def initialize(self, a_controldir, shared=False):1940 def initialize(self, a_controldir, shared=False):
1938 """Create a pack based repository.1941 """Create a pack based repository.
19391942
=== modified file 'breezy/bzr/remote.py'
--- breezy/bzr/remote.py 2022-09-22 22:55:28 +0000
+++ breezy/bzr/remote.py 2022-10-29 02:25:56 +0000
@@ -1049,6 +1049,7 @@
1049 supports_full_versioned_files = True1049 supports_full_versioned_files = True
1050 supports_leaving_lock = True1050 supports_leaving_lock = True
1051 supports_overriding_transport = False1051 supports_overriding_transport = False
1052 supports_ghosts = False
10521053
1053 def __init__(self):1054 def __init__(self):
1054 _mod_repository.RepositoryFormat.__init__(self)1055 _mod_repository.RepositoryFormat.__init__(self)
@@ -1203,9 +1204,9 @@
1203 try:1204 try:
1204 self._custom_format = _mod_repository.network_format_registry.get(1205 self._custom_format = _mod_repository.network_format_registry.get(
1205 self._network_name)1206 self._network_name)
1206 except KeyError:1207 except KeyError as e:
1207 raise errors.UnknownFormatError(kind='repository',1208 raise errors.UnknownFormatError(
1208 format=self._network_name)1209 kind='repository', format=self._network_name) from e
12091210
1210 @property1211 @property
1211 def _fetch_order(self):1212 def _fetch_order(self):
12121213
=== modified file 'breezy/bzr/smart/client.py'
--- breezy/bzr/smart/client.py 2020-02-18 01:57:45 +0000
+++ breezy/bzr/smart/client.py 2022-10-29 02:25:56 +0000
@@ -329,7 +329,7 @@
329 "accessible.", None)329 "accessible.", None)
330330
331331
332_SmartClient.hooks = SmartClientHooks()332_SmartClient.hooks = SmartClientHooks() # type: ignore
333333
334334
335class CallHookParams(object):335class CallHookParams(object):
336336
=== modified file 'breezy/bzr/smart/medium.py'
--- breezy/bzr/smart/medium.py 2022-07-15 14:06:55 +0000
+++ breezy/bzr/smart/medium.py 2022-10-29 02:25:56 +0000
@@ -30,10 +30,7 @@
30import sys30import sys
31import time31import time
3232
33try:33import _thread
34 import _thread
35except ImportError:
36 import thread as _thread
3734
38import breezy35import breezy
39from ...lazy_import import lazy_import36from ...lazy_import import lazy_import
4037
=== modified file 'breezy/bzr/smart/message.py'
--- breezy/bzr/smart/message.py 2020-02-18 01:57:45 +0000
+++ breezy/bzr/smart/message.py 2022-10-29 02:25:56 +0000
@@ -14,10 +14,7 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17try:17from collections import deque
18 from collections.abc import deque
19except ImportError: # python < 3.7
20 from collections import deque
2118
22from io import (19from io import (
23 BytesIO,20 BytesIO,
2421
=== modified file 'breezy/bzr/smart/protocol.py'
--- breezy/bzr/smart/protocol.py 2022-07-15 14:13:49 +0000
+++ breezy/bzr/smart/protocol.py 2022-10-29 02:25:56 +0000
@@ -19,10 +19,7 @@
19"""19"""
2020
2121
22try:22from collections import deque
23 from collections.abc import deque
24except ImportError: # python < 3.7
25 from collections import deque
2623
27from io import BytesIO24from io import BytesIO
28import struct25import struct
2926
=== modified file 'breezy/bzr/smart/server.py'
--- breezy/bzr/smart/server.py 2022-07-04 15:43:01 +0000
+++ breezy/bzr/smart/server.py 2022-10-29 02:25:56 +0000
@@ -348,7 +348,7 @@
348 "in which case the server will exit normally.", (2, 4))348 "in which case the server will exit normally.", (2, 4))
349349
350350
351SmartTCPServer.hooks = SmartServerHooks()351SmartTCPServer.hooks = SmartServerHooks() # type: ignore
352352
353353
354def _local_path_for_transport(transport):354def _local_path_for_transport(transport):
355355
=== modified file 'breezy/bzr/tests/test__simple_set.py'
--- breezy/bzr/tests/test__simple_set.py 2022-07-16 13:33:49 +0000
+++ breezy/bzr/tests/test__simple_set.py 2022-10-29 02:25:56 +0000
@@ -26,7 +26,7 @@
26 )26 )
2727
28try:28try:
29 from .. import _simple_set_pyx29 from .. import _simple_set_pyx # type: ignore
30except ImportError:30except ImportError:
31 _simple_set_pyx = None31 _simple_set_pyx = None
3232
3333
=== modified file 'breezy/bzr/tests/test__static_tuple.py'
--- breezy/bzr/tests/test__static_tuple.py 2022-07-16 12:50:01 +0000
+++ breezy/bzr/tests/test__static_tuple.py 2022-10-29 02:25:56 +0000
@@ -16,10 +16,7 @@
1616
17"""Tests for the StaticTuple type."""17"""Tests for the StaticTuple type."""
1818
19try:19import pickle
20 import cPickle as pickle
21except ImportError:
22 import pickle
23import operator20import operator
24import sys21import sys
2522
2623
=== modified file 'breezy/bzr/tests/test_btree_index.py'
--- breezy/bzr/tests/test_btree_index.py 2020-06-10 03:30:11 +0000
+++ breezy/bzr/tests/test_btree_index.py 2022-10-29 02:25:56 +0000
@@ -1273,26 +1273,6 @@
1273 ], node.keys)1273 ], node.keys)
1274 self.assertEqual(1, node.offset)1274 self.assertEqual(1, node.offset)
12751275
1276 def test_LeafNode_2_2(self):
1277 node_bytes = (b"type=leaf\n"
1278 b"00\x0000\x00\t00\x00ref00\x00value:0\n"
1279 b"00\x0011\x0000\x00ref00\t00\x00ref00\r01\x00ref01\x00value:1\n"
1280 b"11\x0033\x0011\x00ref22\t11\x00ref22\r11\x00ref22\x00value:3\n"
1281 b"11\x0044\x00\t11\x00ref00\x00value:4\n"
1282 b""
1283 )
1284 node = btree_index._LeafNode(node_bytes, 2, 2)
1285 # We do direct access, or don't care about order, to leaf nodes most of
1286 # the time, so a dict is useful:
1287 self.assertEqual({
1288 (b'00', b'00'): (b'value:0', ((), ((b'00', b'ref00'),))),
1289 (b'00', b'11'): (b'value:1', (((b'00', b'ref00'),),
1290 ((b'00', b'ref00'), (b'01', b'ref01')))),
1291 (b'11', b'33'): (b'value:3', (((b'11', b'ref22'),),
1292 ((b'11', b'ref22'), (b'11', b'ref22')))),
1293 (b'11', b'44'): (b'value:4', ((), ((b'11', b'ref00'),)))
1294 }, dict(node.all_items()))
1295
1296 def assertFlattened(self, expected, key, value, refs):1276 def assertFlattened(self, expected, key, value, refs):
1297 flat_key, flat_line = self.parse_btree._flatten_node(1277 flat_key, flat_line = self.parse_btree._flatten_node(
1298 (None, key, value, refs), bool(refs))1278 (None, key, value, refs), bool(refs))
12991279
=== modified file 'breezy/bzr/tests/test_bundle.py'
--- breezy/bzr/tests/test_bundle.py 2022-09-22 22:55:28 +0000
+++ breezy/bzr/tests/test_bundle.py 2022-10-29 02:25:56 +0000
@@ -393,10 +393,10 @@
393 return tests.TestCaseWithTransport.make_branch_and_tree(393 return tests.TestCaseWithTransport.make_branch_and_tree(
394 self, path, format)394 self, path, format)
395395
396 def make_branch(self, path, format=None):396 def make_branch(self, path, format=None, name=None):
397 if format is None:397 if format is None:
398 format = self.bzrdir_format()398 format = self.bzrdir_format()
399 return tests.TestCaseWithTransport.make_branch(self, path, format)399 return tests.TestCaseWithTransport.make_branch(self, path, format, name=name)
400400
401 def create_bundle_text(self, base_rev_id, rev_id):401 def create_bundle_text(self, base_rev_id, rev_id):
402 bundle_txt = BytesIO()402 bundle_txt = BytesIO()
403403
=== modified file 'breezy/bzr/tests/test_inv.py'
--- breezy/bzr/tests/test_inv.py 2022-07-02 13:44:01 +0000
+++ breezy/bzr/tests/test_inv.py 2022-10-29 02:25:56 +0000
@@ -716,7 +716,7 @@
716 dir = inventory.InventoryLink(b'123', 'hello.c', ROOT_ID)716 dir = inventory.InventoryLink(b'123', 'hello.c', ROOT_ID)
717 self.assertEqual(dir.kind_character(), '')717 self.assertEqual(dir.kind_character(), '')
718718
719 def test_link_kind_character(self):719 def test_tree_ref_kind_character(self):
720 dir = TreeReference(b'123', 'hello.c', ROOT_ID)720 dir = TreeReference(b'123', 'hello.c', ROOT_ID)
721 self.assertEqual(dir.kind_character(), '+')721 self.assertEqual(dir.kind_character(), '+')
722722
723723
=== modified file 'breezy/bzr/tests/test_pack.py'
--- breezy/bzr/tests/test_pack.py 2022-07-16 17:53:49 +0000
+++ breezy/bzr/tests/test_pack.py 2022-10-29 02:25:56 +0000
@@ -178,16 +178,6 @@
178 b'Bazaar pack format 1 (introduced in 0.18)\n'178 b'Bazaar pack format 1 (introduced in 0.18)\n'
179 b'B3\nname1\nname2\n\nabc')179 b'B3\nname1\nname2\n\nabc')
180180
181 def test_add_bytes_record_two_names(self):
182 """Add a bytes record with two names."""
183 self.writer.begin()
184 offset, length = self.writer.add_bytes_record(
185 [b'abc'], len(b'abc'), names=[(b'name1', ), (b'name2', )])
186 self.assertEqual((42, 19), (offset, length))
187 self.assertOutput(
188 b'Bazaar pack format 1 (introduced in 0.18)\n'
189 b'B3\nname1\nname2\n\nabc')
190
191 def test_add_bytes_record_two_element_name(self):181 def test_add_bytes_record_two_element_name(self):
192 """Add a bytes record with a two-element name."""182 """Add a bytes record with a two-element name."""
193 self.writer.begin()183 self.writer.begin()
194184
=== modified file 'breezy/bzr/tests/test_repository.py'
--- breezy/bzr/tests/test_repository.py 2022-08-22 18:19:46 +0000
+++ breezy/bzr/tests/test_repository.py 2022-10-29 02:25:56 +0000
@@ -403,9 +403,11 @@
403 dummy_a = DummyRepository()403 dummy_a = DummyRepository()
404 dummy_a._format = RepositoryFormat()404 dummy_a._format = RepositoryFormat()
405 dummy_a._format.supports_full_versioned_files = True405 dummy_a._format.supports_full_versioned_files = True
406 dummy_a._format.rich_root_data = True
406 dummy_b = DummyRepository()407 dummy_b = DummyRepository()
407 dummy_b._format = RepositoryFormat()408 dummy_b._format = RepositoryFormat()
408 dummy_b._format.supports_full_versioned_files = True409 dummy_b._format.supports_full_versioned_files = True
410 dummy_b._format.rich_root_data = True
409 self.assertGetsDefaultInterRepository(dummy_a, dummy_b)411 self.assertGetsDefaultInterRepository(dummy_a, dummy_b)
410412
411 def assertGetsDefaultInterRepository(self, repo_a, repo_b):413 def assertGetsDefaultInterRepository(self, repo_a, repo_b):
@@ -585,54 +587,6 @@
585 # versions of the file.587 # versions of the file.
586 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])588 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
587589
588 def test_fetch_combines_groups(self):
589 builder = self.make_branch_builder('source', format='2a')
590 builder.start_series()
591 builder.build_snapshot(None, [
592 ('add', ('', b'root-id', 'directory', '')),
593 ('add', ('file', b'file-id', 'file', b'content\n'))],
594 revision_id=b'1')
595 builder.build_snapshot([b'1'], [
596 ('modify', ('file', b'content-2\n'))],
597 revision_id=b'2')
598 builder.finish_series()
599 source = builder.get_branch()
600 target = self.make_repository('target', format='2a')
601 target.fetch(source.repository)
602 target.lock_read()
603 self.addCleanup(target.unlock)
604 details = target.texts._index.get_build_details(
605 [(b'file-id', b'1',), (b'file-id', b'2',)])
606 file_1_details = details[(b'file-id', b'1')]
607 file_2_details = details[(b'file-id', b'2')]
608 # The index, and what to read off disk, should be the same for both
609 # versions of the file.
610 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
611
612 def test_fetch_combines_groups(self):
613 builder = self.make_branch_builder('source', format='2a')
614 builder.start_series()
615 builder.build_snapshot(None, [
616 ('add', ('', b'root-id', 'directory', '')),
617 ('add', ('file', b'file-id', 'file', b'content\n'))],
618 revision_id=b'1')
619 builder.build_snapshot([b'1'], [
620 ('modify', ('file', b'content-2\n'))],
621 revision_id=b'2')
622 builder.finish_series()
623 source = builder.get_branch()
624 target = self.make_repository('target', format='2a')
625 target.fetch(source.repository)
626 target.lock_read()
627 self.addCleanup(target.unlock)
628 details = target.texts._index.get_build_details(
629 [(b'file-id', b'1',), (b'file-id', b'2',)])
630 file_1_details = details[(b'file-id', b'1')]
631 file_2_details = details[(b'file-id', b'2')]
632 # The index, and what to read off disk, should be the same for both
633 # versions of the file.
634 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
635
636 def test_format_pack_compresses_True(self):590 def test_format_pack_compresses_True(self):
637 repo = self.make_repository('repo', format='2a')591 repo = self.make_repository('repo', format='2a')
638 self.assertTrue(repo._format.pack_compresses)592 self.assertTrue(repo._format.pack_compresses)
639593
=== modified file 'breezy/bzr/tests/test_smart_transport.py'
--- breezy/bzr/tests/test_smart_transport.py 2022-08-22 18:19:46 +0000
+++ breezy/bzr/tests/test_smart_transport.py 2022-10-29 02:25:56 +0000
@@ -26,6 +26,7 @@
26import sys26import sys
27import threading27import threading
28import time28import time
29from typing import Type, Optional
2930
30from testtools.matchers import DocTestMatches31from testtools.matchers import DocTestMatches
3132
@@ -1936,10 +1937,10 @@
1936 Subclasses can override client_protocol_class and server_protocol_class.1937 Subclasses can override client_protocol_class and server_protocol_class.
1937 """1938 """
19381939
1939 request_encoder = None1940 request_encoder: object
1940 response_decoder = None1941 response_decoder: Type[protocol._StatefulDecoder]
1941 server_protocol_class = None1942 server_protocol_class: Type[protocol.SmartProtocolBase]
1942 client_protocol_class = None1943 client_protocol_class: Optional[Type[protocol.SmartProtocolBase]] = None
19431944
1944 def make_client_protocol_and_output(self, input_bytes=None):1945 def make_client_protocol_and_output(self, input_bytes=None):
1945 """1946 """
@@ -2785,7 +2786,7 @@
2785 # method. So we make server_protocol_class be a static method, rather than2786 # method. So we make server_protocol_class be a static method, rather than
2786 # simply doing:2787 # simply doing:
2787 # "server_protocol_class = protocol.build_server_protocol_three".2788 # "server_protocol_class = protocol.build_server_protocol_three".
2788 server_protocol_class = staticmethod(protocol.build_server_protocol_three)2789 server_protocol_class = staticmethod(protocol.build_server_protocol_three) # type: ignore
27892790
2790 def setUp(self):2791 def setUp(self):
2791 super(TestVersionOneFeaturesInProtocolThree, self).setUp()2792 super(TestVersionOneFeaturesInProtocolThree, self).setUp()
@@ -2835,7 +2836,7 @@
28352836
2836 request_encoder = protocol.ProtocolThreeRequester2837 request_encoder = protocol.ProtocolThreeRequester
2837 response_decoder = protocol.ProtocolThreeDecoder2838 response_decoder = protocol.ProtocolThreeDecoder
2838 server_protocol_class = protocol.ProtocolThreeDecoder2839 server_protocol_class = protocol.ProtocolThreeDecoder # type: ignore
28392840
2840 def test_trivial_request(self):2841 def test_trivial_request(self):
2841 """Smoke test for the simplest possible v3 request: empty headers, no2842 """Smoke test for the simplest possible v3 request: empty headers, no
@@ -3207,7 +3208,7 @@
32073208
3208 request_encoder = protocol.ProtocolThreeRequester3209 request_encoder = protocol.ProtocolThreeRequester
3209 response_decoder = protocol.ProtocolThreeDecoder3210 response_decoder = protocol.ProtocolThreeDecoder
3210 server_protocol_class = protocol.ProtocolThreeDecoder3211 server_protocol_class = protocol.ProtocolThreeDecoder # type: ignore
32113212
3212 def make_client_encoder_and_output(self):3213 def make_client_encoder_and_output(self):
3213 result = self.make_client_protocol_and_output()3214 result = self.make_client_protocol_and_output()
32143215
=== modified file 'breezy/bzr/versionedfile.py'
--- breezy/bzr/versionedfile.py 2022-09-08 14:15:34 +0000
+++ breezy/bzr/versionedfile.py 2022-10-29 02:25:56 +0000
@@ -39,7 +39,6 @@
39 )39 )
40from breezy.bzr import (40from breezy.bzr import (
41 groupcompress,41 groupcompress,
42 index,
43 knit,42 knit,
44 )43 )
45""")44""")
@@ -50,6 +49,10 @@
50from ..registry import Registry49from ..registry import Registry
51from ..textmerge import TextMerge50from ..textmerge import TextMerge
5251
52from . import (
53 index,
54 )
55
5356
54adapter_registry = Registry()57adapter_registry = Registry()
55adapter_registry.register_lazy(('knit-annotated-delta-gz', 'knit-delta-gz'),58adapter_registry.register_lazy(('knit-annotated-delta-gz', 'knit-delta-gz'),
5659
=== modified file 'breezy/bzr/workingtree.py'
--- breezy/bzr/workingtree.py 2022-08-22 18:19:46 +0000
+++ breezy/bzr/workingtree.py 2022-10-29 02:25:56 +0000
@@ -32,10 +32,7 @@
3232
33from bisect import bisect_left33from bisect import bisect_left
34import breezy34import breezy
35try:35from collections import deque
36 from collections.abc import deque
37except ImportError: # python < 3.7
38 from collections import deque
39import errno36import errno
40from io import BytesIO37from io import BytesIO
41import itertools38import itertools
@@ -57,7 +54,6 @@
57 globbing,54 globbing,
58 ignores,55 ignores,
59 merge,56 merge,
60 revision as _mod_revision,
61 )57 )
62from breezy.bzr import (58from breezy.bzr import (
63 conflicts as _mod_bzr_conflicts,59 conflicts as _mod_bzr_conflicts,
@@ -73,6 +69,7 @@
73from .. import (69from .. import (
74 errors,70 errors,
75 osutils,71 osutils,
72 revision as _mod_revision,
76 transport as _mod_transport,73 transport as _mod_transport,
77 )74 )
78from ..controldir import ControlDir75from ..controldir import ControlDir
@@ -767,6 +764,40 @@
767 raise _mod_transport.NoSuchFile(path)764 raise _mod_transport.NoSuchFile(path)
768 raise765 raise
769766
767 def path_content_summary(self, path, _lstat=os.lstat,
768 _mapper=osutils.file_kind_from_stat_mode):
769 """See Tree.path_content_summary."""
770 abspath = self.abspath(path)
771 try:
772 stat_result = _lstat(abspath)
773 except OSError as e:
774 if getattr(e, 'errno', None) == errno.ENOENT:
775 # no file.
776 return ('missing', None, None, None)
777 # propagate other errors
778 raise
779 kind = _mapper(stat_result.st_mode)
780 if kind == 'file':
781 return self._file_content_summary(path, stat_result)
782 elif kind == 'directory':
783 # perhaps it looks like a plain directory, but it's really a
784 # reference.
785 if self._directory_is_tree_reference(path):
786 kind = 'tree-reference'
787 return kind, None, None, None
788 elif kind == 'symlink':
789 target = osutils.readlink(abspath)
790 return ('symlink', None, None, target)
791 else:
792 return (kind, None, None, None)
793
794 def _file_content_summary(self, path, stat_result):
795 size = stat_result.st_size
796 executable = self._is_executable_from_path_and_stat(path, stat_result)
797 # try for a stat cache lookup
798 return ('file', size, executable, self._sha_from_stat(
799 path, stat_result))
800
770 def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):801 def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):
771 try:802 try:
772 return self._path2ie(path).executable803 return self._path2ie(path).executable
773804
=== modified file 'breezy/bzr/workingtree_4.py'
--- breezy/bzr/workingtree_4.py 2022-08-22 18:19:46 +0000
+++ breezy/bzr/workingtree_4.py 2022-10-29 02:25:56 +0000
@@ -38,13 +38,11 @@
38 debug,38 debug,
39 filters as _mod_filters,39 filters as _mod_filters,
40 osutils,40 osutils,
41 revision as _mod_revision,
42 revisiontree,41 revisiontree,
43 trace,42 trace,
44 views,43 views,
45 )44 )
46from breezy.bzr import (45from breezy.bzr import (
47 dirstate,
48 generate_ids,46 generate_ids,
49 transform as bzr_transform,47 transform as bzr_transform,
50 )48 )
@@ -52,8 +50,8 @@
5250
53from .. import (51from .. import (
54 errors,52 errors,
53 revision as _mod_revision,
55 )54 )
56from .inventory import Inventory, ROOT_ID, entry_factory
57from ..lock import LogicalLockResult55from ..lock import LogicalLockResult
58from ..lockable_files import LockableFiles56from ..lockable_files import LockableFiles
59from ..lockdir import LockDir57from ..lockdir import LockDir
@@ -83,10 +81,12 @@
83from ..workingtree import (81from ..workingtree import (
84 WorkingTree,82 WorkingTree,
85 )83 )
84from .inventory import Inventory, ROOT_ID, entry_factory
86from .workingtree import (85from .workingtree import (
87 InventoryWorkingTree,86 InventoryWorkingTree,
88 WorkingTreeFormatMetaDir,87 WorkingTreeFormatMetaDir,
89 )88 )
89from . import dirstate
9090
9191
92class DirStateWorkingTree(InventoryWorkingTree):92class DirStateWorkingTree(InventoryWorkingTree):
@@ -453,7 +453,7 @@
453 return self._inventory453 return self._inventory
454454
455 root_inventory = property(_get_root_inventory,455 root_inventory = property(_get_root_inventory,
456 "Root inventory of this tree")456 doc="Root inventory of this tree")
457457
458 def get_parent_ids(self):458 def get_parent_ids(self):
459 """See Tree.get_parent_ids.459 """See Tree.get_parent_ids.
460460
=== modified file 'breezy/bzr/xml8.py'
--- breezy/bzr/xml8.py 2021-11-13 12:44:39 +0000
+++ breezy/bzr/xml8.py 2022-10-29 02:25:56 +0000
@@ -14,7 +14,7 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from io import BytesIO17from typing import List, Optional
1818
19from .. import (19from .. import (
20 lazy_regex,20 lazy_regex,
@@ -69,16 +69,16 @@
69 Its revision format number matches its inventory number.69 Its revision format number matches its inventory number.
70 """70 """
7171
72 __slots__ = []72 __slots__: List[str] = []
7373
74 root_id = None74 root_id: Optional[bytes] = None
75 support_altered_by_hack = True75 support_altered_by_hack = True
76 # This format supports the altered-by hack that reads file ids directly out76 # This format supports the altered-by hack that reads file ids directly out
77 # of the versionedfile, without doing XML parsing.77 # of the versionedfile, without doing XML parsing.
7878
79 supported_kinds = {'file', 'directory', 'symlink'}79 supported_kinds = {'file', 'directory', 'symlink'}
80 format_num = b'8'80 format_num = b'8'
81 revision_format_num = None81 revision_format_num: Optional[bytes] = None
8282
83 # The search regex used by xml based repositories to determine what things83 # The search regex used by xml based repositories to determine what things
84 # where changed in a single commit.84 # where changed in a single commit.
8585
=== modified file 'breezy/bzr/xml_serializer.py'
--- breezy/bzr/xml_serializer.py 2022-01-21 17:19:24 +0000
+++ breezy/bzr/xml_serializer.py 2022-10-29 02:25:56 +0000
@@ -23,24 +23,12 @@
23# ElementTree bits23# ElementTree bits
2424
25import re25import re
2626from typing import Dict, Union
27try:27
28 import xml.etree.cElementTree as elementtree28from xml.etree.ElementTree import (
29 from xml.etree.ElementTree import ParseError29 ElementTree, SubElement, Element,
30except ImportError:30 fromstringlist, tostringlist, tostring,
31 # Fall back to pure python implementation if C extension is unavailable31 fromstring, ParseError)
32 import xml.etree.ElementTree as elementtree
33 try:
34 from xml.etree.ElementTree import ParseError
35 except ImportError:
36 from xml.parsers.expat import ExpatError as ParseError
37
38(ElementTree, SubElement, Element, fromstringlist, tostringlist, tostring,
39 fromstring) = (
40 elementtree.ElementTree, elementtree.SubElement, elementtree.Element,
41 elementtree.fromstringlist, elementtree.tostringlist, elementtree.tostring,
42 elementtree.fromstring)
43
4432
45from .. import (33from .. import (
46 errors,34 errors,
@@ -193,7 +181,7 @@
193 for uni_chr in match.group().decode('utf8'))181 for uni_chr in match.group().decode('utf8'))
194182
195183
196_to_escaped_map = {}184_to_escaped_map: Dict[Union[bytes, str], str] = {}
197185
198186
199def encode_and_escape(unicode_or_utf8_str, _map=_to_escaped_map):187def encode_and_escape(unicode_or_utf8_str, _map=_to_escaped_map):
200188
=== modified file 'breezy/cache_utf8.py'
--- breezy/cache_utf8.py 2022-10-08 17:38:06 +0000
+++ breezy/cache_utf8.py 2022-10-29 02:25:56 +0000
@@ -19,12 +19,12 @@
1919
20"""Some functions to enable caching the conversion between unicode to utf8"""20"""Some functions to enable caching the conversion between unicode to utf8"""
2121
22import codecs22from codecs import (
23 utf_8_encode as _utf8_encode,
24 utf_8_decode as _utf8_decode,
25)
23from typing import Dict26from typing import Dict
2427
25_utf8_encode = codecs.utf_8_encode
26_utf8_decode = codecs.utf_8_decode
27
2828
29def _utf8_decode_with_None(bytestring, _utf8_decode=_utf8_decode):29def _utf8_decode_with_None(bytestring, _utf8_decode=_utf8_decode):
30 """wrap _utf8_decode to support None->None for optional strings.30 """wrap _utf8_decode to support None->None for optional strings.
3131
=== modified file 'breezy/commands.py'
--- breezy/commands.py 2022-10-08 17:38:06 +0000
+++ breezy/commands.py 2022-10-29 02:25:56 +0000
@@ -280,7 +280,7 @@
280280
281281
282def get_cmd_object(282def get_cmd_object(
283 cmd_name: str, plugins_override: bool = True) -> Type["Command"]:283 cmd_name: str, plugins_override: bool = True) -> "Command":
284 """Return the command object for a command.284 """Return the command object for a command.
285285
286 plugins_override286 plugins_override
@@ -299,7 +299,9 @@
299 % cmd_name)299 % cmd_name)
300300
301301
302def _get_cmd_object(cmd_name, plugins_override=True, check_missing=True):302def _get_cmd_object(
303 cmd_name: str, plugins_override: bool = True,
304 check_missing: bool = True) -> "Command":
303 """Get a command object.305 """Get a command object.
304306
305 :param cmd_name: The name of the command.307 :param cmd_name: The name of the command.
@@ -313,7 +315,7 @@
313 # in a Unicode name. In that case, they should just get a315 # in a Unicode name. In that case, they should just get a
314 # 'command not found' error later.316 # 'command not found' error later.
315 # In the future, we may actually support Unicode command names.317 # In the future, we may actually support Unicode command names.
316 cmd = None318 cmd: Optional[Command] = None
317 # Get a command319 # Get a command
318 for hook in Command.hooks['get_command']:320 for hook in Command.hooks['get_command']:
319 cmd = hook(cmd, cmd_name)321 cmd = hook(cmd, cmd_name)
@@ -471,8 +473,9 @@
471 encoding_type: str = 'strict'473 encoding_type: str = 'strict'
472 invoked_as: Optional[str] = None474 invoked_as: Optional[str] = None
473 l10n: bool = True475 l10n: bool = True
476 _see_also: List[str]
474477
475 hidden = False478 hidden: bool = False
476479
477 hooks: Hooks480 hooks: Hooks
478481
@@ -781,7 +784,7 @@
781 hook(self)784 hook(self)
782 self.run = run785 self.run = run
783786
784 def run(self):787 def run(self): # type: ignore
785 """Actually run the command.788 """Actually run the command.
786789
787 This is invoked with the options and arguments bound to790 This is invoked with the options and arguments bound to
@@ -882,7 +885,7 @@
882 "object.", (2, 6))885 "object.", (2, 6))
883886
884887
885Command.hooks = CommandHooks()888Command.hooks = CommandHooks() # type: ignore
886889
887890
888def parse_args(command, argv, alias_argv=None):891def parse_args(command, argv, alias_argv=None):
889892
=== modified file 'breezy/config.py'
--- breezy/config.py 2022-09-01 19:17:39 +0000
+++ breezy/config.py 2022-10-29 02:25:56 +0000
@@ -82,7 +82,7 @@
82import configobj82import configobj
83from io import BytesIO83from io import BytesIO
8484
85from typing import Tuple, Iterable85from typing import Tuple, Iterable, Dict
8686
87import breezy87import breezy
88from .lazy_import import lazy_import88from .lazy_import import lazy_import
@@ -3035,7 +3035,7 @@
3035 for hook in ConfigHooks['save']:3035 for hook in ConfigHooks['save']:
3036 hook(self)3036 hook(self)
30373037
3038 def get_sections(self) -> Iterable[Tuple[Store, str]]:3038 def get_sections(self) -> Iterable[Tuple[Store, Section]]:
3039 """Get the configobj section in the file order.3039 """Get the configobj section in the file order.
30403040
3041 Returns: An iterable of (store, section).3041 Returns: An iterable of (store, section).
@@ -3433,7 +3433,7 @@
34333433
3434# FIXME: _shared_stores should be an attribute of a library state once a3434# FIXME: _shared_stores should be an attribute of a library state once a
3435# library_state object is always available.3435# library_state object is always available.
3436_shared_stores = {}3436_shared_stores: Dict[str, Store] = {}
3437_shared_stores_at_exit_installed = False3437_shared_stores_at_exit_installed = False
34383438
34393439
34403440
=== modified file 'breezy/controldir.py'
--- breezy/controldir.py 2022-10-08 17:38:06 +0000
+++ breezy/controldir.py 2022-10-29 02:25:56 +0000
@@ -24,6 +24,8 @@
2424
25"""25"""
2626
27from typing import List, Type, Optional
28
27from .lazy_import import lazy_import29from .lazy_import import lazy_import
28lazy_import(globals(), """30lazy_import(globals(), """
29import textwrap31import textwrap
@@ -950,7 +952,7 @@
950952
951953
952# install the default hooks954# install the default hooks
953ControlDir.hooks = ControlDirHooks()955ControlDir.hooks = ControlDirHooks() # type: ignore
954956
955957
956class ControlComponentFormat(object):958class ControlComponentFormat(object):
@@ -1101,10 +1103,10 @@
1101 working tree.1103 working tree.
1102 """1104 """
11031105
1104 _default_format = None1106 _default_format: Optional["ControlDirFormat"] = None
1105 """The default format used for new control directories."""1107 """The default format used for new control directories."""
11061108
1107 _probers = []1109 _probers: List[Type["Prober"]] = []
1108 """The registered format probers, e.g. BzrProber.1110 """The registered format probers, e.g. BzrProber.
11091111
1110 This is a list of Prober-derived classes.1112 This is a list of Prober-derived classes.
11111113
=== modified file 'breezy/diff.py'
--- breezy/diff.py 2022-10-08 17:38:06 +0000
+++ breezy/diff.py 2022-10-29 02:25:56 +0000
@@ -775,6 +775,7 @@
775 def __init__(self, command_template: Union[str, List[str]],775 def __init__(self, command_template: Union[str, List[str]],
776 old_tree: Tree, new_tree: Tree, to_file,776 old_tree: Tree, new_tree: Tree, to_file,
777 path_encoding='utf-8'):777 path_encoding='utf-8'):
778 import tempfile
778 DiffPath.__init__(self, old_tree, new_tree, to_file, path_encoding)779 DiffPath.__init__(self, old_tree, new_tree, to_file, path_encoding)
779 self.command_template = command_template780 self.command_template = command_template
780 import tempfile781 import tempfile
781782
=== modified file 'breezy/doc_generate/conf.py'
--- breezy/doc_generate/conf.py 2020-02-18 01:57:45 +0000
+++ breezy/doc_generate/conf.py 2022-10-29 02:25:56 +0000
@@ -1,4 +1,7 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
2
3from typing import Dict, Any, List
4
2#5#
3# Bazaar documentation build configuration file, created by6# Bazaar documentation build configuration file, created by
4# sphinx-quickstart on Tue Jul 21 17:04:52 2009.7# sphinx-quickstart on Tue Jul 21 17:04:52 2009.
@@ -100,7 +103,7 @@
100# Theme options are theme-specific and customize the look and feel of a theme103# Theme options are theme-specific and customize the look and feel of a theme
101# further. For a list of options available for each theme, see the104# further. For a list of options available for each theme, see the
102# documentation.105# documentation.
103html_theme_options = {106html_theme_options: Dict[str, Any] = {
104 # Unfortunately, the right sidebar breaks under IE6 and maybe IE7.107 # Unfortunately, the right sidebar breaks under IE6 and maybe IE7.
105 # So we stick with the default left placement to cater for users stuck108 # So we stick with the default left placement to cater for users stuck
106 # on those browsers.109 # on those browsers.
@@ -196,7 +199,7 @@
196199
197# Grouping the document tree into LaTeX files. List of tuples200# Grouping the document tree into LaTeX files. List of tuples
198# (source start file, target name, title, author, documentclass [howto/manual]).201# (source start file, target name, title, author, documentclass [howto/manual]).
199latex_documents = []202latex_documents: List[Any] = []
200203
201# The name of an image file (relative to this directory) to place at the top of204# The name of an image file (relative to this directory) to place at the top of
202# the title page.205# the title page.
203206
=== modified file 'breezy/errors.py'
--- breezy/errors.py 2022-10-26 23:33:43 +0000
+++ breezy/errors.py 2022-10-29 02:25:56 +0000
@@ -883,6 +883,8 @@
883883
884class NoSuchRevision(InternalBzrError):884class NoSuchRevision(InternalBzrError):
885885
886 revision: bytes
887
886 _fmt = "%(branch)s has no revision %(revision)s"888 _fmt = "%(branch)s has no revision %(revision)s"
887889
888 def __init__(self, branch, revision):890 def __init__(self, branch, revision):
889891
=== modified file 'breezy/filters/__init__.py'
--- breezy/filters/__init__.py 2022-07-02 13:44:01 +0000
+++ breezy/filters/__init__.py 2022-10-29 02:25:56 +0000
@@ -43,6 +43,8 @@
43 BytesIO,43 BytesIO,
44 )44 )
4545
46from typing import List, Tuple, Dict
47
46from .. import (48from .. import (
47 errors,49 errors,
48 osutils,50 osutils,
@@ -65,6 +67,10 @@
65 return "reader: %s, writer: %s" % (self.reader, self.writer)67 return "reader: %s, writer: %s" % (self.reader, self.writer)
6668
6769
70Preferences = List[Tuple[str, str]]
71Stack = List[ContentFilter]
72
73
68class ContentFilterContext(object):74class ContentFilterContext(object):
69 """Object providing information that filters can use."""75 """Object providing information that filters can use."""
7076
@@ -168,7 +174,7 @@
168174
169# Cache of preferences -> stack175# Cache of preferences -> stack
170# TODO: make this per branch (say) rather than global176# TODO: make this per branch (say) rather than global
171_stack_cache = {}177_stack_cache: Dict[Preferences, Stack] = {}
172178
173179
174def _get_registered_names():180def _get_registered_names():
@@ -178,7 +184,7 @@
178 return filter_stacks_registry.keys()184 return filter_stacks_registry.keys()
179185
180186
181def _get_filter_stack_for(preferences):187def _get_filter_stack_for(preferences: Preferences) -> Stack:
182 """Get the filter stack given a sequence of preferences.188 """Get the filter stack given a sequence of preferences.
183189
184 :param preferences: a sequence of (name,value) tuples where190 :param preferences: a sequence of (name,value) tuples where
185191
=== modified file 'breezy/foreign.py'
--- breezy/foreign.py 2020-02-18 01:57:45 +0000
+++ breezy/foreign.py 2022-10-29 02:25:56 +0000
@@ -39,7 +39,7 @@
3939
40 # Prefix used when importing revisions native to the foreign VCS (as40 # Prefix used when importing revisions native to the foreign VCS (as
41 # opposed to roundtripping bzr-native revisions) using this mapping.41 # opposed to roundtripping bzr-native revisions) using this mapping.
42 revid_prefix = None42 revid_prefix: bytes
4343
44 def __init__(self, vcs):44 def __init__(self, vcs):
45 """Create a new VcsMapping.45 """Create a new VcsMapping.
@@ -191,7 +191,7 @@
191 """191 """
192192
193 # This repository's native version control system193 # This repository's native version control system
194 vcs = None194 vcs: ForeignVcs
195195
196 def has_foreign_revision(self, foreign_revid):196 def has_foreign_revision(self, foreign_revid):
197 """Check whether the specified foreign revision is present.197 """Check whether the specified foreign revision is present.
198198
=== modified file 'breezy/forge.py'
--- breezy/forge.py 2022-10-26 13:38:16 +0000
+++ breezy/forge.py 2022-10-29 02:25:56 +0000
@@ -274,9 +274,9 @@
274274
275 # Does this forge support arbitrary labels being attached to merge275 # Does this forge support arbitrary labels being attached to merge
276 # proposals?276 # proposals?
277 supports_merge_proposal_labels = None277 supports_merge_proposal_labels: bool
278278
279 supports_merge_proposal_title = None279 supports_merge_proposal_title: bool
280280
281 @property281 @property
282 def name(self):282 def name(self):
@@ -285,18 +285,18 @@
285285
286 # Does this forge support suggesting a commit message in the286 # Does this forge support suggesting a commit message in the
287 # merge proposal?287 # merge proposal?
288 supports_merge_proposal_commit_message = None288 supports_merge_proposal_commit_message: bool
289289
290 # The base_url that would be visible to users. I.e. https://github.com/290 # The base_url that would be visible to users. I.e. https://github.com/
291 # rather than https://api.github.com/291 # rather than https://api.github.com/
292 base_url = None292 base_url: str
293293
294 # The syntax to use for formatting merge proposal descriptions.294 # The syntax to use for formatting merge proposal descriptions.
295 # Common values: 'plain', 'markdown'295 # Common values: 'plain', 'markdown'
296 merge_proposal_description_format = None296 merge_proposal_description_format: str
297297
298 # Does this forge support the allow_collaboration flag?298 # Does this forge support the allow_collaboration flag?
299 supports_allow_collaboration = False299 supports_allow_collaboration: bool = False
300300
301 def publish_derived(self, new_branch, base_branch, name, project=None,301 def publish_derived(self, new_branch, base_branch, name, project=None,
302 owner=None, revision_id=None, overwrite=False,302 owner=None, revision_id=None, overwrite=False,
303303
=== modified file 'breezy/git/__init__.py'
--- breezy/git/__init__.py 2022-07-07 12:12:59 +0000
+++ breezy/git/__init__.py 2022-10-29 02:25:56 +0000
@@ -288,11 +288,7 @@
288288
289289
290def rewrite_instead_of(location, purpose):290def rewrite_instead_of(location, purpose):
291 try:291 from dulwich.config import apply_instead_of, StackedConfig
292 from dulwich.config import apply_instead_of, StackedConfig
293 except ImportError:
294 # Version of dulwich too old (<< 0.20.44)
295 return location
296292
297 config = StackedConfig.default()293 config = StackedConfig.default()
298294
299295
=== modified file 'breezy/git/branch.py'
--- breezy/git/branch.py 2022-08-28 18:54:11 +0000
+++ breezy/git/branch.py 2022-10-29 02:25:56 +0000
@@ -21,6 +21,7 @@
21import contextlib21import contextlib
22from io import BytesIO22from io import BytesIO
23from collections import defaultdict23from collections import defaultdict
24from typing import Dict
2425
25from dulwich.config import (26from dulwich.config import (
26 ConfigFile as GitConfigFile,27 ConfigFile as GitConfigFile,
@@ -465,7 +466,7 @@
465 self._user_transport = controldir.user_transport.clone('.')466 self._user_transport = controldir.user_transport.clone('.')
466 self._control_transport = controldir.control_transport.clone('.')467 self._control_transport = controldir.control_transport.clone('.')
467 self._tag_refs = None468 self._tag_refs = None
468 params = {}469 params: Dict[str, str] = {}
469 try:470 try:
470 self.name = ref_to_branch_name(ref)471 self.name = ref_to_branch_name(ref)
471 except ValueError:472 except ValueError:
472473
=== modified file 'breezy/git/dir.py'
--- breezy/git/dir.py 2022-08-22 18:19:46 +0000
+++ breezy/git/dir.py 2022-10-29 02:25:56 +0000
@@ -20,10 +20,7 @@
20import contextlib20import contextlib
21import os21import os
2222
23try:23from dulwich.refs import SymrefLoop
24 from dulwich.refs import SymrefLoop
25except ImportError:
26 SymrefLoop = KeyError
2724
28from .. import (25from .. import (
29 branch as _mod_branch,26 branch as _mod_branch,
3027
=== modified file 'breezy/git/remote.py'
--- breezy/git/remote.py 2022-09-14 19:01:01 +0000
+++ breezy/git/remote.py 2022-10-29 02:25:56 +0000
@@ -19,10 +19,7 @@
19import gzip19import gzip
20import re20import re
2121
22try:22from dulwich.refs import SymrefLoop
23 from dulwich.refs import SymrefLoop
24except ImportError:
25 SymrefLoop = KeyError
2623
27from .. import (24from .. import (
28 config,25 config,
@@ -125,7 +122,6 @@
125import select122import select
126123
127import urllib.parse as urlparse124import urllib.parse as urlparse
128from urllib.parse import splituser
129125
130# urlparse only supports a limited number of schemes by default126# urlparse only supports a limited number of schemes by default
131register_urlparse_netloc_protocol('git')127register_urlparse_netloc_protocol('git')
132128
=== modified file 'breezy/git/repository.py'
--- breezy/git/repository.py 2022-01-24 20:22:05 +0000
+++ breezy/git/repository.py 2022-10-29 02:25:56 +0000
@@ -115,7 +115,6 @@
115class GitRepository(ForeignRepository):115class GitRepository(ForeignRepository):
116 """An adapter to git repositories for bzr."""116 """An adapter to git repositories for bzr."""
117117
118 _serializer = None
119 vcs = foreign_vcs_git118 vcs = foreign_vcs_git
120 chk_bytes = None119 chk_bytes = None
121120
@@ -583,6 +582,8 @@
583 supports_custom_revision_properties = False582 supports_custom_revision_properties = False
584 records_per_file_revision = False583 records_per_file_revision = False
585 supports_multiple_authors = False584 supports_multiple_authors = False
585 supports_ghosts = False
586 supports_chks = False
586587
587 @property588 @property
588 def _matchingcontroldir(self):589 def _matchingcontroldir(self):
589590
=== modified file 'breezy/git/tests/test_remote.py'
--- breezy/git/tests/test_remote.py 2022-09-14 13:52:36 +0000
+++ breezy/git/tests/test_remote.py 2022-10-29 02:25:56 +0000
@@ -308,7 +308,7 @@
308308
309 _test_needs_features = [ExecutableFeature('git')]309 _test_needs_features = [ExecutableFeature('git')]
310310
311 _to_format = None311 _to_format: str
312312
313 def setUp(self):313 def setUp(self):
314 TestCaseWithTransport.setUp(self)314 TestCaseWithTransport.setUp(self)
@@ -495,7 +495,7 @@
495495
496 _test_needs_features = [ExecutableFeature('git')]496 _test_needs_features = [ExecutableFeature('git')]
497497
498 _from_format = None498 _from_format: str
499499
500 def setUp(self):500 def setUp(self):
501 TestCaseWithTransport.setUp(self)501 TestCaseWithTransport.setUp(self)
502502
=== modified file 'breezy/git/transportgit.py'
--- breezy/git/transportgit.py 2022-10-27 22:36:11 +0000
+++ breezy/git/transportgit.py 2022-10-29 02:25:56 +0000
@@ -51,10 +51,7 @@
51 compute_file_sha,51 compute_file_sha,
52 write_pack_object,52 write_pack_object,
53 )53 )
54try:54from dulwich.refs import SymrefLoop
55 from dulwich.refs import SymrefLoop
56except ImportError: # dulwich < 0.20.46
57 SymrefLoop = KeyError
58from dulwich.repo import (55from dulwich.repo import (
59 BaseRepo,56 BaseRepo,
60 InfoRefsContainer,57 InfoRefsContainer,
6158
=== modified file 'breezy/git/tree.py'
--- breezy/git/tree.py 2022-10-28 17:55:39 +0000
+++ breezy/git/tree.py 2022-10-29 02:25:56 +0000
@@ -1020,8 +1020,6 @@
1020class InterGitTrees(_mod_tree.InterTree):1020class InterGitTrees(_mod_tree.InterTree):
1021 """InterTree that works between two git trees."""1021 """InterTree that works between two git trees."""
10221022
1023 _matching_from_tree_format = None
1024 _matching_to_tree_format = None
1025 _test_mutable_trees_to_test_trees = None1023 _test_mutable_trees_to_test_trees = None
10261024
1027 def __init__(self, source, target):1025 def __init__(self, source, target):
@@ -1642,7 +1640,11 @@
1642 raise1640 raise
1643 kind = mode_kind(stat_result.st_mode)1641 kind = mode_kind(stat_result.st_mode)
1644 if kind == 'file':1642 if kind == 'file':
1645 return self._file_content_summary(path, stat_result)1643 size = stat_result.st_size
1644 executable = self._is_executable_from_path_and_stat(path, stat_result)
1645 # try for a stat cache lookup
1646 return ('file', size, executable, self._sha_from_stat(
1647 path, stat_result))
1646 elif kind == 'directory':1648 elif kind == 'directory':
1647 # perhaps it looks like a plain directory, but it's really a1649 # perhaps it looks like a plain directory, but it's really a
1648 # reference.1650 # reference.
16491651
=== modified file 'breezy/git/workingtree.py'
--- breezy/git/workingtree.py 2022-08-22 18:19:46 +0000
+++ breezy/git/workingtree.py 2022-10-29 02:25:56 +0000
@@ -1303,7 +1303,7 @@
1303 def _read_submodule_head(self, path):1303 def _read_submodule_head(self, path):
1304 return read_submodule_head(self.abspath(path))1304 return read_submodule_head(self.abspath(path))
13051305
1306 def get_reference_revision(self, path, branch=None):1306 def get_reference_revision(self, path):
1307 hexsha = self._read_submodule_head(path)1307 hexsha = self._read_submodule_head(path)
1308 if hexsha is None:1308 if hexsha is None:
1309 (index, subpath) = self._lookup_index(1309 (index, subpath) = self._lookup_index(
13101310
=== modified file 'breezy/graph.py'
--- breezy/graph.py 2020-02-18 01:57:45 +0000
+++ breezy/graph.py 2022-10-29 02:25:56 +0000
@@ -722,7 +722,7 @@
722 all_unique_searcher._iterations)722 all_unique_searcher._iterations)
723 unique_tip_searchers = next_unique_searchers723 unique_tip_searchers = next_unique_searchers
724724
725 def get_parent_map(self, revisions):725 def get_parent_map(self, revisions): # type: ignore
726 """Get a map of key:parent_list for revisions.726 """Get a map of key:parent_list for revisions.
727727
728 This implementation delegates to get_parents, for old parent_providers728 This implementation delegates to get_parents, for old parent_providers
729729
=== modified file 'breezy/hooks.py'
--- breezy/hooks.py 2022-07-09 20:29:40 +0000
+++ breezy/hooks.py 2022-10-29 02:25:56 +0000
@@ -18,6 +18,8 @@
1818
19"""Support for plugin hooking logic."""19"""Support for plugin hooking logic."""
2020
21from typing import Dict, Tuple, List
22
21from . import (23from . import (
22 errors,24 errors,
23 registry,25 registry,
@@ -436,7 +438,7 @@
436438
437# Lazily registered hooks. Maps (module, name, hook_name) tuples439# Lazily registered hooks. Maps (module, name, hook_name) tuples
438# to lists of tuples with objectgetters and names440# to lists of tuples with objectgetters and names
439_lazy_hooks = {}441_lazy_hooks: Dict[Tuple[str, str, str], List[Tuple[registry._ObjectGetter, str]]] = {}
440442
441443
442def install_lazy_named_hook(hookpoints_module, hookpoints_name, hook_name,444def install_lazy_named_hook(hookpoints_module, hookpoints_name, hook_name,
443445
=== modified file 'breezy/ignores.py'
--- breezy/ignores.py 2020-02-18 01:57:45 +0000
+++ breezy/ignores.py 2022-10-29 02:25:56 +0000
@@ -19,6 +19,7 @@
19import errno19import errno
20from io import BytesIO20from io import BytesIO
21import os21import os
22from typing import Set
2223
23import breezy24import breezy
24from .lazy_import import lazy_import25from .lazy_import import lazy_import
@@ -154,7 +155,7 @@
154 return to_add155 return to_add
155156
156157
157_runtime_ignores = set()158_runtime_ignores: Set[str] = set()
158159
159160
160def add_runtime_ignores(ignores):161def add_runtime_ignores(ignores):
161162
=== modified file 'breezy/lock.py'
--- breezy/lock.py 2022-05-15 14:17:32 +0000
+++ breezy/lock.py 2022-10-29 02:25:56 +0000
@@ -37,6 +37,7 @@
37import errno37import errno
38import os38import os
39import sys39import sys
40from typing import Dict, Set, List, Tuple, Type, Any
40import warnings41import warnings
4142
42from . import (43from . import (
@@ -184,7 +185,7 @@
184 raise NotImplementedError()185 raise NotImplementedError()
185186
186187
187_lock_classes = []188_lock_classes: List[Tuple[str, Any, Any]] = []
188189
189190
190if have_fcntl:191if have_fcntl:
@@ -197,7 +198,7 @@
197198
198 class _fcntl_WriteLock(_fcntl_FileLock):199 class _fcntl_WriteLock(_fcntl_FileLock):
199200
200 _open_locks = set()201 _open_locks: Set[str] = set()
201202
202 def __init__(self, filename):203 def __init__(self, filename):
203 super(_fcntl_WriteLock, self).__init__()204 super(_fcntl_WriteLock, self).__init__()
@@ -237,7 +238,7 @@
237238
238 class _fcntl_ReadLock(_fcntl_FileLock):239 class _fcntl_ReadLock(_fcntl_FileLock):
239240
240 _open_locks = {}241 _open_locks: Dict[str, int] = {}
241242
242 def __init__(self, filename):243 def __init__(self, filename):
243 super(_fcntl_ReadLock, self).__init__()244 super(_fcntl_ReadLock, self).__init__()
@@ -349,12 +350,13 @@
349350
350if have_ctypes_win32:351if have_ctypes_win32:
351 from ctypes.wintypes import DWORD, LPWSTR352 from ctypes.wintypes import DWORD, LPWSTR
353 import ctypes
352 LPSECURITY_ATTRIBUTES = ctypes.c_void_p # used as NULL no need to declare354 LPSECURITY_ATTRIBUTES = ctypes.c_void_p # used as NULL no need to declare
353 HANDLE = ctypes.c_int # rather than unsigned as in ctypes.wintypes355 HANDLE = ctypes.c_int # rather than unsigned as in ctypes.wintypes
354 _function_name = "CreateFileW"356 _function_name = "CreateFileW"
355357
356 # CreateFile <http://msdn.microsoft.com/en-us/library/aa363858.aspx>358 # CreateFile <http://msdn.microsoft.com/en-us/library/aa363858.aspx>
357 _CreateFile = ctypes.WINFUNCTYPE(359 _CreateFile = ctypes.WINFUNCTYPE( # type: ignore
358 HANDLE, # return value360 HANDLE, # return value
359 LPWSTR, # lpFileName361 LPWSTR, # lpFileName
360 DWORD, # dwDesiredAccess362 DWORD, # dwDesiredAccess
@@ -363,7 +365,7 @@
363 DWORD, # dwCreationDisposition365 DWORD, # dwCreationDisposition
364 DWORD, # dwFlagsAndAttributes366 DWORD, # dwFlagsAndAttributes
365 HANDLE # hTemplateFile367 HANDLE # hTemplateFile
366 )((_function_name, ctypes.windll.kernel32))368 )((_function_name, ctypes.windll.kernel32)) # type: ignore
367369
368 INVALID_HANDLE_VALUE = -1370 INVALID_HANDLE_VALUE = -1
369371
370372
=== modified file 'breezy/lsprof.py'
--- breezy/lsprof.py 2020-02-18 01:57:45 +0000
+++ breezy/lsprof.py 2022-10-29 02:25:56 +0000
@@ -4,15 +4,13 @@
4# instead of just the Stats object4# instead of just the Stats object
55
6import codecs6import codecs
7try:7import pickle
8 import cPickle as pickle
9except ImportError:
10 import pickle
11import operator8import operator
12import os9import os
13import sys10import sys
14import _thread11import _thread
15import threading12import threading
13from typing import Dict
16from _lsprof import Profiler, profiler_entry14from _lsprof import Profiler, profiler_entry
1715
18from . import errors16from . import errors
@@ -291,7 +289,7 @@
291 out_file.write('%d %d\n' % (lineno, totaltime))289 out_file.write('%d %d\n' % (lineno, totaltime))
292290
293291
294_fn2mod = {}292_fn2mod: Dict[str, object] = {}
295293
296294
297def label(code, calltree=False):295def label(code, calltree=False):
298296
=== modified file 'breezy/merge.py'
--- breezy/merge.py 2022-09-22 23:36:26 +0000
+++ breezy/merge.py 2022-10-29 02:25:56 +0000
@@ -167,7 +167,7 @@
167 is present.167 is present.
168 """168 """
169169
170 name_prefix = None170 name_prefix: str
171 default_files = None171 default_files = None
172172
173 def __init__(self, merger):173 def __init__(self, merger):
174174
=== modified file 'breezy/merge_directive.py'
--- breezy/merge_directive.py 2022-10-08 17:38:06 +0000
+++ breezy/merge_directive.py 2022-10-29 02:25:56 +0000
@@ -26,7 +26,6 @@
26 diff,26 diff,
27 email_message,27 email_message,
28 gpg,28 gpg,
29 hooks,
30 revision as _mod_revision,29 revision as _mod_revision,
31 timestamp,30 timestamp,
32 trace,31 trace,
@@ -41,6 +40,7 @@
41""")40""")
42from . import (41from . import (
43 errors,42 errors,
43 hooks,
44 registry,44 registry,
45 )45 )
4646
4747
=== modified file 'breezy/mutabletree.py'
--- breezy/mutabletree.py 2022-07-04 16:45:36 +0000
+++ breezy/mutabletree.py 2022-10-29 02:25:56 +0000
@@ -356,7 +356,7 @@
356356
357357
358# install the default hooks into the MutableTree class.358# install the default hooks into the MutableTree class.
359MutableTree.hooks = MutableTreeHooks()359MutableTree.hooks = MutableTreeHooks() # type: ignore
360360
361361
362class PostCommitHookParams(object):362class PostCommitHookParams(object):
363363
=== modified file 'breezy/option.py'
--- breezy/option.py 2020-06-23 01:02:30 +0000
+++ breezy/option.py 2022-10-29 02:25:56 +0000
@@ -19,6 +19,7 @@
1919
20import optparse20import optparse
21import re21import re
22from typing import Dict
2223
23from . import (24from . import (
24 errors,25 errors,
@@ -141,12 +142,12 @@
141 """142 """
142143
143 # The dictionary of standard options. These are always legal.144 # The dictionary of standard options. These are always legal.
144 STD_OPTIONS = {}145 STD_OPTIONS: Dict[str, "Option"] = {}
145146
146 # The dictionary of commonly used options. these are only legal147 # The dictionary of commonly used options. these are only legal
147 # if a command explicitly references them by name in the list148 # if a command explicitly references them by name in the list
148 # of supported options.149 # of supported options.
149 OPTIONS = {}150 OPTIONS: Dict[str, "Option"] = {}
150151
151 def __init__(self, name, help='', type=None, argname=None,152 def __init__(self, name, help='', type=None, argname=None,
152 short_name=None, param_name=None, custom_callback=None,153 short_name=None, param_name=None, custom_callback=None,
153154
=== modified file 'breezy/osutils.py'
--- breezy/osutils.py 2022-09-22 22:55:28 +0000
+++ breezy/osutils.py 2022-10-29 02:25:56 +0000
@@ -21,6 +21,7 @@
21import sys21import sys
22import time22import time
23import codecs23import codecs
24from typing import Dict, List
2425
25from .lazy_import import lazy_import26from .lazy_import import lazy_import
26lazy_import(globals(), """27lazy_import(globals(), """
@@ -795,7 +796,7 @@
795796
796797
797# Cache of formatted offset strings798# Cache of formatted offset strings
798_offset_cache = {}799_offset_cache: Dict[int, str] = {}
799800
800801
801def format_date_with_offset_in_original_timezone(t, offset=0,802def format_date_with_offset_in_original_timezone(t, offset=0,
@@ -999,7 +1000,7 @@
999 return pathjoin(*p)1000 return pathjoin(*p)
10001001
10011002
1002def parent_directories(filename):1003def parent_directories(filename: str):
1003 """Return the list of parent directories, deepest first.1004 """Return the list of parent directories, deepest first.
10041005
1005 For example, parent_directories("a/b/c") -> ["a/b", "a"].1006 For example, parent_directories("a/b/c") -> ["a/b", "a"].
@@ -2017,12 +2018,12 @@
2017# data at once.2018# data at once.
2018MAX_SOCKET_CHUNK = 64 * 10242019MAX_SOCKET_CHUNK = 64 * 1024
20192020
2020_end_of_stream_errors = [errno.ECONNRESET, errno.EPIPE, errno.EINVAL]2021_end_of_stream_errors: List[int] = [errno.ECONNRESET, errno.EPIPE, errno.EINVAL]
2021for _eno in ['WSAECONNRESET', 'WSAECONNABORTED']:2022for _eno in ['WSAECONNRESET', 'WSAECONNABORTED']:
2022 _eno = getattr(errno, _eno, None)2023 try:
2023 if _eno is not None:2024 _end_of_stream_errors.append(getattr(errno, _eno))
2024 _end_of_stream_errors.append(_eno)2025 except AttributeError:
2025del _eno2026 pass
20262027
20272028
2028def read_bytes_from_socket(sock, report_activity=None,2029def read_bytes_from_socket(sock, report_activity=None,
20292030
=== modified file 'breezy/plugins/darcs/__init__.py'
--- breezy/plugins/darcs/__init__.py 2022-10-16 11:54:49 +0000
+++ breezy/plugins/darcs/__init__.py 2022-10-29 02:25:56 +0000
@@ -56,10 +56,6 @@
56 def _known_formats(self):56 def _known_formats(self):
57 return set([DarcsDirFormat()])57 return set([DarcsDirFormat()])
5858
59 def open(self, transport, _found=False):
60 """Open this directory."""
61 raise DarcsUnsupportedError()
62
63 def check_support_status(self, allow_unsupported, recommend_upgrade=True,59 def check_support_status(self, allow_unsupported, recommend_upgrade=True,
64 basedir=None):60 basedir=None):
65 raise DarcsUnsupportedError()61 raise DarcsUnsupportedError()
6662
=== modified file 'breezy/plugins/flake8/__init__.py'
--- breezy/plugins/flake8/__init__.py 2022-05-15 14:17:32 +0000
+++ breezy/plugins/flake8/__init__.py 2022-10-29 02:25:56 +0000
@@ -130,4 +130,4 @@
130130
131131
132from breezy.branch import Branch132from breezy.branch import Branch
133Branch.hooks.install_named_hook("pre_commit", _check_flake8, "Check flake8")133Branch.hooks.install_named_hook("pre_commit", _check_flake8, "Check flake8") # type: ignore
134134
=== modified file 'breezy/plugins/launchpad/forge.py'
--- breezy/plugins/launchpad/forge.py 2022-10-26 13:38:16 +0000
+++ breezy/plugins/launchpad/forge.py 2022-10-29 02:25:56 +0000
@@ -222,8 +222,6 @@
222class Launchpad(Forge):222class Launchpad(Forge):
223 """The Launchpad hosting service."""223 """The Launchpad hosting service."""
224224
225 name = 'launchpad'
226
227 # https://bugs.launchpad.net/launchpad/+bug/397676225 # https://bugs.launchpad.net/launchpad/+bug/397676
228 supports_merge_proposal_labels = False226 supports_merge_proposal_labels = False
229227
230228
=== modified file 'breezy/plugins/launchpad/lp_registration.py'
--- breezy/plugins/launchpad/lp_registration.py 2022-05-15 14:17:32 +0000
+++ breezy/plugins/launchpad/lp_registration.py 2022-10-29 02:25:56 +0000
@@ -20,7 +20,6 @@
20from urllib.parse import urlsplit, urlunsplit20from urllib.parse import urlsplit, urlunsplit
21import urllib21import urllib
22from xmlrpc.client import (22from xmlrpc.client import (
23 __version__ as xmlrpc_version,
24 Fault,23 Fault,
25 ProtocolError,24 ProtocolError,
26 ServerProxy,25 ServerProxy,
@@ -100,8 +99,8 @@
100 # NB: these should always end in a slash to avoid xmlrpclib appending99 # NB: these should always end in a slash to avoid xmlrpclib appending
101 # '/RPC2'100 # '/RPC2'
102 LAUNCHPAD_INSTANCE = {}101 LAUNCHPAD_INSTANCE = {}
103 for instance, domain in LAUNCHPAD_DOMAINS.items():102 for instance, _domain in LAUNCHPAD_DOMAINS.items():
104 LAUNCHPAD_INSTANCE[instance] = 'https://xmlrpc.%s/bazaar/' % domain103 LAUNCHPAD_INSTANCE[instance] = 'https://xmlrpc.%s/bazaar/' % _domain
105104
106 DEFAULT_SERVICE_URL = LAUNCHPAD_INSTANCE[DEFAULT_INSTANCE]105 DEFAULT_SERVICE_URL = LAUNCHPAD_INSTANCE[DEFAULT_INSTANCE]
107106
@@ -214,7 +213,7 @@
214 """Base request for talking to a XMLRPC server."""213 """Base request for talking to a XMLRPC server."""
215214
216 # Set this to the XMLRPC method name.215 # Set this to the XMLRPC method name.
217 _methodname = None216 _methodname: str
218217
219 def _request_params(self):218 def _request_params(self):
220 """Return the arguments to pass to the method"""219 """Return the arguments to pass to the method"""
221220
=== modified file 'breezy/plugins/repodebug/check_chk.py'
--- breezy/plugins/repodebug/check_chk.py 2020-02-18 01:57:45 +0000
+++ breezy/plugins/repodebug/check_chk.py 2022-10-29 02:25:56 +0000
@@ -36,7 +36,6 @@
36 """36 """
3737
38 hidden = True38 hidden = True
39 takes_args = []
40 takes_options = ['directory', 'revision']39 takes_options = ['directory', 'revision']
4140
42 def run(self, directory='.', revision=None):41 def run(self, directory='.', revision=None):
4342
=== modified file 'breezy/plugins/weave_fmt/bzrdir.py'
--- breezy/plugins/weave_fmt/bzrdir.py 2022-08-22 18:19:46 +0000
+++ breezy/plugins/weave_fmt/bzrdir.py 2022-10-29 02:25:56 +0000
@@ -32,6 +32,7 @@
32 )32 )
33from ... import (33from ... import (
34 errors,34 errors,
35 lockable_files,
35 )36 )
36from ...transport import (37from ...transport import (
37 get_transport,38 get_transport,
@@ -46,7 +47,6 @@
46from breezy import (47from breezy import (
47 branch as _mod_branch,,48 branch as _mod_branch,,
48 graph,49 graph,
49 lockable_files,
50 lockdir,50 lockdir,
51 osutils,51 osutils,
52 revision as _mod_revision,52 revision as _mod_revision,
5353
=== modified file 'breezy/plugins/weave_fmt/test_store.py'
--- breezy/plugins/weave_fmt/test_store.py 2022-05-03 20:36:36 +0000
+++ breezy/plugins/weave_fmt/test_store.py 2022-10-29 02:25:56 +0000
@@ -284,10 +284,10 @@
284 stream = BytesIO(b"content")284 stream = BytesIO(b"content")
285 my_store = InstrumentedTransportStore(MockTransport())285 my_store = InstrumentedTransportStore(MockTransport())
286 my_store.register_suffix('dsc')286 my_store.register_suffix('dsc')
287 my_store.add(stream, b"foo", b'dsc')287 my_store.add(stream, b"foo", 'dsc')
288 self.assertEqual([("_add", "foo.dsc", stream)], my_store._calls)288 self.assertEqual([("_add", "foo.dsc", stream)], my_store._calls)
289289
290 def test_add_simple_suffixed(self):290 def test_add_simple_suffixed_dir(self):
291 stream = BytesIO(b"content")291 stream = BytesIO(b"content")
292 my_store = InstrumentedTransportStore(MockTransport(), True)292 my_store = InstrumentedTransportStore(MockTransport(), True)
293 my_store.register_suffix('dsc')293 my_store.register_suffix('dsc')
294294
=== modified file 'breezy/plugins/weave_fmt/xml4.py'
--- breezy/plugins/weave_fmt/xml4.py 2020-02-18 01:57:45 +0000
+++ breezy/plugins/weave_fmt/xml4.py 2022-10-29 02:25:56 +0000
@@ -14,6 +14,8 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from typing import List
18
17from ...bzr.xml_serializer import (19from ...bzr.xml_serializer import (
18 Element,20 Element,
19 SubElement,21 SubElement,
@@ -34,7 +36,7 @@
34 v4 serialisation is no longer supported, only deserialisation.36 v4 serialisation is no longer supported, only deserialisation.
35 """37 """
3638
37 __slots__ = []39 __slots__: List[str] = []
3840
39 def _pack_entry(self, ie):41 def _pack_entry(self, ie):
40 """Convert InventoryEntry to XML element"""42 """Convert InventoryEntry to XML element"""
4143
=== modified file 'breezy/repository.py'
--- breezy/repository.py 2022-07-02 13:44:01 +0000
+++ breezy/repository.py 2022-10-29 02:25:56 +0000
@@ -14,6 +14,8 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from typing import List, Type
18
17from .lazy_import import lazy_import19from .lazy_import import lazy_import
18lazy_import(globals(), """20lazy_import(globals(), """
19import time21import time
@@ -1276,61 +1278,61 @@
12761278
1277 # Set to True or False in derived classes. True indicates that the format1279 # Set to True or False in derived classes. True indicates that the format
1278 # supports ghosts gracefully.1280 # supports ghosts gracefully.
1279 supports_ghosts = None1281 supports_ghosts: bool
1280 # Can this repository be given external locations to lookup additional1282 # Can this repository be given external locations to lookup additional
1281 # data. Set to True or False in derived classes.1283 # data. Set to True or False in derived classes.
1282 supports_external_lookups = None1284 supports_external_lookups: bool
1283 # Does this format support CHK bytestring lookups. Set to True or False in1285 # Does this format support CHK bytestring lookups. Set to True or False in
1284 # derived classes.1286 # derived classes.
1285 supports_chks = None1287 supports_chks: bool
1286 # Should fetch trigger a reconcile after the fetch? Only needed for1288 # Should fetch trigger a reconcile after the fetch? Only needed for
1287 # some repository formats that can suffer internal inconsistencies.1289 # some repository formats that can suffer internal inconsistencies.
1288 _fetch_reconcile = False1290 _fetch_reconcile: bool = False
1289 # Does this format have < O(tree_size) delta generation. Used to hint what1291 # Does this format have < O(tree_size) delta generation. Used to hint what
1290 # code path for commit, amongst other things.1292 # code path for commit, amongst other things.
1291 fast_deltas = None1293 fast_deltas: bool
1292 # Does doing a pack operation compress data? Useful for the pack UI command1294 # Does doing a pack operation compress data? Useful for the pack UI command
1293 # (so if there is one pack, the operation can still proceed because it may1295 # (so if there is one pack, the operation can still proceed because it may
1294 # help), and for fetching when data won't have come from the same1296 # help), and for fetching when data won't have come from the same
1295 # compressor.1297 # compressor.
1296 pack_compresses = False1298 pack_compresses: bool = False
1297 # Does the repository storage understand references to trees?1299 # Does the repository storage understand references to trees?
1298 supports_tree_reference = None1300 supports_tree_reference: bool
1299 # Is the format experimental ?1301 # Is the format experimental ?
1300 experimental = False1302 experimental: bool = False
1301 # Does this repository format escape funky characters, or does it create1303 # Does this repository format escape funky characters, or does it create
1302 # files with similar names as the versioned files in its contents on disk1304 # files with similar names as the versioned files in its contents on disk
1303 # ?1305 # ?
1304 supports_funky_characters = None1306 supports_funky_characters: bool
1305 # Does this repository format support leaving locks?1307 # Does this repository format support leaving locks?
1306 supports_leaving_lock = None1308 supports_leaving_lock: bool
1307 # Does this format support the full VersionedFiles interface?1309 # Does this format support the full VersionedFiles interface?
1308 supports_full_versioned_files = None1310 supports_full_versioned_files: bool
1309 # Does this format support signing revision signatures?1311 # Does this format support signing revision signatures?
1310 supports_revision_signatures = True1312 supports_revision_signatures: bool = True
1311 # Can the revision graph have incorrect parents?1313 # Can the revision graph have incorrect parents?
1312 revision_graph_can_have_wrong_parents = None1314 revision_graph_can_have_wrong_parents: bool
1313 # Does this format support setting revision ids?1315 # Does this format support setting revision ids?
1314 supports_setting_revision_ids = True1316 supports_setting_revision_ids: bool = True
1315 # Does this format support rich root data?1317 # Does this format support rich root data?
1316 rich_root_data = None1318 rich_root_data: bool
1317 # Does this format support explicitly versioned directories?1319 # Does this format support explicitly versioned directories?
1318 supports_versioned_directories = None1320 supports_versioned_directories: bool
1319 # Can other repositories be nested into one of this format?1321 # Can other repositories be nested into one of this format?
1320 supports_nesting_repositories = None1322 supports_nesting_repositories: bool
1321 # Is it possible for revisions to be present without being referenced1323 # Is it possible for revisions to be present without being referenced
1322 # somewhere ?1324 # somewhere ?
1323 supports_unreferenced_revisions = None1325 supports_unreferenced_revisions: bool
1324 # Does this format store the current Branch.nick in a revision when1326 # Does this format store the current Branch.nick in a revision when
1325 # creating commits?1327 # creating commits?
1326 supports_storing_branch_nick = True1328 supports_storing_branch_nick: bool = True
1327 # Does the format support overriding the transport to use1329 # Does the format support overriding the transport to use
1328 supports_overriding_transport = True1330 supports_overriding_transport: bool = True
1329 # Does the format support setting custom revision properties?1331 # Does the format support setting custom revision properties?
1330 supports_custom_revision_properties = True1332 supports_custom_revision_properties: bool = True
1331 # Does the format record per-file revision metadata?1333 # Does the format record per-file revision metadata?
1332 records_per_file_revision = True1334 records_per_file_revision: bool = True
1333 supports_multiple_authors = True1335 supports_multiple_authors: bool = True
13341336
1335 def __repr__(self):1337 def __repr__(self):
1336 return "%s()" % self.__class__.__name__1338 return "%s()" % self.__class__.__name__
@@ -1513,7 +1515,7 @@
1513 InterRepository.get(other).method_name(parameters).1515 InterRepository.get(other).method_name(parameters).
1514 """1516 """
15151517
1516 _optimisers = []1518 _optimisers: List[Type["InterRepository"]] = []
1517 """The available optimised InterRepository types."""1519 """The available optimised InterRepository types."""
15181520
1519 def copy_content(self, revision_id=None):1521 def copy_content(self, revision_id=None):
15201522
=== modified file 'breezy/revision.py'
--- breezy/revision.py 2022-07-09 20:29:40 +0000
+++ breezy/revision.py 2022-10-29 02:25:56 +0000
@@ -19,7 +19,7 @@
1919
20__docformat__ = "google"20__docformat__ = "google"
2121
22from typing import List, Optional, Dict22from typing import List, Optional, Dict, Tuple
2323
24from . import (24from . import (
25 errors,25 errors,
@@ -59,7 +59,7 @@
59 timestamp: float59 timestamp: float
60 timezone: int60 timezone: int
6161
62 def __init__(self, revision_id: RevisionID, properties=None, **args):62 def __init__(self, revision_id: RevisionID, properties=None, **args) -> None:
63 self.revision_id = revision_id63 self.revision_id = revision_id
64 if properties is None:64 if properties is None:
65 self.properties = {}65 self.properties = {}
@@ -69,7 +69,7 @@
69 self.committer = None69 self.committer = None
70 self.parent_ids = []70 self.parent_ids = []
71 self.parent_sha1s = []71 self.parent_sha1s = []
72 """Not used anymore - legacy from for 4."""72 # Not used anymore - legacy from for 4.
73 self.__dict__.update(args)73 self.__dict__.update(args)
7474
75 def __repr__(self):75 def __repr__(self):
@@ -166,7 +166,7 @@
166 ancestors = [revision_id]166 ancestors = [revision_id]
167 distance = 0167 distance = 0
168 while len(ancestors) > 0:168 while len(ancestors) > 0:
169 new_ancestors = []169 new_ancestors: List[bytes] = []
170 for ancestor in ancestors:170 for ancestor in ancestors:
171 if not only_present:171 if not only_present:
172 yield ancestor, distance172 yield ancestor, distance
@@ -184,13 +184,13 @@
184 distance += 1184 distance += 1
185185
186186
187def find_present_ancestors(revision_id: RevisionID, revision_source) -> List[RevisionID]:187def find_present_ancestors(revision_id: RevisionID, revision_source) -> Dict[RevisionID, Tuple[int, int]]:
188 """Return the ancestors of a revision present in a branch.188 """Return the ancestors of a revision present in a branch.
189189
190 It's possible that a branch won't have the complete ancestry of190 It's possible that a branch won't have the complete ancestry of
191 one of its revisions.191 one of its revisions.
192 """192 """
193 found_ancestors = {}193 found_ancestors: Dict[RevisionID, Tuple[int, int]] = {}
194 anc_iter = enumerate(iter_ancestors(revision_id, revision_source,194 anc_iter = enumerate(iter_ancestors(revision_id, revision_source,
195 only_present=True))195 only_present=True))
196 for anc_order, (anc_id, anc_distance) in anc_iter:196 for anc_order, (anc_id, anc_distance) in anc_iter:
197197
=== modified file 'breezy/revisionspec.py'
--- breezy/revisionspec.py 2022-07-03 21:06:21 +0000
+++ breezy/revisionspec.py 2022-10-29 02:25:56 +0000
@@ -14,6 +14,7 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from typing import List, Type, Optional
1718
18from breezy import (19from breezy import (
19 revision,20 revision,
@@ -44,20 +45,6 @@
44 self.extra = ''45 self.extra = ''
4546
4647
47class InvalidRevisionSpec(errors.BzrError):
48
49 _fmt = ("Requested revision: '%(spec)s' does not exist in branch:"
50 " %(branch_url)s%(extra)s")
51
52 def __init__(self, spec, branch, extra=None):
53 errors.BzrError.__init__(self, branch=branch, spec=spec)
54 self.branch_url = getattr(branch, 'user_url', str(branch))
55 if extra:
56 self.extra = '\n' + str(extra)
57 else:
58 self.extra = ''
59
60
61class RevisionInfo(object):48class RevisionInfo(object):
62 """The results of applying a revision specification to a branch."""49 """The results of applying a revision specification to a branch."""
6350
@@ -156,8 +143,8 @@
156 (Equivalent to the old Branch method get_revision_info())143 (Equivalent to the old Branch method get_revision_info())
157 """144 """
158145
159 prefix = None146 prefix: Optional[str] = None
160 dwim_catchable_exceptions = (InvalidRevisionSpec,)147 dwim_catchable_exceptions: List[Type[Exception]] = [InvalidRevisionSpec]
161 """Exceptions that RevisionSpec_dwim._match_on will catch.148 """Exceptions that RevisionSpec_dwim._match_on will catch.
162149
163 If the revspec is part of ``dwim_revspecs``, it may be tried with an150 If the revspec is part of ``dwim_revspecs``, it may be tried with an
@@ -300,12 +287,12 @@
300 is called so the string describing the revision is kept here until needed.287 is called so the string describing the revision is kept here until needed.
301 """288 """
302289
303 help_txt = None290 help_txt: str
304291
305 _revno_regex = lazy_regex.lazy_compile(r'^(?:(\d+(\.\d+)*)|-\d+)(:.*)?$')292 _revno_regex = lazy_regex.lazy_compile(r'^(?:(\d+(\.\d+)*)|-\d+)(:.*)?$')
306293
307 # The revspecs to try294 # The revspecs to try
308 _possible_revspecs = []295 _possible_revspecs: List[Type[registry._ObjectGetter]] = []
309296
310 def _try_spectype(self, rstype, branch):297 def _try_spectype(self, rstype, branch):
311 rs = rstype(self.spec, _internal=True)298 rs = rstype(self.spec, _internal=True)
@@ -320,7 +307,7 @@
320 if self._revno_regex.match(self.spec) is not None:307 if self._revno_regex.match(self.spec) is not None:
321 try:308 try:
322 return self._try_spectype(RevisionSpec_revno, branch)309 return self._try_spectype(RevisionSpec_revno, branch)
323 except RevisionSpec_revno.dwim_catchable_exceptions:310 except tuple(RevisionSpec_revno.dwim_catchable_exceptions):
324 pass311 pass
325312
326 # Next see what has been registered313 # Next see what has been registered
@@ -328,7 +315,7 @@
328 rs_class = objgetter.get_obj()315 rs_class = objgetter.get_obj()
329 try:316 try:
330 return self._try_spectype(rs_class, branch)317 return self._try_spectype(rs_class, branch)
331 except rs_class.dwim_catchable_exceptions:318 except tuple(rs_class.dwim_catchable_exceptions):
332 pass319 pass
333320
334 # Well, I dunno what it is. Note that we don't try to keep track of the321 # Well, I dunno what it is. Note that we don't try to keep track of the
@@ -621,7 +608,7 @@
621 """608 """
622609
623 prefix = 'tag:'610 prefix = 'tag:'
624 dwim_catchable_exceptions = (errors.NoSuchTag, errors.TagsNotSupported)611 dwim_catchable_exceptions = [errors.NoSuchTag, errors.TagsNotSupported]
625612
626 def _match_on(self, branch, revs):613 def _match_on(self, branch, revs):
627 # Can raise tags not supported, NoSuchTag, etc614 # Can raise tags not supported, NoSuchTag, etc
@@ -826,7 +813,7 @@
826 branch:/path/to/branch813 branch:/path/to/branch
827 """814 """
828 prefix = 'branch:'815 prefix = 'branch:'
829 dwim_catchable_exceptions = (errors.NotBranchError,)816 dwim_catchable_exceptions = [errors.NotBranchError]
830817
831 def _match_on(self, branch, revs):818 def _match_on(self, branch, revs):
832 from .branch import Branch819 from .branch import Branch
833820
=== modified file 'breezy/tag.py'
--- breezy/tag.py 2020-02-21 03:58:42 +0000
+++ breezy/tag.py 2022-10-29 02:25:56 +0000
@@ -27,6 +27,7 @@
27import itertools27import itertools
28import re28import re
29import sys29import sys
30from typing import List, Type
3031
31# NOTE: I was going to call this tags.py, but vim seems to think all files32# NOTE: I was going to call this tags.py, but vim seems to think all files
32# called tags* are ctags files... mbp 20070220.33# called tags* are ctags files... mbp 20070220.
@@ -186,7 +187,7 @@
186 """Operations between sets of tags.187 """Operations between sets of tags.
187 """188 """
188189
189 _optimisers = []190 _optimisers: List[Type["InterTags"]] = []
190 """The available optimised InterTags types."""191 """The available optimised InterTags types."""
191192
192 @classmethod193 @classmethod
193194
=== modified file 'breezy/tests/TestUtil.py'
--- breezy/tests/TestUtil.py 2018-11-12 01:41:38 +0000
+++ breezy/tests/TestUtil.py 2022-10-29 02:25:56 +0000
@@ -18,6 +18,7 @@
1818
19import logging19import logging
20import unittest20import unittest
21from typing import List, Dict
21import weakref22import weakref
2223
23from .. import pyutils24from .. import pyutils
@@ -133,7 +134,7 @@
133134
134 suiteClass = TestSuite135 suiteClass = TestSuite
135 # Memoize test names by test class dict136 # Memoize test names by test class dict
136 test_func_names = {}137 test_func_names: Dict[str, List[str]] = {}
137138
138 def loadTestsFromModuleNames(self, names):139 def loadTestsFromModuleNames(self, names):
139 """use a custom means to load tests from modules.140 """use a custom means to load tests from modules.
140141
=== modified file 'breezy/tests/__init__.py'
--- breezy/tests/__init__.py 2022-10-26 23:39:54 +0000
+++ breezy/tests/__init__.py 2022-10-29 02:25:56 +0000
@@ -51,6 +51,7 @@
51import threading51import threading
52import time52import time
53import traceback53import traceback
54from typing import Set
54import unittest55import unittest
55import warnings56import warnings
5657
@@ -836,7 +837,7 @@
836 % (type(suite), suite))837 % (type(suite), suite))
837838
838839
839TestSkipped = testtools.testcase.TestSkipped840from testtools.testcase import TestSkipped
840841
841842
842class TestNotApplicable(TestSkipped):843class TestNotApplicable(TestSkipped):
@@ -861,7 +862,7 @@
861 return '<unprintable %s object>' % type(value).__name__862 return '<unprintable %s object>' % type(value).__name__
862863
863864
864traceback._some_str = _clever_some_str865traceback._some_str = _clever_some_str # type: ignore
865866
866867
867# deprecated - use self.knownFailure(), or self.expectFailure.868# deprecated - use self.knownFailure(), or self.expectFailure.
@@ -2433,7 +2434,7 @@
2433 # client frames. Beyond this we could get more clever, but this is good2434 # client frames. Beyond this we could get more clever, but this is good
2434 # enough for now.2435 # enough for now.
2435 stack = traceback.extract_stack()[prefix_length:-5]2436 stack = traceback.extract_stack()[prefix_length:-5]
2436 self.stack = ''.join(traceback.format_list(stack))2437 self._stack = ''.join(traceback.format_list(stack))
24372438
2438 def __str__(self):2439 def __str__(self):
2439 return self.call.method.decode('utf-8')2440 return self.call.method.decode('utf-8')
@@ -2442,7 +2443,7 @@
2442 return self.call.method.decode('utf-8')2443 return self.call.method.decode('utf-8')
24432444
2444 def stack(self):2445 def stack(self):
2445 return self.stack2446 return self._stack
24462447
24472448
2448class TestCaseWithMemoryTransport(TestCase):2449class TestCaseWithMemoryTransport(TestCase):
@@ -3458,7 +3459,7 @@
3458 self.addTest(suite)3459 self.addTest(suite)
34593460
3460 # Don't need subclass run method with suite emptying3461 # Don't need subclass run method with suite emptying
3461 run = unittest.TestSuite.run3462 run = unittest.TestSuite.run # type: ignore
34623463
34633464
3464class CountingDecorator(TestDecorator):3465class CountingDecorator(TestDecorator):
@@ -3727,7 +3728,7 @@
3727# -Euncollected_cases Display the identity of any test cases that weren't3728# -Euncollected_cases Display the identity of any test cases that weren't
3728# deallocated after being completed.3729# deallocated after being completed.
3729# -Econfig_stats Will collect statistics using addDetail3730# -Econfig_stats Will collect statistics using addDetail
3730selftest_debug_flags = set()3731selftest_debug_flags: Set[str] = set()
37313732
37323733
3733def selftest(verbose=False, pattern=".*", stop_on_failure=True,3734def selftest(verbose=False, pattern=".*", stop_on_failure=True,
37343735
=== modified file 'breezy/tests/blackbox/test_push.py'
--- breezy/tests/blackbox/test_push.py 2022-07-02 13:44:01 +0000
+++ breezy/tests/blackbox/test_push.py 2022-10-29 02:25:56 +0000
@@ -429,7 +429,7 @@
429 self.assertPublished(branch_tree.last_revision(),429 self.assertPublished(branch_tree.last_revision(),
430 trunk_tree.branch.base)430 trunk_tree.branch.base)
431431
432 def test_push_new_branch_stacked_on(self):432 def test_push_new_branch_stacked_on_can_use_dir_urls(self):
433 """Pushing a new branch with --stacked-on can use directory URLs."""433 """Pushing a new branch with --stacked-on can use directory URLs."""
434 trunk_tree, branch_tree = self.create_trunk_and_feature_branch()434 trunk_tree, branch_tree = self.create_trunk_and_feature_branch()
435 class FooDirectory(object):435 class FooDirectory(object):
436436
=== modified file 'breezy/tests/blackbox/test_remember_option.py'
--- breezy/tests/blackbox/test_remember_option.py 2020-05-15 01:31:05 +0000
+++ breezy/tests/blackbox/test_remember_option.py 2022-10-29 02:25:56 +0000
@@ -14,6 +14,7 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from typing import List
1718
18from breezy import (19from breezy import (
19 branch,20 branch,
@@ -28,14 +29,14 @@
28 """--remember and --no-remember set locations or not."""29 """--remember and --no-remember set locations or not."""
2930
30 # the command to run (expecting additional arguments from the tests31 # the command to run (expecting additional arguments from the tests
31 command = []32 command: List[str] = []
32 # the dir where the command should be run (it should contain a branch for33 # the dir where the command should be run (it should contain a branch for
33 # which the tested locations are/will be set)34 # which the tested locations are/will be set)
34 working_dir = None35 working_dir: str
35 # argument list for the first command invocation36 # argument list for the first command invocation
36 first_use_args = []37 first_use_args: List[str] = []
37 # argument list for the next command invocation38 # argument list for the next command invocation
38 next_uses_args = []39 next_uses_args: List[str] = []
3940
40 def do_command(self, *args):41 def do_command(self, *args):
41 # We always expect the same result here and care only about the42 # We always expect the same result here and care only about the
4243
=== modified file 'breezy/tests/blackbox/test_serve.py'
--- breezy/tests/blackbox/test_serve.py 2021-11-15 17:27:44 +0000
+++ breezy/tests/blackbox/test_serve.py 2022-10-29 02:25:56 +0000
@@ -17,10 +17,9 @@
1717
18"""Tests of the brz serve command."""18"""Tests of the brz serve command."""
1919
20import os
21import signal20import signal
22import sys21import sys
23from _thread import interrupt_main22from _thread import interrupt_main # type: ignore
2423
25import threading24import threading
2625
2726
=== modified file 'breezy/tests/blackbox/test_switch.py'
--- breezy/tests/blackbox/test_switch.py 2020-06-13 02:58:24 +0000
+++ breezy/tests/blackbox/test_switch.py 2022-10-29 02:25:56 +0000
@@ -172,21 +172,6 @@
172 checkout = checkout.controldir.open_workingtree()172 checkout = checkout.controldir.open_workingtree()
173 self.assertEqual(tree2.branch.base, checkout.branch.base)173 self.assertEqual(tree2.branch.base, checkout.branch.base)
174174
175 def test_switch_finds_relative_unicode_branch(self):
176 """Switch will find 'foo' relative to the branch the checkout is of."""
177 self.requireFeature(UnicodeFilenameFeature)
178 self.build_tree(['repo/'])
179 tree1 = self.make_branch_and_tree('repo/brancha')
180 tree1.commit('foo')
181 tree2 = self.make_branch_and_tree(u'repo/branch\xe9')
182 tree2.pull(tree1.branch)
183 branchb_id = tree2.commit('bar')
184 checkout = tree1.branch.create_checkout('checkout', lightweight=True)
185 self.run_bzr(['switch', u'branch\xe9'], working_dir='checkout')
186 self.assertEqual(branchb_id, checkout.last_revision())
187 checkout = checkout.controldir.open_workingtree()
188 self.assertEqual(tree2.branch.base, checkout.branch.base)
189
190 def test_switch_revision(self):175 def test_switch_revision(self):
191 tree = self._create_sample_tree()176 tree = self._create_sample_tree()
192 checkout = tree.branch.create_checkout('checkout', lightweight=True)177 checkout = tree.branch.create_checkout('checkout', lightweight=True)
193178
=== modified file 'breezy/tests/blackbox/test_upgrade.py'
--- breezy/tests/blackbox/test_upgrade.py 2019-09-01 15:33:59 +0000
+++ breezy/tests/blackbox/test_upgrade.py 2022-10-29 02:25:56 +0000
@@ -21,7 +21,7 @@
21from breezy import (21from breezy import (
22 bzr,22 bzr,
23 controldir,23 controldir,
24 lockable_files,24 lockdir,
25 ui,25 ui,
26 urlutils,26 urlutils,
27 )27 )
@@ -57,7 +57,7 @@
5757
58class OldBzrDirFormat(bzrdir.BzrDirMetaFormat1):58class OldBzrDirFormat(bzrdir.BzrDirMetaFormat1):
5959
60 _lock_class = lockable_files.TransportLock60 _lock_class = lockdir.LockDir
6161
62 def get_converter(self, format=None):62 def get_converter(self, format=None):
63 return ConvertOldTestToMeta()63 return ConvertOldTestToMeta()
6464
=== modified file 'breezy/tests/fake_command.py'
--- breezy/tests/fake_command.py 2017-05-22 00:56:52 +0000
+++ breezy/tests/fake_command.py 2022-10-29 02:25:56 +0000
@@ -15,7 +15,7 @@
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17from . import test_commands17from . import test_commands
18test_commands.lazy_command_imported = True18test_commands.lazy_command_imported = True # type: ignore
1919
2020
21class cmd_fake(object):21class cmd_fake(object):
2222
=== modified file 'breezy/tests/https_server.py'
--- breezy/tests/https_server.py 2022-05-02 11:39:09 +0000
+++ breezy/tests/https_server.py 2022-10-29 02:25:56 +0000
@@ -97,8 +97,8 @@
97 _url_protocol = 'https'97 _url_protocol = 'https'
9898
99 # The real servers depending on the protocol99 # The real servers depending on the protocol
100 http_server_class = {'HTTP/1.0': TestingHTTPSServer,100 http_server_class = {'HTTP/1.0': TestingHTTPSServer, # type: ignore
101 'HTTP/1.1': TestingThreadingHTTPSServer,101 'HTTP/1.1': TestingThreadingHTTPSServer, # type: ignore
102 }102 }
103103
104 # Provides usable defaults since an https server requires both a104 # Provides usable defaults since an https server requires both a
105105
=== modified file 'breezy/tests/per_interbranch/__init__.py'
--- breezy/tests/per_interbranch/__init__.py 2020-06-22 01:07:05 +0000
+++ breezy/tests/per_interbranch/__init__.py 2022-10-29 02:25:56 +0000
@@ -24,6 +24,8 @@
24itself rather than in tests/per_interbranch/*.py.24itself rather than in tests/per_interbranch/*.py.
25"""25"""
2626
27from typing import List, Any
28
2729
28from breezy import (30from breezy import (
29 branchbuilder,31 branchbuilder,
@@ -165,7 +167,7 @@
165 and added rather than actually trying to do something.167 and added rather than actually trying to do something.
166 """168 """
167169
168 _uses = []170 _uses: List[Any] = []
169171
170 def __init__(self, source, target):172 def __init__(self, source, target):
171 self.source = source173 self.source = source
172174
=== modified file 'breezy/tests/per_transport.py'
--- breezy/tests/per_transport.py 2022-08-22 18:19:46 +0000
+++ breezy/tests/per_transport.py 2022-10-29 02:25:56 +0000
@@ -232,14 +232,6 @@
232 t = self.get_transport()232 t = self.get_transport()
233 self.assertRaises(NoSuchFile, t.get_bytes, 'c')233 self.assertRaises(NoSuchFile, t.get_bytes, 'c')
234234
235 def test_get_with_open_write_stream_sees_all_content(self):
236 t = self.get_transport()
237 if t.is_readonly():
238 return
239 with t.open_write_stream('foo') as handle:
240 handle.write(b'b')
241 self.assertEqual(b'b', t.get_bytes('foo'))
242
243 def test_get_bytes_with_open_write_stream_sees_all_content(self):235 def test_get_bytes_with_open_write_stream_sees_all_content(self):
244 t = self.get_transport()236 t = self.get_transport()
245 if t.is_readonly():237 if t.is_readonly():
246238
=== modified file 'breezy/tests/stub_sftp.py'
--- breezy/tests/stub_sftp.py 2020-02-07 02:14:30 +0000
+++ breezy/tests/stub_sftp.py 2022-10-29 02:25:56 +0000
@@ -551,7 +551,7 @@
551 self._vendor = ssh.LoopbackVendor()551 self._vendor = ssh.LoopbackVendor()
552 self.request_handler_class = TestingSFTPWithoutSSHConnectionHandler552 self.request_handler_class = TestingSFTPWithoutSSHConnectionHandler
553553
554 def get_host_key():554 def get_host_key(self):
555 return None555 return None
556556
557557
558558
=== modified file 'breezy/tests/test__annotator.py'
--- breezy/tests/test__annotator.py 2018-11-11 04:08:32 +0000
+++ breezy/tests/test__annotator.py 2022-10-29 02:25:56 +0000
@@ -192,7 +192,7 @@
192 (self.fc_key, b'content\n'),192 (self.fc_key, b'content\n'),
193 ], self.ann.annotate_flat(self.fd_key))193 ], self.ann.annotate_flat(self.fd_key))
194194
195 def test_annotate_common_merge_text(self):195 def test_annotate_common_merge_text_more(self):
196 self.make_common_merge_text()196 self.make_common_merge_text()
197 # there is no common point, so we just pick the lexicographical lowest197 # there is no common point, so we just pick the lexicographical lowest
198 # and b'b-id' comes before b'c-id'198 # and b'b-id' comes before b'c-id'
@@ -200,7 +200,7 @@
200 (self.fb_key, b'new content\n'),200 (self.fb_key, b'new content\n'),
201 ], self.ann.annotate_flat(self.fd_key))201 ], self.ann.annotate_flat(self.fd_key))
202202
203 def test_annotate_many_way_common_merge_text(self):203 def test_annotate_many_way_common_merge_text_more(self):
204 self.make_many_way_common_merge_text()204 self.make_many_way_common_merge_text()
205 self.assertEqual([(self.fa_key, b'simple\n'),205 self.assertEqual([(self.fa_key, b'simple\n'),
206 (self.fb_key, b'new content\n')],206 (self.fb_key, b'new content\n')],
207207
=== modified file 'breezy/tests/test_atomicfile.py'
--- breezy/tests/test_atomicfile.py 2022-05-03 18:47:58 +0000
+++ breezy/tests/test_atomicfile.py 2022-10-29 02:25:56 +0000
@@ -101,9 +101,6 @@
101 def test_mode_0660(self):101 def test_mode_0660(self):
102 self._test_mode(0o660)102 self._test_mode(0o660)
103103
104 def test_mode_0660(self):
105 self._test_mode(0o660)
106
107 def test_mode_0640(self):104 def test_mode_0640(self):
108 self._test_mode(0o640)105 self._test_mode(0o640)
109106
110107
=== modified file 'breezy/tests/test_config.py'
--- breezy/tests/test_config.py 2022-08-22 18:19:46 +0000
+++ breezy/tests/test_config.py 2022-10-29 02:25:56 +0000
@@ -1277,7 +1277,7 @@
1277 def test__get_option_policy_normal(self):1277 def test__get_option_policy_normal(self):
1278 self.get_branch_config('http://www.example.com')1278 self.get_branch_config('http://www.example.com')
1279 self.assertEqual(1279 self.assertEqual(
1280 self.my_location_config._get_config_policy(1280 self.my_location_config._get_option_policy(
1281 'http://www.example.com', 'normal_option'),1281 'http://www.example.com', 'normal_option'),
1282 config.POLICY_NONE)1282 config.POLICY_NONE)
12831283
@@ -1293,7 +1293,7 @@
1293 'http://www.example.com/norecurse', 'normal_option'),1293 'http://www.example.com/norecurse', 'normal_option'),
1294 config.POLICY_NORECURSE)1294 config.POLICY_NORECURSE)
12951295
1296 def test__get_option_policy_normal(self):1296 def test__get_option_policy_normal_appendpath(self):
1297 self.get_branch_config('http://www.example.com')1297 self.get_branch_config('http://www.example.com')
1298 self.assertEqual(1298 self.assertEqual(
1299 self.my_location_config._get_option_policy(1299 self.my_location_config._get_option_policy(
@@ -1482,13 +1482,6 @@
1482 self.assertEqual("Robert Collins <robertc@example.org>",1482 self.assertEqual("Robert Collins <robertc@example.org>",
1483 my_config.username())1483 my_config.username())
14841484
1485 def test_BRZ_EMAIL_OVERRIDES(self):
1486 self.overrideEnv('BZR_EMAIL', "Robert Collins <robertc@example.org>")
1487 branch = FakeBranch()
1488 my_config = config.BranchConfig(branch)
1489 self.assertEqual("Robert Collins <robertc@example.org>",
1490 my_config.username())
1491
1492 def test_get_user_option_global(self):1485 def test_get_user_option_global(self):
1493 my_config = self.get_branch_config(global_config=sample_config_text)1486 my_config = self.get_branch_config(global_config=sample_config_text)
1494 self.assertEqual('something',1487 self.assertEqual('something',
14951488
=== modified file 'breezy/tests/test_conflicts.py'
--- breezy/tests/test_conflicts.py 2022-07-02 16:15:20 +0000
+++ breezy/tests/test_conflicts.py 2022-10-29 02:25:56 +0000
@@ -15,6 +15,7 @@
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17import os17import os
18from typing import List, Tuple, Dict, Any, Callable, Type
1819
19from .. import (20from .. import (
20 conflicts,21 conflicts,
@@ -24,6 +25,7 @@
24 tests,25 tests,
25 transform,26 transform,
26 )27 )
28from ..workingtree import WorkingTree
27from ..bzr import conflicts as bzr_conflicts29from ..bzr import conflicts as bzr_conflicts
28from . import (30from . import (
29 script,31 script,
@@ -159,7 +161,7 @@
159# FIXME: Tests missing for DuplicateID conflict type161# FIXME: Tests missing for DuplicateID conflict type
160class TestResolveConflicts(script.TestCaseWithTransportAndScript):162class TestResolveConflicts(script.TestCaseWithTransportAndScript):
161163
162 preamble = None # The setup script set by daughter classes164 preamble: str # The setup script set by daughter classes
163165
164 def setUp(self):166 def setUp(self):
165 super(TestResolveConflicts, self).setUp()167 super(TestResolveConflicts, self).setUp()
@@ -236,15 +238,18 @@
236 """238 """
237239
238 # Set by daughter classes240 # Set by daughter classes
239 _conflict_type = None241 _conflict_type: Type[conflicts.Conflict]
240 _assert_conflict = None242 _assert_conflict: Callable[[Any, Any, Any], Any]
241243
242 # Set by load_tests244 # Set by load_tests
243 _base_actions = None245 _base_actions = None
244 _this = None246 _this = None
245 _other = None247 _other = None
246248
247 scenarios = []249 scenarios: List[Tuple[
250 Dict[str, Any],
251 Tuple[str, Dict[str, Any]],
252 Tuple[str, Dict[str, Any]]]] = []
248 """The scenario list for the conflict type defined by the class.253 """The scenario list for the conflict type defined by the class.
249254
250 Each scenario is of the form:255 Each scenario is of the form:
251256
=== modified file 'breezy/tests/test_foreign.py'
--- breezy/tests/test_foreign.py 2022-08-22 18:19:46 +0000
+++ breezy/tests/test_foreign.py 2022-10-29 02:25:56 +0000
@@ -38,6 +38,7 @@
38 )38 )
3939
40from ..bzr import groupcompress_repo40from ..bzr import groupcompress_repo
41from ..bzr.pack_repo import PackCommitBuilder
4142
42# This is the dummy foreign revision control system, used43# This is the dummy foreign revision control system, used
43# mainly here in the testsuite to test the foreign VCS infrastructure.44# mainly here in the testsuite to test the foreign VCS infrastructure.
@@ -124,7 +125,7 @@
124 return (revno, revid)125 return (revno, revid)
125126
126127
127class DummyForeignCommitBuilder(vf_repository.VersionedFileCommitBuilder):128class DummyForeignCommitBuilder(PackCommitBuilder):
128129
129 def _generate_revision_if_needed(self, revid):130 def _generate_revision_if_needed(self, revid):
130 mapping = DummyForeignVcsMapping(DummyForeignVcs())131 mapping = DummyForeignVcsMapping(DummyForeignVcs())
131132
=== modified file 'breezy/tests/test_forge.py'
--- breezy/tests/test_forge.py 2022-07-12 09:23:34 +0000
+++ breezy/tests/test_forge.py 2022-10-29 02:25:56 +0000
@@ -15,6 +15,7 @@
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17import os17import os
18from typing import List
1819
19from ..forge import (20from ..forge import (
20 determine_title,21 determine_title,
@@ -41,7 +42,7 @@
4142
42class SampleForge(Forge):43class SampleForge(Forge):
4344
44 _locations = []45 _locations: List[str] = []
4546
46 @classmethod47 @classmethod
47 def _add_location(cls, url):48 def _add_location(cls, url):
4849
=== modified file 'breezy/tests/test_hooks.py'
--- breezy/tests/test_hooks.py 2018-11-11 04:08:32 +0000
+++ breezy/tests/test_hooks.py 2022-10-29 02:25:56 +0000
@@ -158,7 +158,9 @@
158 self.assertEqual("demo", set_rh_lazy_hooks[0][1])158 self.assertEqual("demo", set_rh_lazy_hooks[0][1])
159 self.assertEqual(list(TestHooks.hooks['set_rh']), [set_rh])159 self.assertEqual(list(TestHooks.hooks['set_rh']), [set_rh])
160160
161 def set_rh(): return None161 @classmethod
162 def set_rh(cls):
163 return None
162164
163 def test_install_named_hook_lazy(self):165 def test_install_named_hook_lazy(self):
164 hooks = Hooks("breezy.tests.hooks", "some_hooks")166 hooks = Hooks("breezy.tests.hooks", "some_hooks")
@@ -221,7 +223,8 @@
221 hook.hook(callback, "my callback")223 hook.hook(callback, "my callback")
222 self.assertEqual([callback], list(hook))224 self.assertEqual([callback], list(hook))
223225
224 def lazy_callback():226 @classmethod
227 def lazy_callback(cls):
225 pass228 pass
226229
227 def test_lazy_hook(self):230 def test_lazy_hook(self):
228231
=== modified file 'breezy/tests/test_http.py'
--- breezy/tests/test_http.py 2021-01-10 00:25:52 +0000
+++ breezy/tests/test_http.py 2022-10-29 02:25:56 +0000
@@ -649,7 +649,7 @@
649 Both implementations raises the same error as for a bad status.649 Both implementations raises the same error as for a bad status.
650 """650 """
651651
652 _req_handler_class = InvalidStatusRequestHandler652 _req_handler_class = InvalidStatusRequestHandler # type: ignore
653653
654654
655class BadProtocolRequestHandler(http_server.TestingHTTPRequestHandler):655class BadProtocolRequestHandler(http_server.TestingHTTPRequestHandler):
@@ -1853,7 +1853,7 @@
1853 self.assertEndsWith(response, expected_end_of_response)1853 self.assertEndsWith(response, expected_end_of_response)
18541854
18551855
1856class ForbiddenRequestHandler(http_server.TestingHTTPRequestHandler):1856class NotSmartServerRequestHandler(http_server.TestingHTTPRequestHandler):
1857 """No smart server here request handler."""1857 """No smart server here request handler."""
18581858
1859 def do_POST(self):1859 def do_POST(self):
@@ -1863,7 +1863,7 @@
1863class SmartClientAgainstNotSmartServer(TestSpecificRequestHandler):1863class SmartClientAgainstNotSmartServer(TestSpecificRequestHandler):
1864 """Test smart client behaviour against an http server without smarts."""1864 """Test smart client behaviour against an http server without smarts."""
18651865
1866 _req_handler_class = ForbiddenRequestHandler1866 _req_handler_class = NotSmartServerRequestHandler
18671867
1868 def test_probe_smart_server(self):1868 def test_probe_smart_server(self):
1869 """Test error handling against server refusing smart requests."""1869 """Test error handling against server refusing smart requests."""
18701870
=== modified file 'breezy/tests/test_lazy_import.py'
--- breezy/tests/test_lazy_import.py 2020-01-11 17:41:33 +0000
+++ breezy/tests/test_lazy_import.py 2022-10-29 02:25:56 +0000
@@ -972,7 +972,7 @@
972 ' two,\n'972 ' two,\n'
973 ' )\n')973 ' )\n')
974974
975 def test_from_one_import_two(self):975 def test_from_one_import_two_two(self):
976 exp = {'two': (['one'], 'two', {})}976 exp = {'two': (['one'], 'two', {})}
977 self.check(exp, 'from one import two\n')977 self.check(exp, 'from one import two\n')
978 self.check(exp, 'from one import (two)\n')978 self.check(exp, 'from one import (two)\n')
979979
=== modified file 'breezy/tests/test_lazy_regex.py'
--- breezy/tests/test_lazy_regex.py 2018-11-16 19:09:31 +0000
+++ breezy/tests/test_lazy_regex.py 2022-10-29 02:25:56 +0000
@@ -18,8 +18,8 @@
1818
19import pickle19import pickle
20import re20import re
21from typing import List, Tuple
2122
22from .. import errors
23from .. import (23from .. import (
24 lazy_regex,24 lazy_regex,
25 tests,25 tests,
@@ -37,7 +37,7 @@
37class InstrumentedLazyRegex(lazy_regex.LazyRegex):37class InstrumentedLazyRegex(lazy_regex.LazyRegex):
38 """Keep track of actions on the lazy regex"""38 """Keep track of actions on the lazy regex"""
3939
40 _actions = []40 _actions: List[Tuple[str, ...]] = []
4141
42 @classmethod42 @classmethod
43 def use_actions(cls, actions):43 def use_actions(cls, actions):
4444
=== modified file 'breezy/tests/test_lsprof.py'
--- breezy/tests/test_lsprof.py 2018-11-11 04:08:32 +0000
+++ breezy/tests/test_lsprof.py 2022-10-29 02:25:56 +0000
@@ -17,10 +17,7 @@
17"""Tests for profiling data collection."""17"""Tests for profiling data collection."""
1818
1919
20try:20import pickle
21 import cPickle as pickle
22except ImportError:
23 import pickle
24import threading21import threading
2522
26from .. import (23from .. import (
2724
=== modified file 'breezy/tests/test_merge.py'
--- breezy/tests/test_merge.py 2022-07-15 14:04:05 +0000
+++ breezy/tests/test_merge.py 2022-10-29 02:25:56 +0000
@@ -2006,33 +2006,6 @@
2006 # Only the kind was changed (content)2006 # Only the kind was changed (content)
2007 self.assertEqual([], entries)2007 self.assertEqual([], entries)
20082008
2009 def test_interesting_files(self):
2010 # Two files modified, but we should filter one of them
2011 builder = self.get_builder()
2012 builder.build_snapshot(None,
2013 [('add', (u'', b'a-root-id', 'directory', None)),
2014 ('add', (u'a', b'a-id', 'file', b'content\n')),
2015 ('add', (u'b', b'b-id', 'file', b'content\n'))],
2016 revision_id=b'A-id')
2017 builder.build_snapshot([b'A-id'], [], revision_id=b'B-id')
2018 builder.build_snapshot([b'A-id'], [], revision_id=b'C-id')
2019 builder.build_snapshot([b'C-id', b'B-id'],
2020 [('modify', ('a', b'new-content\n')),
2021 ('modify', ('b', b'new-content\n'))],
2022 revision_id=b'E-id')
2023 builder.build_snapshot([b'B-id', b'C-id'], [], revision_id=b'D-id')
2024 merge_obj = self.make_merge_obj(builder, b'E-id',
2025 interesting_files=['b'])
2026 entries = list(merge_obj._entries_lca())
2027 root_id = b'a-root-id'
2028 self.assertEqual([(b'b-id', True,
2029 ((u'b', [u'b', u'b']), u'b', u'b'),
2030 ((root_id, [root_id, root_id]), root_id, root_id),
2031 ((u'b', [u'b', u'b']), u'b', u'b'),
2032 ((False, [False, False]), False, False),
2033 False),
2034 ], entries)
2035
2036 def test_interesting_file_in_this(self):2009 def test_interesting_file_in_this(self):
2037 # This renamed the file, but it should still match the entry in other2010 # This renamed the file, but it should still match the entry in other
2038 builder = self.get_builder()2011 builder = self.get_builder()
20392012
=== modified file 'breezy/tests/test_osutils_encodings.py'
--- breezy/tests/test_osutils_encodings.py 2020-02-07 02:14:30 +0000
+++ breezy/tests/test_osutils_encodings.py 2022-10-29 02:25:56 +0000
@@ -19,6 +19,7 @@
19import codecs19import codecs
20import locale20import locale
21import sys21import sys
22from typing import Set
2223
23from .. import (24from .. import (
24 osutils,25 osutils,
@@ -39,8 +40,8 @@
39 implemented they cannot be removed. Be careful with naming to avoid40 implemented they cannot be removed. Be careful with naming to avoid
40 collisions between tests.41 collisions between tests.
41 """42 """
42 _registered = False43 _registered: bool = False
43 _enabled_encodings = set()44 _enabled_encodings: Set[str] = set()
4445
45 def add(self, encoding_name):46 def add(self, encoding_name):
46 """Adding encoding name to fake.47 """Adding encoding name to fake.
4748
=== modified file 'breezy/tests/test_patch.py'
--- breezy/tests/test_patch.py 2019-11-22 04:59:15 +0000
+++ breezy/tests/test_patch.py 2022-10-29 02:25:56 +0000
@@ -35,9 +35,6 @@
35 f.write(b'\x00')35 f.write(b'\x00')
36 self.assertRaises(BinaryFile, diff3, 'unused', 'this', 'other', 'base')36 self.assertRaises(BinaryFile, diff3, 'unused', 'this', 'other', 'base')
3737
38
39class TestPatch(TestCaseInTempDir):
40
41 def test_missing_patch(self):38 def test_missing_patch(self):
42 self.assertRaises(PatchInvokeError, run_patch, '.', [],39 self.assertRaises(PatchInvokeError, run_patch, '.', [],
43 _patch_cmd='/unlikely/to/exist')40 _patch_cmd='/unlikely/to/exist')
4441
=== modified file 'breezy/tests/test_plugins.py'
--- breezy/tests/test_plugins.py 2022-01-04 23:53:15 +0000
+++ breezy/tests/test_plugins.py 2022-10-29 02:25:56 +0000
@@ -23,6 +23,7 @@
23import os23import os
24import sys24import sys
25import types25import types
26from typing import Dict, List, Any
2627
27import breezy28import breezy
28from .. import (29from .. import (
@@ -153,7 +154,7 @@
153154
154class TestLoadingPlugins(BaseTestPlugins):155class TestLoadingPlugins(BaseTestPlugins):
155156
156 activeattributes = {}157 activeattributes: Dict[str, List[Any]] = {}
157158
158 def test_plugins_with_the_same_name_are_not_loaded(self):159 def test_plugins_with_the_same_name_are_not_loaded(self):
159 # This test tests that having two plugins in different directories does160 # This test tests that having two plugins in different directories does
160161
=== modified file 'breezy/tests/test_shelf.py'
--- breezy/tests/test_shelf.py 2022-07-02 13:44:01 +0000
+++ breezy/tests/test_shelf.py 2022-10-29 02:25:56 +0000
@@ -534,15 +534,6 @@
534 self.addCleanup(creator.finalize)534 self.addCleanup(creator.finalize)
535 self.assertEqual([], list(creator.iter_shelvable()))535 self.assertEqual([], list(creator.iter_shelvable()))
536536
537 def test_shelve_skips_added_root(self):
538 """Skip adds of the root when iterating through shelvable changes."""
539 tree = self.make_branch_and_tree('tree')
540 tree.lock_tree_write()
541 self.addCleanup(tree.unlock)
542 creator = shelf.ShelfCreator(tree, tree.basis_tree())
543 self.addCleanup(creator.finalize)
544 self.assertEqual([], list(creator.iter_shelvable()))
545
546537
547class TestUnshelver(tests.TestCaseWithTransport):538class TestUnshelver(tests.TestCaseWithTransport):
548539
549540
=== modified file 'breezy/tests/test_ssh_transport.py'
--- breezy/tests/test_ssh_transport.py 2019-06-26 00:13:55 +0000
+++ breezy/tests/test_ssh_transport.py 2022-10-29 02:25:56 +0000
@@ -230,7 +230,7 @@
230 "-s", "--", "host", "sftp"]230 "-s", "--", "host", "sftp"]
231 )231 )
232232
233 def test_openssh_command_tricked(self):233 def test_openssh_command_strange_hostname(self):
234 vendor = SSHCorpSubprocessVendor()234 vendor = SSHCorpSubprocessVendor()
235 self.assertRaises(235 self.assertRaises(
236 StrangeHostname,236 StrangeHostname,
237237
=== modified file 'breezy/tests/test_tree.py'
--- breezy/tests/test_tree.py 2021-02-19 21:27:44 +0000
+++ breezy/tests/test_tree.py 2022-10-29 02:25:56 +0000
@@ -16,10 +16,11 @@
1616
17"""Tests for Tree and InterTree."""17"""Tests for Tree and InterTree."""
1818
19from typing import List, Tuple
20
19from breezy import (21from breezy import (
20 errors,22 errors,
21 revision,23 revision,
22 tree as _mod_tree,
23 )24 )
24from breezy.tests import (25from breezy.tests import (
25 TestCase,26 TestCase,
@@ -80,7 +81,7 @@
8081
81class RecordingOptimiser(InterTree):82class RecordingOptimiser(InterTree):
8283
83 calls = []84 calls: List[Tuple[str, ...]] = []
8485
85 def compare(self, want_unchanged=False, specific_files=None,86 def compare(self, want_unchanged=False, specific_files=None,
86 extra_trees=None, require_versioned=False, include_root=False,87 extra_trees=None, require_versioned=False, include_root=False,
8788
=== modified file 'breezy/tests/test_url_policy_open.py'
--- breezy/tests/test_url_policy_open.py 2019-06-09 14:00:10 +0000
+++ breezy/tests/test_url_policy_open.py 2022-10-29 02:25:56 +0000
@@ -16,6 +16,8 @@
1616
17"""Tests for the branch open with specific URL policy code."""17"""Tests for the branch open with specific URL policy code."""
1818
19from typing import List
20
19from .. import urlutils21from .. import urlutils
20from ..branch import (22from ..branch import (
21 Branch,23 Branch,
@@ -157,7 +159,7 @@
157class TrackingProber(BzrProber):159class TrackingProber(BzrProber):
158 """Subclass of BzrProber which tracks URLs it has been asked to open."""160 """Subclass of BzrProber which tracks URLs it has been asked to open."""
159161
160 seen_urls = []162 seen_urls: List[str] = []
161163
162 @classmethod164 @classmethod
163 def probe_transport(klass, transport):165 def probe_transport(klass, transport):
164166
=== modified file 'breezy/tests/test_utextwrap.py'
--- breezy/tests/test_utextwrap.py 2022-05-15 14:17:32 +0000
+++ breezy/tests/test_utextwrap.py 2022-10-29 02:25:56 +0000
@@ -194,17 +194,17 @@
194194
195except ImportError:195except ImportError:
196196
197 class TestWrap(tests.TestCase):197 class TestWrap(tests.TestCase): # type: ignore
198198
199 def test_wrap(self):199 def test_wrap(self):
200 raise tests.TestSkipped("test.test_textwrap is not available.")200 raise tests.TestSkipped("test.test_textwrap is not available.")
201201
202 class TestLongWord(tests.TestCase):202 class TestLongWord(tests.TestCase): # type: ignore
203203
204 def test_longword(self):204 def test_longword(self):
205 raise tests.TestSkipped("test.test_textwrap is not available.")205 raise tests.TestSkipped("test.test_textwrap is not available.")
206206
207 class TestIndent(tests.TestCase):207 class TestIndent(tests.TestCase): # type: ignore
208208
209 def test_indent(self):209 def test_indent(self):
210 raise tests.TestSkipped("test.test_textwrap is not available.")210 raise tests.TestSkipped("test.test_textwrap is not available.")
211211
=== modified file 'breezy/tests/test_win32utils.py'
--- breezy/tests/test_win32utils.py 2022-01-09 13:12:27 +0000
+++ breezy/tests/test_win32utils.py 2022-10-29 02:25:56 +0000
@@ -17,6 +17,7 @@
17"""Tests for win32utils."""17"""Tests for win32utils."""
1818
19import os19import os
20from typing import List
2021
21from .. import (22from .. import (
22 osutils,23 osutils,
@@ -40,7 +41,7 @@
4041
41class TestWin32UtilsGlobExpand(TestCaseInTempDir):42class TestWin32UtilsGlobExpand(TestCaseInTempDir):
4243
43 _test_needs_features = []44 _test_needs_features: List[features.Feature] = []
4445
45 def test_empty_tree(self):46 def test_empty_tree(self):
46 self.build_tree([])47 self.build_tree([])
4748
=== modified file 'breezy/transport/__init__.py'
--- breezy/transport/__init__.py 2022-09-22 23:12:07 +0000
+++ breezy/transport/__init__.py 2022-10-29 02:25:56 +0000
@@ -29,6 +29,7 @@
29import errno29import errno
30from io import BytesIO30from io import BytesIO
31import sys31import sys
32from typing import Dict, Any
3233
33from stat import S_ISDIR34from stat import S_ISDIR
3435
@@ -47,7 +48,7 @@
4748
48# a dictionary of open file streams. Keys are absolute paths, values are49# a dictionary of open file streams. Keys are absolute paths, values are
49# transport defined.50# transport defined.
50_file_streams = {}51_file_streams: Dict[str, Any] = {}
5152
5253
53def _get_protocol_handlers():54def _get_protocol_handlers():
5455
=== modified file 'breezy/transport/decorator.py'
--- breezy/transport/decorator.py 2020-02-18 01:57:45 +0000
+++ breezy/transport/decorator.py 2022-10-29 02:25:56 +0000
@@ -163,7 +163,8 @@
163 self._decorated.segment_parameters = value163 self._decorated.segment_parameters = value
164164
165 segment_parameters = property(_get_segment_parameters,165 segment_parameters = property(_get_segment_parameters,
166 _set_segment_parameters, "See Transport.segment_parameters")166 _set_segment_parameters,
167 doc="See Transport.segment_parameters")
167168
168 def stat(self, relpath):169 def stat(self, relpath):
169 """See Transport.stat()."""170 """See Transport.stat()."""
170171
=== modified file 'breezy/transport/http/urllib.py'
--- breezy/transport/http/urllib.py 2022-10-06 05:52:17 +0000
+++ breezy/transport/http/urllib.py 2022-10-29 02:25:56 +0000
@@ -84,7 +84,7 @@
84 return host, None84 return host, None
8585
8686
87class addinfourl(urllib_request.addinfourl):87class addinfourl(urllib_request.addinfourl): # type: ignore
88 '''Replacement addinfourl class compatible with python-2.7's xmlrpclib88 '''Replacement addinfourl class compatible with python-2.7's xmlrpclib
8989
90 In python-2.7, xmlrpclib expects that the response object that it receives90 In python-2.7, xmlrpclib expects that the response object that it receives
@@ -315,7 +315,7 @@
315 self.sock = _ReportingSocket(sock, self._report_activity)315 self.sock = _ReportingSocket(sock, self._report_activity)
316316
317317
318class HTTPConnection(AbstractHTTPConnection, http_client.HTTPConnection):318class HTTPConnection(AbstractHTTPConnection, http_client.HTTPConnection): # type: ignore
319319
320 # XXX: Needs refactoring at the caller level.320 # XXX: Needs refactoring at the caller level.
321 def __init__(self, host, port=None, proxied_host=None,321 def __init__(self, host, port=None, proxied_host=None,
@@ -332,7 +332,7 @@
332 self._wrap_socket_for_reporting(self.sock)332 self._wrap_socket_for_reporting(self.sock)
333333
334334
335class HTTPSConnection(AbstractHTTPConnection, http_client.HTTPSConnection):335class HTTPSConnection(AbstractHTTPConnection, http_client.HTTPSConnection): # type: ignore
336336
337 def __init__(self, host, port=None, key_file=None, cert_file=None,337 def __init__(self, host, port=None, key_file=None, cert_file=None,
338 proxied_host=None,338 proxied_host=None,
@@ -1126,7 +1126,7 @@
1126 successful and the request authentication parameters have been updated.1126 successful and the request authentication parameters have been updated.
1127 """1127 """
11281128
1129 scheme = None1129 scheme: str
1130 """The scheme as it appears in the server header (lower cased)"""1130 """The scheme as it appears in the server header (lower cased)"""
11311131
1132 _max_retry = 31132 _max_retry = 3
11331133
=== modified file 'breezy/transport/memory.py'
--- breezy/transport/memory.py 2022-08-22 18:19:46 +0000
+++ breezy/transport/memory.py 2022-10-29 02:25:56 +0000
@@ -162,10 +162,11 @@
162 self._files[_abspath] = (raw_bytes, mode)162 self._files[_abspath] = (raw_bytes, mode)
163 return len(raw_bytes)163 return len(raw_bytes)
164164
165 def symlink(self, source, target):165 def symlink(self, source, link_name):
166 _abspath = self._resolve_symlinks(target)166 """Create a symlink pointing to source named link_name."""
167 _abspath = self._abspath(link_name)
167 self._check_parent(_abspath)168 self._check_parent(_abspath)
168 self._symlinks[_abspath] = self._abspath(source)169 self._symlinks[_abspath] = source.split('/')
169170
170 def mkdir(self, relpath, mode=None):171 def mkdir(self, relpath, mode=None):
171 """See Transport.mkdir()."""172 """See Transport.mkdir()."""
@@ -315,12 +316,6 @@
315 r = self._symlinks.get('/'.join(r), r)316 r = self._symlinks.get('/'.join(r), r)
316 return '/' + '/'.join(r)317 return '/' + '/'.join(r)
317318
318 def symlink(self, source, link_name):
319 """Create a symlink pointing to source named link_name."""
320 _abspath = self._abspath(link_name)
321 self._check_parent(_abspath)
322 self._symlinks[_abspath] = source.split('/')
323
324 def readlink(self, link_name):319 def readlink(self, link_name):
325 _abspath = self._abspath(link_name)320 _abspath = self._abspath(link_name)
326 try:321 try:
327322
=== modified file 'breezy/transport/ssh.py'
--- breezy/transport/ssh.py 2022-05-15 14:17:32 +0000
+++ breezy/transport/ssh.py 2022-10-29 02:25:56 +0000
@@ -24,6 +24,7 @@
24import socket24import socket
25import subprocess25import subprocess
26import sys26import sys
27from typing import Tuple, Type, Set, Dict, Optional
27from binascii import hexlify28from binascii import hexlify
2829
29from .. import (30from .. import (
@@ -40,7 +41,7 @@
40except ModuleNotFoundError as e:41except ModuleNotFoundError as e:
41 # If we have an ssh subprocess, we don't strictly need paramiko for all ssh42 # If we have an ssh subprocess, we don't strictly need paramiko for all ssh
42 # access43 # access
43 paramiko = None44 paramiko = None # type: ignore
44else:45else:
45 from paramiko.sftp_client import SFTPClient46 from paramiko.sftp_client import SFTPClient
4647
@@ -49,8 +50,8 @@
49 _fmt = "Refusing to connect to strange SSH hostname %(hostname)s"50 _fmt = "Refusing to connect to strange SSH hostname %(hostname)s"
5051
5152
52SYSTEM_HOSTKEYS = {}53SYSTEM_HOSTKEYS: Dict[str, Dict[str, str]] = {}
53BRZ_HOSTKEYS = {}54BRZ_HOSTKEYS: Dict[str, Dict[str, str]] = {}
5455
5556
56class SSHVendorManager(object):57class SSHVendorManager(object):
@@ -333,7 +334,7 @@
333 msg='Unable to invoke remote bzr')334 msg='Unable to invoke remote bzr')
334335
335336
336_ssh_connection_errors = (EOFError, OSError, IOError, socket.error)337_ssh_connection_errors: Tuple[Type[Exception], ...] = (EOFError, OSError, IOError, socket.error)
337if paramiko is not None:338if paramiko is not None:
338 vendor = ParamikoVendor()339 vendor = ParamikoVendor()
339 register_ssh_vendor('paramiko', vendor)340 register_ssh_vendor('paramiko', vendor)
@@ -671,7 +672,7 @@
671672
672673
673import weakref674import weakref
674_subproc_weakrefs = set()675_subproc_weakrefs: Set[weakref.ref] = set()
675676
676677
677def _close_ssh_proc(proc, sock):678def _close_ssh_proc(proc, sock):
678679
=== modified file 'breezy/tree.py'
--- breezy/tree.py 2022-10-28 17:29:17 +0000
+++ breezy/tree.py 2022-10-29 02:25:56 +0000
@@ -17,6 +17,8 @@
17"""Tree classes, representing directory at point in time.17"""Tree classes, representing directory at point in time.
18"""18"""
1919
20from typing import List, Type, TYPE_CHECKING, Optional
21
20from . import (22from . import (
21 errors,23 errors,
22 lock,24 lock,
@@ -49,14 +51,14 @@
49 """An entry that implements the minimum interface used by commands.51 """An entry that implements the minimum interface used by commands.
50 """52 """
5153
52 __slots__ = []54 __slots__: List[str] = []
5355
54 def __eq__(self, other):56 def __eq__(self, other):
55 # yes, this is ugly, TODO: best practice __eq__ style.57 # yes, this is ugly, TODO: best practice __eq__ style.
56 return (isinstance(other, TreeEntry)58 return (isinstance(other, TreeEntry)
57 and other.__class__ == self.__class__)59 and other.__class__ == self.__class__)
5860
59 kind = None61 kind: str
6062
61 def kind_character(self):63 def kind_character(self):
62 return "???"64 return "???"
@@ -73,7 +75,7 @@
73class TreeDirectory(TreeEntry):75class TreeDirectory(TreeEntry):
74 """See TreeEntry. This is a directory in a working tree."""76 """See TreeEntry. This is a directory in a working tree."""
7577
76 __slots__ = []78 __slots__: List[str] = []
7779
78 kind = 'directory'80 kind = 'directory'
7981
@@ -84,7 +86,7 @@
84class TreeFile(TreeEntry):86class TreeFile(TreeEntry):
85 """See TreeEntry. This is a regular file in a working tree."""87 """See TreeEntry. This is a regular file in a working tree."""
8688
87 __slots__ = []89 __slots__: List[str] = []
8890
89 kind = 'file'91 kind = 'file'
9092
@@ -95,7 +97,7 @@
95class TreeLink(TreeEntry):97class TreeLink(TreeEntry):
96 """See TreeEntry. This is a symlink in a working tree."""98 """See TreeEntry. This is a symlink in a working tree."""
9799
98 __slots__ = []100 __slots__: List[str] = []
99101
100 kind = 'symlink'102 kind = 'symlink'
101103
@@ -106,7 +108,7 @@
106class TreeReference(TreeEntry):108class TreeReference(TreeEntry):
107 """See TreeEntry. This is a reference to a nested tree in a working tree."""109 """See TreeEntry. This is a reference to a nested tree in a working tree."""
108110
109 __slots__ = []111 __slots__: List[str] = []
110112
111 kind = 'tree-reference'113 kind = 'tree-reference'
112114
@@ -410,7 +412,7 @@
410 """412 """
411 raise NotImplementedError(self.path_content_summary)413 raise NotImplementedError(self.path_content_summary)
412414
413 def get_reference_revision(self, path, branch=None):415 def get_reference_revision(self, path):
414 raise NotImplementedError("Tree subclass %s must implement "416 raise NotImplementedError("Tree subclass %s must implement "
415 "get_reference_revision"417 "get_reference_revision"
416 % self.__class__.__name__)418 % self.__class__.__name__)
@@ -761,10 +763,12 @@
761 # Formats that will be used to test this InterTree. If both are763 # Formats that will be used to test this InterTree. If both are
762 # None, this InterTree will not be tested (e.g. because a complex764 # None, this InterTree will not be tested (e.g. because a complex
763 # setup is required)765 # setup is required)
764 _matching_from_tree_format = None766 if TYPE_CHECKING:
765 _matching_to_tree_format = None767 from .workingtree import WorkingTreeFormat
768 _matching_from_tree_format: Optional["WorkingTreeFormat"] = None
769 _matching_to_tree_format: Optional["WorkingTreeFormat"] = None
766770
767 _optimisers = []771 _optimisers: List[Type["InterTree"]] = []
768772
769 @classmethod773 @classmethod
770 def is_compatible(kls, source, target):774 def is_compatible(kls, source, target):
771775
=== modified file 'breezy/util/simplemapi.py'
--- breezy/util/simplemapi.py 2020-02-18 01:57:45 +0000
+++ breezy/util/simplemapi.py 2022-10-29 02:25:56 +0000
@@ -129,7 +129,7 @@
129129
130lpMapiMessage = POINTER(MapiMessage)130lpMapiMessage = POINTER(MapiMessage)
131131
132MAPI = windll.mapi32132MAPI = windll.mapi32 # type: ignore
133MAPISendMail = MAPI.MAPISendMail133MAPISendMail = MAPI.MAPISendMail
134MAPISendMail.restype = c_ulong134MAPISendMail.restype = c_ulong
135MAPISendMail.argtypes = (LHANDLE, c_ulong, lpMapiMessage, FLAGS, c_ulong)135MAPISendMail.argtypes = (LHANDLE, c_ulong, lpMapiMessage, FLAGS, c_ulong)
@@ -152,7 +152,7 @@
152MAPILogoff.argtypes = (LHANDLE, c_ulong, FLAGS, c_ulong)152MAPILogoff.argtypes = (LHANDLE, c_ulong, FLAGS, c_ulong)
153153
154154
155class MAPIError(WindowsError):155class MAPIError(WindowsError): # type: ignore
156156
157 def __init__(self, code):157 def __init__(self, code):
158 WindowsError.__init__(self)158 WindowsError.__init__(self)
159159
=== modified file 'breezy/version_info_formats/format_rio.py'
--- breezy/version_info_formats/format_rio.py 2022-07-07 15:57:20 +0000
+++ breezy/version_info_formats/format_rio.py 2022-10-29 02:25:56 +0000
@@ -97,4 +97,4 @@
97 " revision object and a RIO stanza.", (1, 15))97 " revision object and a RIO stanza.", (1, 15))
9898
9999
100RioVersionInfoBuilder.hooks = RioVersionInfoBuilderHooks()100RioVersionInfoBuilder.hooks = RioVersionInfoBuilderHooks() # type: ignore
101101
=== modified file 'breezy/version_info_formats/format_yaml.py'
--- breezy/version_info_formats/format_yaml.py 2022-07-07 15:36:19 +0000
+++ breezy/version_info_formats/format_yaml.py 2022-10-29 02:25:56 +0000
@@ -103,4 +103,4 @@
103 " revision object and a YAML stanza.", (3, 3))103 " revision object and a YAML stanza.", (3, 3))
104104
105105
106YamlVersionInfoBuilder.hooks = YamlVersionInfoBuilderHooks()106YamlVersionInfoBuilder.hooks = YamlVersionInfoBuilderHooks() # type: ignore
107107
=== modified file 'breezy/workingtree.py'
--- breezy/workingtree.py 2022-08-22 18:19:46 +0000
+++ breezy/workingtree.py 2022-10-29 02:25:56 +0000
@@ -33,6 +33,7 @@
33import errno33import errno
34import os34import os
35import sys35import sys
36from typing import Optional
3637
37import breezy38import breezy
3839
@@ -537,39 +538,9 @@
537 if updated:538 if updated:
538 self.set_parent_ids(parents, allow_leftmost_as_ghost=True)539 self.set_parent_ids(parents, allow_leftmost_as_ghost=True)
539540
540 def path_content_summary(self, path, _lstat=os.lstat,541 def path_content_summary(self, path):
541 _mapper=osutils.file_kind_from_stat_mode):
542 """See Tree.path_content_summary."""542 """See Tree.path_content_summary."""
543 abspath = self.abspath(path)543 raise NotImplementedError(self.path_content_summary)
544 try:
545 stat_result = _lstat(abspath)
546 except OSError as e:
547 if getattr(e, 'errno', None) == errno.ENOENT:
548 # no file.
549 return ('missing', None, None, None)
550 # propagate other errors
551 raise
552 kind = _mapper(stat_result.st_mode)
553 if kind == 'file':
554 return self._file_content_summary(path, stat_result)
555 elif kind == 'directory':
556 # perhaps it looks like a plain directory, but it's really a
557 # reference.
558 if self._directory_is_tree_reference(path):
559 kind = 'tree-reference'
560 return kind, None, None, None
561 elif kind == 'symlink':
562 target = osutils.readlink(abspath)
563 return ('symlink', None, None, target)
564 else:
565 return (kind, None, None, None)
566
567 def _file_content_summary(self, path, stat_result):
568 size = stat_result.st_size
569 executable = self._is_executable_from_path_and_stat(path, stat_result)
570 # try for a stat cache lookup
571 return ('file', size, executable, self._sha_from_stat(
572 path, stat_result))
573544
574 def _check_parents_for_ghosts(self, revision_ids, allow_leftmost_as_ghost):545 def _check_parents_for_ghosts(self, revision_ids, allow_leftmost_as_ghost):
575 """Common ghost checking functionality from set_parent_*.546 """Common ghost checking functionality from set_parent_*.
@@ -1326,7 +1297,7 @@
1326 missing_parent_conflicts = False1297 missing_parent_conflicts = False
1327 """If this format supports missing parent conflicts."""1298 """If this format supports missing parent conflicts."""
13281299
1329 supports_versioned_directories = None1300 supports_versioned_directories: bool
13301301
1331 supports_merge_modified = True1302 supports_merge_modified = True
1332 """If this format supports storing merge modified hashes."""1303 """If this format supports storing merge modified hashes."""
@@ -1341,7 +1312,7 @@
13411312
1342 supports_righthand_parent_id_as_ghost = True1313 supports_righthand_parent_id_as_ghost = True
13431314
1344 ignore_filename = None1315 ignore_filename: Optional[str] = None
1345 """Name of file with ignore patterns, if any. """1316 """Name of file with ignore patterns, if any. """
13461317
1347 def initialize(self, controldir, revision_id=None, from_branch=None,1318 def initialize(self, controldir, revision_id=None, from_branch=None,
13481319
=== modified file 'breezy/workspace.py'
--- breezy/workspace.py 2022-10-06 05:52:17 +0000
+++ breezy/workspace.py 2022-10-29 02:25:56 +0000
@@ -50,7 +50,7 @@
50 local_tree: WorkingTree,50 local_tree: WorkingTree,
51 basis_tree: Optional[Tree] = None,51 basis_tree: Optional[Tree] = None,
52 subpath: str = "",52 subpath: str = "",
53 dirty_tracker: "DirtyTracker" = None,53 dirty_tracker=None,
54) -> None:54) -> None:
55 """Reset a tree back to its basis tree.55 """Reset a tree back to its basis tree.
5656
@@ -214,7 +214,8 @@
214 if self._dirty_tracker is not None:214 if self._dirty_tracker is not None:
215 self._dirty_tracker.mark_clean()215 self._dirty_tracker.mark_clean()
216216
217 def _stage(self) -> List[str]:217 def _stage(self) -> Optional[List[str]]:
218 changed: Optional[List[str]]
218 if self._dirty_tracker:219 if self._dirty_tracker:
219 relpaths = self._dirty_tracker.relpaths()220 relpaths = self._dirty_tracker.relpaths()
220 # Sort paths so that directories get added before the files they221 # Sort paths so that directories get added before the files they
221222
=== modified file 'profile_imports.py'
--- profile_imports.py 2020-02-18 01:57:45 +0000
+++ profile_imports.py 2022-10-29 02:25:56 +0000
@@ -20,10 +20,11 @@
20import re20import re
21import sys21import sys
22import time22import time
2323from typing import Dict, Tuple, List
2424
25_parent_stack = []25
26_total_stack = {}26_parent_stack: List[Tuple[int, str]] = []
27_total_stack: Dict[str, str] = {}
27_info = {}28_info = {}
28_cur_id = 029_cur_id = 0
29_timer = time.time30_timer = time.time
@@ -158,7 +159,7 @@
158 return repr(pattern)159 return repr(pattern)
159160
160161
161_real_compile = re._compile162_real_compile = re._compile # type: ignore
162163
163164
164def timed_compile(*args, **kwargs):165def timed_compile(*args, **kwargs):
165166
=== modified file 'pyproject.toml'
--- pyproject.toml 2022-10-18 19:46:29 +0000
+++ pyproject.toml 2022-10-29 02:25:56 +0000
@@ -10,3 +10,10 @@
10 "wheel",10 "wheel",
11]11]
12build-backend = "setuptools.build_meta"12build-backend = "setuptools.build_meta"
13
14[tool.mypy]
15python_version = "3.7"
16ignore_missing_imports = true
17warn_return_any = true
18warn_unused_configs = true
19exclude = ['^breezy/util/simplemapi\.py$']
1320
=== modified file 'setup.cfg'
--- setup.cfg 2022-10-27 18:36:02 +0000
+++ setup.cfg 2022-10-29 02:25:56 +0000
@@ -58,7 +58,6 @@
58 sphinx58 sphinx
59 sphinx_epytext59 sphinx_epytext
60pgp = gpg60pgp = gpg
61gitlab =
62github = github61github = github
63paramiko = paramiko62paramiko = paramiko
64dev =63dev =

Subscribers

People subscribed via source and target branches