Merge lp:~jelmer/brz/even-even-more-foreign into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: Vincent Ladeuil
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/even-even-more-foreign
Merge into: lp:brz
Prerequisite: lp:~jelmer/brz/wt-righthand-ghost-parents
Diff against target: 256 lines (+79/-59)
4 files modified
breezy/tests/per_interbranch/test_push.py (+1/-1)
breezy/tests/per_workingtree/test_move.py (+63/-49)
breezy/tests/per_workingtree/test_revision_tree.py (+6/-6)
breezy/tests/per_workingtree/test_symlinks.py (+9/-3)
To merge this branch: bzr merge lp:~jelmer/brz/even-even-more-foreign
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+340261@code.launchpad.net

This proposal supersedes a proposal from 2018-02-26.

Commit message

Fix some more tests when used against foreign branches.

Description of the change

Fix some more tests when used against foreign branches.

(now with other branches merged into trunk, for a smaller diff)

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote : Posted in a previous version of this proposal

Thanks.

Revision history for this message
Martin Packman (gz) wrote : Posted in a previous version of this proposal

Ah, actually, reviewed this branch as lp:~jelmer/brz/plan-merge - presumably some history needs cleaning up here. The test changes all seemed fine as well

review: Needs Fixing
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/tests/per_interbranch/test_push.py'
--- breezy/tests/per_interbranch/test_push.py 2018-02-28 10:27:45 +0000
+++ breezy/tests/per_interbranch/test_push.py 2018-03-02 01:34:56 +0000
@@ -273,7 +273,7 @@
273 self.assertFalse(local.is_locked())273 self.assertFalse(local.is_locked())
274 local.push(remote)274 local.push(remote)
275 hpss_call_names = [item.call.method for item in self.hpss_calls]275 hpss_call_names = [item.call.method for item in self.hpss_calls]
276 self.assertTrue('Repository.insert_stream_1.19' in hpss_call_names)276 self.assertIn('Repository.insert_stream_1.19', hpss_call_names)
277 insert_stream_idx = hpss_call_names.index(277 insert_stream_idx = hpss_call_names.index(
278 'Repository.insert_stream_1.19')278 'Repository.insert_stream_1.19')
279 calls_after_insert_stream = hpss_call_names[insert_stream_idx:]279 calls_after_insert_stream = hpss_call_names[insert_stream_idx:]
280280
=== modified file 'breezy/tests/per_workingtree/test_move.py'
--- breezy/tests/per_workingtree/test_move.py 2018-02-21 20:07:48 +0000
+++ breezy/tests/per_workingtree/test_move.py 2018-03-02 01:34:56 +0000
@@ -403,25 +403,28 @@
403 def test_move_directory_with_children_in_subdir(self):403 def test_move_directory_with_children_in_subdir(self):
404 tree = self.make_branch_and_tree('.')404 tree = self.make_branch_and_tree('.')
405 self.build_tree(['a/', 'a/b', 'a/c/', 'd/'])405 self.build_tree(['a/', 'a/b', 'a/c/', 'd/'])
406 tree.add(['a', 'a/b', 'a/c', 'd'],406 tree.add(['a', 'a/b', 'a/c', 'd'])
407 ['a-id', 'b-id', 'c-id', 'd-id'])407 a_id = tree.path2id('a')
408 b_id = tree.path2id('a/b')
409 c_id = tree.path2id('a/c')
410 d_id = tree.path2id('d')
408 tree.commit('initial')411 tree.commit('initial')
409 root_id = tree.get_root_id()412 root_id = tree.get_root_id()
410413
411 tree.rename_one('a/b', 'a/c/b')414 tree.rename_one('a/b', 'a/c/b')
412 self.assertTreeLayout([('', root_id),415 self.assertTreeLayout([('', root_id),
413 ('a/', 'a-id'),416 ('a/', a_id),
414 ('d/', 'd-id'),417 ('d/', d_id),
415 ('a/c/', 'c-id'),418 ('a/c/', c_id),
416 ('a/c/b', 'b-id'),419 ('a/c/b', b_id),
417 ], tree)420 ], tree)
418 self.assertEqual([('a', 'd/a')],421 self.assertEqual([('a', 'd/a')],
419 tree.move(['a'], 'd'))422 tree.move(['a'], 'd'))
420 self.assertTreeLayout([('', root_id),423 self.assertTreeLayout([('', root_id),
421 ('d/', 'd-id'),424 ('d/', d_id),
422 ('d/a/', 'a-id'),425 ('d/a/', a_id),
423 ('d/a/c/', 'c-id'),426 ('d/a/c/', c_id),
424 ('d/a/c/b', 'b-id'),427 ('d/a/c/b', b_id),
425 ], tree)428 ], tree)
426 tree._validate()429 tree._validate()
427430
@@ -474,70 +477,81 @@
474 def test_move_directory_with_moved_children(self):477 def test_move_directory_with_moved_children(self):
475 tree = self.make_branch_and_tree('.')478 tree = self.make_branch_and_tree('.')
476 self.build_tree(['a/', 'a/b', 'a/c', 'd', 'e/'])479 self.build_tree(['a/', 'a/b', 'a/c', 'd', 'e/'])
477 tree.add(['a', 'a/b', 'a/c', 'd', 'e'],480 tree.add(['a', 'a/b', 'a/c', 'd', 'e'])
478 ['a-id', 'b-id', 'c-id', 'd-id', 'e-id'])481 a_id = tree.path2id('a')
482 b_id = tree.path2id('a/b')
483 c_id = tree.path2id('a/c')
484 d_id = tree.path2id('d')
485 e_id = tree.path2id('e')
479 tree.commit('initial')486 tree.commit('initial')
480 root_id = tree.get_root_id()487 root_id = tree.get_root_id()
481488
482 self.assertEqual([('a/b', 'b')],489 self.assertEqual([('a/b', 'b')],
483 tree.move(['a/b'], ''))490 tree.move(['a/b'], ''))
484 self.assertTreeLayout([('', root_id),491 self.assertTreeLayout([('', root_id),
485 ('a/', 'a-id'),492 ('a/', a_id),
486 ('b', 'b-id'),493 ('b', b_id),
487 ('d', 'd-id'),494 ('d', d_id),
488 ('e/', 'e-id'),495 ('e/', e_id),
489 ('a/c', 'c-id'),496 ('a/c', c_id),
490 ], tree)497 ], tree)
491 self.assertEqual([('d', 'a/d')],498 self.assertEqual([('d', 'a/d')],
492 tree.move(['d'], 'a'))499 tree.move(['d'], 'a'))
493 self.assertTreeLayout([('', root_id),500 self.assertTreeLayout([('', root_id),
494 ('a/', 'a-id'),501 ('a/', a_id),
495 ('b', 'b-id'),502 ('b', b_id),
496 ('e/', 'e-id'),503 ('e/', e_id),
497 ('a/c', 'c-id'),504 ('a/c', c_id),
498 ('a/d', 'd-id'),505 ('a/d', d_id),
499 ], tree)506 ], tree)
500 self.assertEqual([('a', 'e/a')],507 self.assertEqual([('a', 'e/a')],
501 tree.move(['a'], 'e'))508 tree.move(['a'], 'e'))
502 self.assertTreeLayout([('', root_id),509 self.assertTreeLayout([('', root_id),
503 ('b', 'b-id'),510 ('b', b_id),
504 ('e/', 'e-id'),511 ('e/', e_id),
505 ('e/a/', 'a-id'),512 ('e/a/', a_id),
506 ('e/a/c', 'c-id'),513 ('e/a/c', c_id),
507 ('e/a/d', 'd-id'),514 ('e/a/d', d_id),
508 ], tree)515 ], tree)
509 tree._validate()516 tree._validate()
510517
511 def test_move_directory_with_renamed_child(self):518 def test_move_directory_with_renamed_child(self):
512 tree = self.make_branch_and_tree('.')519 tree = self.make_branch_and_tree('.')
513 self.build_tree(['a/', 'a/b', 'a/c', 'd/'])520 self.build_tree(['a/', 'a/b', 'a/c', 'd/'])
514 tree.add(['a', 'a/b', 'a/c', 'd'],521 tree.add(['a', 'a/b', 'a/c', 'd'])
515 ['a-id', 'b-id', 'c-id', 'd-id'])522 a_id = tree.path2id('a')
523 b_id = tree.path2id('a/b')
524 c_id = tree.path2id('a/c')
525 d_id = tree.path2id('d')
516 tree.commit('initial')526 tree.commit('initial')
517 root_id = tree.get_root_id()527 root_id = tree.get_root_id()
518528
519 tree.rename_one('a/b', 'a/d')529 tree.rename_one('a/b', 'a/d')
520 self.assertTreeLayout([('', root_id),530 self.assertTreeLayout([('', root_id),
521 ('a/', 'a-id'),531 ('a/', a_id),
522 ('d/', 'd-id'),532 ('d/', d_id),
523 ('a/c', 'c-id'),533 ('a/c', c_id),
524 ('a/d', 'b-id'),534 ('a/d', b_id),
525 ], tree)535 ], tree)
526 self.assertEqual([('a', 'd/a')],536 self.assertEqual([('a', 'd/a')],
527 tree.move(['a'], 'd'))537 tree.move(['a'], 'd'))
528 self.assertTreeLayout([('', root_id),538 self.assertTreeLayout([('', root_id),
529 ('d/', 'd-id'),539 ('d/', d_id),
530 ('d/a/', 'a-id'),540 ('d/a/', a_id),
531 ('d/a/c', 'c-id'),541 ('d/a/c', c_id),
532 ('d/a/d', 'b-id'),542 ('d/a/d', b_id),
533 ], tree)543 ], tree)
534 tree._validate()544 tree._validate()
535545
536 def test_move_directory_with_swapped_children(self):546 def test_move_directory_with_swapped_children(self):
537 tree = self.make_branch_and_tree('.')547 tree = self.make_branch_and_tree('.')
538 self.build_tree(['a/', 'a/b', 'a/c', 'a/d', 'e/'])548 self.build_tree(['a/', 'a/b', 'a/c', 'a/d', 'e/'])
539 tree.add(['a', 'a/b', 'a/c', 'a/d', 'e'],549 tree.add(['a', 'a/b', 'a/c', 'a/d', 'e'])
540 ['a-id', 'b-id', 'c-id', 'd-id', 'e-id'])550 a_id = tree.path2id('a')
551 b_id = tree.path2id('a/b')
552 c_id = tree.path2id('a/c')
553 d_id = tree.path2id('a/d')
554 e_id = tree.path2id('e')
541 tree.commit('initial')555 tree.commit('initial')
542 root_id = tree.get_root_id()556 root_id = tree.get_root_id()
543557
@@ -545,20 +559,20 @@
545 tree.rename_one('a/d', 'a/b')559 tree.rename_one('a/d', 'a/b')
546 tree.rename_one('a/bb', 'a/d')560 tree.rename_one('a/bb', 'a/d')
547 self.assertTreeLayout([('', root_id),561 self.assertTreeLayout([('', root_id),
548 ('a/', 'a-id'),562 ('a/', a_id),
549 ('e/', 'e-id'),563 ('e/', e_id),
550 ('a/b', 'd-id'),564 ('a/b', d_id),
551 ('a/c', 'c-id'),565 ('a/c', c_id),
552 ('a/d', 'b-id'),566 ('a/d', b_id),
553 ], tree)567 ], tree)
554 self.assertEqual([('a', 'e/a')],568 self.assertEqual([('a', 'e/a')],
555 tree.move(['a'], 'e'))569 tree.move(['a'], 'e'))
556 self.assertTreeLayout([('', root_id),570 self.assertTreeLayout([('', root_id),
557 ('e/', 'e-id'),571 ('e/', e_id),
558 ('e/a/', 'a-id'),572 ('e/a/', a_id),
559 ('e/a/b', 'd-id'),573 ('e/a/b', d_id),
560 ('e/a/c', 'c-id'),574 ('e/a/c', c_id),
561 ('e/a/d', 'b-id'),575 ('e/a/d', b_id),
562 ], tree)576 ], tree)
563 tree._validate()577 tree._validate()
564578
565579
=== modified file 'breezy/tests/per_workingtree/test_revision_tree.py'
--- breezy/tests/per_workingtree/test_revision_tree.py 2018-01-12 08:52:43 +0000
+++ breezy/tests/per_workingtree/test_revision_tree.py 2018-03-02 01:34:56 +0000
@@ -101,25 +101,25 @@
101 self.build_tree(files, line_endings='binary',101 self.build_tree(files, line_endings='binary',
102 transport=tree.controldir.root_transport)102 transport=tree.controldir.root_transport)
103 tree.add(files)103 tree.add(files)
104 tree.commit('a, b and b/c', rev_id='base')104 base_revid = tree.commit('a, b and b/c')
105 tree2 = tree.controldir.sprout(relpath + '2').open_workingtree()105 tree2 = tree.controldir.sprout(relpath + '2').open_workingtree()
106 # Delete 'a' in tree106 # Delete 'a' in tree
107 tree.remove('a', keep_files=False)107 tree.remove('a', keep_files=False)
108 tree.commit('remove a', rev_id='this')108 this_revid = tree.commit('remove a')
109 # Delete 'c' in tree2109 # Delete 'c' in tree2
110 tree2.remove('b/c', keep_files=False)110 tree2.remove('b/c', keep_files=False)
111 tree2.remove('b', keep_files=False)111 tree2.remove('b', keep_files=False)
112 tree2.commit('remove b/c', rev_id='other')112 other_revid = tree2.commit('remove b/c')
113 # Merge tree2 into tree113 # Merge tree2 into tree
114 tree.merge_from_branch(tree2.branch)114 tree.merge_from_branch(tree2.branch)
115 return tree115 return tree, [base_revid, this_revid, other_revid]
116116
117 def test_kind_parent_tree(self):117 def test_kind_parent_tree(self):
118 tree = self.make_branch_with_merged_deletions()118 tree, [base_revid, this_revid, other_revid] = self.make_branch_with_merged_deletions()
119 tree.lock_read()119 tree.lock_read()
120 self.addCleanup(tree.unlock)120 self.addCleanup(tree.unlock)
121 parents = tree.get_parent_ids()121 parents = tree.get_parent_ids()
122 self.assertEqual(['this', 'other'], parents)122 self.assertEqual([this_revid, other_revid], parents)
123 basis = tree.revision_tree(parents[0])123 basis = tree.revision_tree(parents[0])
124 basis.lock_read()124 basis.lock_read()
125 self.addCleanup(basis.unlock)125 self.addCleanup(basis.unlock)
126126
=== modified file 'breezy/tests/per_workingtree/test_symlinks.py'
--- breezy/tests/per_workingtree/test_symlinks.py 2018-02-21 20:07:48 +0000
+++ breezy/tests/per_workingtree/test_symlinks.py 2018-03-02 01:34:56 +0000
@@ -65,9 +65,15 @@
65 ('tree/dir/',),65 ('tree/dir/',),
66 ('tree/dir/file', 'content'),66 ('tree/dir/file', 'content'),
67 ])67 ])
68 self.assertEqual(68 if tree.has_versioned_directories():
69 tree.smart_add(['tree/link/file']),69 self.assertEqual(
70 ([u'dir', u'dir/file'], {}))70 tree.smart_add(['tree/link/file']),
71 ([u'dir', u'dir/file'], {}))
72 else:
73 self.assertEqual(
74 tree.smart_add(['tree/link/file']),
75 ([u'dir/file'], {}))
76
71 # should add the actual parent directory, not the apparent parent77 # should add the actual parent directory, not the apparent parent
72 # (which is actually a symlink)78 # (which is actually a symlink)
73 self.assertTrue(tree.is_versioned('dir/file'))79 self.assertTrue(tree.is_versioned('dir/file'))

Subscribers

People subscribed via source and target branches