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
1=== modified file 'breezy/tests/per_interbranch/test_push.py'
2--- breezy/tests/per_interbranch/test_push.py 2018-02-28 10:27:45 +0000
3+++ breezy/tests/per_interbranch/test_push.py 2018-03-02 01:34:56 +0000
4@@ -273,7 +273,7 @@
5 self.assertFalse(local.is_locked())
6 local.push(remote)
7 hpss_call_names = [item.call.method for item in self.hpss_calls]
8- self.assertTrue('Repository.insert_stream_1.19' in hpss_call_names)
9+ self.assertIn('Repository.insert_stream_1.19', hpss_call_names)
10 insert_stream_idx = hpss_call_names.index(
11 'Repository.insert_stream_1.19')
12 calls_after_insert_stream = hpss_call_names[insert_stream_idx:]
13
14=== modified file 'breezy/tests/per_workingtree/test_move.py'
15--- breezy/tests/per_workingtree/test_move.py 2018-02-21 20:07:48 +0000
16+++ breezy/tests/per_workingtree/test_move.py 2018-03-02 01:34:56 +0000
17@@ -403,25 +403,28 @@
18 def test_move_directory_with_children_in_subdir(self):
19 tree = self.make_branch_and_tree('.')
20 self.build_tree(['a/', 'a/b', 'a/c/', 'd/'])
21- tree.add(['a', 'a/b', 'a/c', 'd'],
22- ['a-id', 'b-id', 'c-id', 'd-id'])
23+ tree.add(['a', 'a/b', 'a/c', 'd'])
24+ a_id = tree.path2id('a')
25+ b_id = tree.path2id('a/b')
26+ c_id = tree.path2id('a/c')
27+ d_id = tree.path2id('d')
28 tree.commit('initial')
29 root_id = tree.get_root_id()
30
31 tree.rename_one('a/b', 'a/c/b')
32 self.assertTreeLayout([('', root_id),
33- ('a/', 'a-id'),
34- ('d/', 'd-id'),
35- ('a/c/', 'c-id'),
36- ('a/c/b', 'b-id'),
37+ ('a/', a_id),
38+ ('d/', d_id),
39+ ('a/c/', c_id),
40+ ('a/c/b', b_id),
41 ], tree)
42 self.assertEqual([('a', 'd/a')],
43 tree.move(['a'], 'd'))
44 self.assertTreeLayout([('', root_id),
45- ('d/', 'd-id'),
46- ('d/a/', 'a-id'),
47- ('d/a/c/', 'c-id'),
48- ('d/a/c/b', 'b-id'),
49+ ('d/', d_id),
50+ ('d/a/', a_id),
51+ ('d/a/c/', c_id),
52+ ('d/a/c/b', b_id),
53 ], tree)
54 tree._validate()
55
56@@ -474,70 +477,81 @@
57 def test_move_directory_with_moved_children(self):
58 tree = self.make_branch_and_tree('.')
59 self.build_tree(['a/', 'a/b', 'a/c', 'd', 'e/'])
60- tree.add(['a', 'a/b', 'a/c', 'd', 'e'],
61- ['a-id', 'b-id', 'c-id', 'd-id', 'e-id'])
62+ tree.add(['a', 'a/b', 'a/c', 'd', 'e'])
63+ a_id = tree.path2id('a')
64+ b_id = tree.path2id('a/b')
65+ c_id = tree.path2id('a/c')
66+ d_id = tree.path2id('d')
67+ e_id = tree.path2id('e')
68 tree.commit('initial')
69 root_id = tree.get_root_id()
70
71 self.assertEqual([('a/b', 'b')],
72 tree.move(['a/b'], ''))
73 self.assertTreeLayout([('', root_id),
74- ('a/', 'a-id'),
75- ('b', 'b-id'),
76- ('d', 'd-id'),
77- ('e/', 'e-id'),
78- ('a/c', 'c-id'),
79+ ('a/', a_id),
80+ ('b', b_id),
81+ ('d', d_id),
82+ ('e/', e_id),
83+ ('a/c', c_id),
84 ], tree)
85 self.assertEqual([('d', 'a/d')],
86 tree.move(['d'], 'a'))
87 self.assertTreeLayout([('', root_id),
88- ('a/', 'a-id'),
89- ('b', 'b-id'),
90- ('e/', 'e-id'),
91- ('a/c', 'c-id'),
92- ('a/d', 'd-id'),
93+ ('a/', a_id),
94+ ('b', b_id),
95+ ('e/', e_id),
96+ ('a/c', c_id),
97+ ('a/d', d_id),
98 ], tree)
99 self.assertEqual([('a', 'e/a')],
100 tree.move(['a'], 'e'))
101 self.assertTreeLayout([('', root_id),
102- ('b', 'b-id'),
103- ('e/', 'e-id'),
104- ('e/a/', 'a-id'),
105- ('e/a/c', 'c-id'),
106- ('e/a/d', 'd-id'),
107+ ('b', b_id),
108+ ('e/', e_id),
109+ ('e/a/', a_id),
110+ ('e/a/c', c_id),
111+ ('e/a/d', d_id),
112 ], tree)
113 tree._validate()
114
115 def test_move_directory_with_renamed_child(self):
116 tree = self.make_branch_and_tree('.')
117 self.build_tree(['a/', 'a/b', 'a/c', 'd/'])
118- tree.add(['a', 'a/b', 'a/c', 'd'],
119- ['a-id', 'b-id', 'c-id', 'd-id'])
120+ tree.add(['a', 'a/b', 'a/c', 'd'])
121+ a_id = tree.path2id('a')
122+ b_id = tree.path2id('a/b')
123+ c_id = tree.path2id('a/c')
124+ d_id = tree.path2id('d')
125 tree.commit('initial')
126 root_id = tree.get_root_id()
127
128 tree.rename_one('a/b', 'a/d')
129 self.assertTreeLayout([('', root_id),
130- ('a/', 'a-id'),
131- ('d/', 'd-id'),
132- ('a/c', 'c-id'),
133- ('a/d', 'b-id'),
134+ ('a/', a_id),
135+ ('d/', d_id),
136+ ('a/c', c_id),
137+ ('a/d', b_id),
138 ], tree)
139 self.assertEqual([('a', 'd/a')],
140 tree.move(['a'], 'd'))
141 self.assertTreeLayout([('', root_id),
142- ('d/', 'd-id'),
143- ('d/a/', 'a-id'),
144- ('d/a/c', 'c-id'),
145- ('d/a/d', 'b-id'),
146+ ('d/', d_id),
147+ ('d/a/', a_id),
148+ ('d/a/c', c_id),
149+ ('d/a/d', b_id),
150 ], tree)
151 tree._validate()
152
153 def test_move_directory_with_swapped_children(self):
154 tree = self.make_branch_and_tree('.')
155 self.build_tree(['a/', 'a/b', 'a/c', 'a/d', 'e/'])
156- tree.add(['a', 'a/b', 'a/c', 'a/d', 'e'],
157- ['a-id', 'b-id', 'c-id', 'd-id', 'e-id'])
158+ tree.add(['a', 'a/b', 'a/c', 'a/d', 'e'])
159+ a_id = tree.path2id('a')
160+ b_id = tree.path2id('a/b')
161+ c_id = tree.path2id('a/c')
162+ d_id = tree.path2id('a/d')
163+ e_id = tree.path2id('e')
164 tree.commit('initial')
165 root_id = tree.get_root_id()
166
167@@ -545,20 +559,20 @@
168 tree.rename_one('a/d', 'a/b')
169 tree.rename_one('a/bb', 'a/d')
170 self.assertTreeLayout([('', root_id),
171- ('a/', 'a-id'),
172- ('e/', 'e-id'),
173- ('a/b', 'd-id'),
174- ('a/c', 'c-id'),
175- ('a/d', 'b-id'),
176+ ('a/', a_id),
177+ ('e/', e_id),
178+ ('a/b', d_id),
179+ ('a/c', c_id),
180+ ('a/d', b_id),
181 ], tree)
182 self.assertEqual([('a', 'e/a')],
183 tree.move(['a'], 'e'))
184 self.assertTreeLayout([('', root_id),
185- ('e/', 'e-id'),
186- ('e/a/', 'a-id'),
187- ('e/a/b', 'd-id'),
188- ('e/a/c', 'c-id'),
189- ('e/a/d', 'b-id'),
190+ ('e/', e_id),
191+ ('e/a/', a_id),
192+ ('e/a/b', d_id),
193+ ('e/a/c', c_id),
194+ ('e/a/d', b_id),
195 ], tree)
196 tree._validate()
197
198
199=== modified file 'breezy/tests/per_workingtree/test_revision_tree.py'
200--- breezy/tests/per_workingtree/test_revision_tree.py 2018-01-12 08:52:43 +0000
201+++ breezy/tests/per_workingtree/test_revision_tree.py 2018-03-02 01:34:56 +0000
202@@ -101,25 +101,25 @@
203 self.build_tree(files, line_endings='binary',
204 transport=tree.controldir.root_transport)
205 tree.add(files)
206- tree.commit('a, b and b/c', rev_id='base')
207+ base_revid = tree.commit('a, b and b/c')
208 tree2 = tree.controldir.sprout(relpath + '2').open_workingtree()
209 # Delete 'a' in tree
210 tree.remove('a', keep_files=False)
211- tree.commit('remove a', rev_id='this')
212+ this_revid = tree.commit('remove a')
213 # Delete 'c' in tree2
214 tree2.remove('b/c', keep_files=False)
215 tree2.remove('b', keep_files=False)
216- tree2.commit('remove b/c', rev_id='other')
217+ other_revid = tree2.commit('remove b/c')
218 # Merge tree2 into tree
219 tree.merge_from_branch(tree2.branch)
220- return tree
221+ return tree, [base_revid, this_revid, other_revid]
222
223 def test_kind_parent_tree(self):
224- tree = self.make_branch_with_merged_deletions()
225+ tree, [base_revid, this_revid, other_revid] = self.make_branch_with_merged_deletions()
226 tree.lock_read()
227 self.addCleanup(tree.unlock)
228 parents = tree.get_parent_ids()
229- self.assertEqual(['this', 'other'], parents)
230+ self.assertEqual([this_revid, other_revid], parents)
231 basis = tree.revision_tree(parents[0])
232 basis.lock_read()
233 self.addCleanup(basis.unlock)
234
235=== modified file 'breezy/tests/per_workingtree/test_symlinks.py'
236--- breezy/tests/per_workingtree/test_symlinks.py 2018-02-21 20:07:48 +0000
237+++ breezy/tests/per_workingtree/test_symlinks.py 2018-03-02 01:34:56 +0000
238@@ -65,9 +65,15 @@
239 ('tree/dir/',),
240 ('tree/dir/file', 'content'),
241 ])
242- self.assertEqual(
243- tree.smart_add(['tree/link/file']),
244- ([u'dir', u'dir/file'], {}))
245+ if tree.has_versioned_directories():
246+ self.assertEqual(
247+ tree.smart_add(['tree/link/file']),
248+ ([u'dir', u'dir/file'], {}))
249+ else:
250+ self.assertEqual(
251+ tree.smart_add(['tree/link/file']),
252+ ([u'dir/file'], {}))
253+
254 # should add the actual parent directory, not the apparent parent
255 # (which is actually a symlink)
256 self.assertTrue(tree.is_versioned('dir/file'))

Subscribers

People subscribed via source and target branches