Skip to content

Commit 09c4ea6

Browse files
authored
Merge pull request #336 from jelmer/3.3-fix-tests
Fix iter_bytes() usage and remove failing setup test
2 parents 468bc7f + 8820f99 commit 09c4ea6

22 files changed

+85
-108
lines changed

breezy/bzr/remote.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,9 @@ def _has_same_fallbacks(self, other_repo):
16951695
other_fb = other_repo._fallback_repositories
16961696
if len(my_fb) != len(other_fb):
16971697
return False
1698-
return all(f.has_same_location(g) for f, g in zip(my_fb, other_fb, strict=False))
1698+
return all(
1699+
f.has_same_location(g) for f, g in zip(my_fb, other_fb, strict=False)
1700+
)
16991701

17001702
def has_same_location(self, other):
17011703
# TODO: Move to RepositoryBase and unify with the regular Repository

breezy/bzr/tests/test_vfs_ratchet.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def test_simple_annotate(self):
5959
wt.add(["hello.txt"])
6060
wt.commit("commit", committer="test@user")
6161
self.reset_smart_call_log()
62-
_out, _err = self.run_bzr(["annotate", "-d", self.get_url("branch"), "hello.txt"])
62+
_out, _err = self.run_bzr(
63+
["annotate", "-d", self.get_url("branch"), "hello.txt"]
64+
)
6365
# This figure represent the amount of work to perform this use case. It
6466
# is entirely ok to reduce this number if a test fails due to rpc_count
6567
# being too low. If rpc_count increases, more network roundtrips have

breezy/bzr/transform.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,9 @@ def _list_files_by_dir(self):
20812081
parent = todo.pop()
20822082
parent_file_id = self._transform.final_file_id(parent)
20832083
children = list(self._all_children(parent))
2084-
paths = dict(zip(children, self._final_paths.get_paths(children), strict=False))
2084+
paths = dict(
2085+
zip(children, self._final_paths.get_paths(children), strict=False)
2086+
)
20852087
children.sort(key=paths.get)
20862088
todo.extend(reversed(children))
20872089
for trans_id in children:

breezy/bzr/versionedfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,11 @@ def make_mpdiffs(self, version_ids):
645645
raise errors.RevisionNotPresent(version_id, self) from e
646646
# We need to filter out ghosts, because we can't diff against them.
647647
knit_versions = set(self.get_parent_map(knit_versions))
648-
lines = dict(zip(knit_versions, self._get_lf_split_line_list(knit_versions), strict=False))
648+
lines = dict(
649+
zip(
650+
knit_versions, self._get_lf_split_line_list(knit_versions), strict=False
651+
)
652+
)
649653
diffs = []
650654
for version_id in version_ids:
651655
target = lines[version_id]

breezy/bzr/workingtree_4.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,8 @@ def reset_state(self, revision_ids=None):
14241424
trees = list(
14251425
zip(
14261426
revision_ids,
1427-
self.branch.repository.revision_trees(revision_ids), strict=False,
1427+
self.branch.repository.revision_trees(revision_ids),
1428+
strict=False,
14281429
)
14291430
)
14301431
base_tree = trees[0][1]

breezy/git/interrepo.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
from dulwich.object_store import ObjectStoreGraphWalker
2424
from dulwich.objects import ObjectID
2525
from dulwich.pack import PACK_SPOOL_FILE_MAX_SIZE
26-
from dulwich.protocol import CAPABILITY_THIN_PACK, ZERO_SHA
27-
from dulwich.refs import SYMREF
28-
2926
from dulwich.protocol import CAPABILITY_THIN_PACK, PEELED_TAG_SUFFIX, ZERO_SHA
3027
from dulwich.refs import SYMREF
3128
from dulwich.walk import Walker
@@ -682,7 +679,9 @@ def determine_wants(heads, depth=None):
682679
ret = []
683680
for name, (sha1, bzr_revid) in list(new_refs.items()):
684681
if sha1 is None:
685-
sha1, _unused_mapping = self.source.lookup_bzr_revision_id(bzr_revid)
682+
sha1, _unused_mapping = self.source.lookup_bzr_revision_id(
683+
bzr_revid
684+
)
686685
new_refs[name] = (sha1, bzr_revid)
687686
ret.append(sha1)
688687
ref_changes.update(new_refs)

breezy/git/object_store.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,9 @@ def _revision_to_objects(self, rev, tree, lossy, add_cache_entry=None):
522522
rev, root_tree.id, lossy=lossy, verifiers=verifiers
523523
)
524524
try:
525-
foreign_revid, _mapping = mapping_registry.parse_revision_id(rev.revision_id)
525+
foreign_revid, _mapping = mapping_registry.parse_revision_id(
526+
rev.revision_id
527+
)
526528
except errors.InvalidRevisionId:
527529
pass
528530
else:

breezy/git/transform.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,7 @@ def iter_changes(self, want_unversioned=False):
575575

576576
to_name = self.final_name(trans_id)
577577
to_kind = self.final_kind(trans_id)
578-
to_executable = (
579-
self._new_executability.get(trans_id, from_executable)
580-
)
578+
to_executable = self._new_executability.get(trans_id, from_executable)
581579
if from_versioned and from_kind != to_kind:
582580
modified = True
583581
elif to_kind in ("file", "symlink") and (trans_id in self._new_contents):
@@ -1838,7 +1836,9 @@ def _list_files_by_dir(self):
18381836
while len(todo) > 0:
18391837
parent = todo.pop()
18401838
children = list(self._all_children(parent))
1841-
paths = dict(zip(children, self._final_paths.get_paths(children), strict=False))
1839+
paths = dict(
1840+
zip(children, self._final_paths.get_paths(children), strict=False)
1841+
)
18421842
children.sort(key=paths.get)
18431843
todo.extend(reversed(children))
18441844
for trans_id in children:

breezy/merge.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,9 @@ def get_sha1(tree, path):
10991099
base_sha1 = get_sha1(self.base_tree, base_path)
11001100
lca_sha1s = [
11011101
get_sha1(tree, lca_path)
1102-
for tree, lca_path in zip(self._lca_trees, lca_paths, strict=False)
1102+
for tree, lca_path in zip(
1103+
self._lca_trees, lca_paths, strict=False
1104+
)
11031105
]
11041106
this_sha1 = get_sha1(self.this_tree, this_path)
11051107
other_sha1 = get_sha1(self.other_tree, other_path)

breezy/plugins/fastimport/tests/test_generic_processor.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,15 +1229,19 @@ def test_rename_new_file_in_root(self):
12291229
old_path = b"a"
12301230
new_path = b"b"
12311231
handler.process(self.get_command_iter(old_path, new_path))
1232-
_revtree0, revtree1 = self.assertChanges(branch, 1, expected_added=[(new_path,)])
1232+
_revtree0, revtree1 = self.assertChanges(
1233+
branch, 1, expected_added=[(new_path,)]
1234+
)
12331235
self.assertRevisionRoot(revtree1, new_path)
12341236

12351237
def test_rename_new_symlink_in_root(self):
12361238
handler, branch = self.get_handler()
12371239
old_path = b"a"
12381240
new_path = b"b"
12391241
handler.process(self.get_command_iter(old_path, new_path, "symlink"))
1240-
_revtree0, revtree1 = self.assertChanges(branch, 1, expected_added=[(new_path,)])
1242+
_revtree0, revtree1 = self.assertChanges(
1243+
branch, 1, expected_added=[(new_path,)]
1244+
)
12411245
self.assertRevisionRoot(revtree1, new_path)
12421246

12431247
def test_rename_new_file_in_subdir(self):
@@ -1440,7 +1444,9 @@ def test_rename_of_modified_file_in_root(self):
14401444
old_path = b"a"
14411445
new_path = b"b"
14421446
handler.process(self.get_command_iter(old_path, new_path))
1443-
_revtree0, revtree1 = self.assertChanges(branch, 1, expected_added=[(old_path,)])
1447+
_revtree0, revtree1 = self.assertChanges(
1448+
branch, 1, expected_added=[(old_path,)]
1449+
)
14441450
# Note: the delta doesn't show the modification?
14451451
# The actual new content is validated in the assertions following.
14461452
revtree1, revtree2 = self.assertChanges(
@@ -1456,7 +1462,9 @@ def test_rename_of_modified_symlink_in_root(self):
14561462
old_path = b"a"
14571463
new_path = b"b"
14581464
handler.process(self.get_command_iter(old_path, new_path, "symlink"))
1459-
_revtree0, revtree1 = self.assertChanges(branch, 1, expected_added=[(old_path,)])
1465+
_revtree0, revtree1 = self.assertChanges(
1466+
branch, 1, expected_added=[(old_path,)]
1467+
)
14601468
# Note: the delta doesn't show the modification?
14611469
# The actual new content is validated in the assertions following.
14621470
revtree1, revtree2 = self.assertChanges(
@@ -1576,7 +1584,9 @@ def test_rename_then_modify_file_in_root(self):
15761584
old_path = b"a"
15771585
new_path = b"b"
15781586
handler.process(self.get_command_iter(old_path, new_path))
1579-
_revtree0, revtree1 = self.assertChanges(branch, 1, expected_added=[(old_path,)])
1587+
_revtree0, revtree1 = self.assertChanges(
1588+
branch, 1, expected_added=[(old_path,)]
1589+
)
15801590
# Note: the delta doesn't show the modification?
15811591
# The actual new content is validated in the assertions following.
15821592
revtree1, revtree2 = self.assertChanges(
@@ -1628,7 +1638,9 @@ def test_rename_then_modify_symlink_in_root(self):
16281638
old_path = b"a"
16291639
new_path = b"b"
16301640
handler.process(self.get_command_iter(old_path, new_path, "symlink"))
1631-
_revtree0, revtree1 = self.assertChanges(branch, 1, expected_added=[(old_path,)])
1641+
_revtree0, revtree1 = self.assertChanges(
1642+
branch, 1, expected_added=[(old_path,)]
1643+
)
16321644
# Note: the delta doesn't show the modification?
16331645
# The actual new content is validated in the assertions following.
16341646
revtree1, revtree2 = self.assertChanges(

0 commit comments

Comments
 (0)