Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | no longer in the source branch. |
Merge reported by: | The Breezy Bot |
Merged at revision: | not available |
Proposed branch: | lp:~jelmer/brz/conflicts |
Merge into: | lp:brz |
Diff against target: |
1672 lines (+303/-299) 35 files modified
breezy/branchbuilder.py (+14/-20) breezy/merge.py (+8/-7) breezy/plugins/commitfromnews/tests/test_committemplate.py (+4/-4) breezy/plugins/po_merge/tests/test_po_merge.py (+4/-4) breezy/tests/blackbox/test_dpush.py (+1/-1) breezy/tests/blackbox/test_merge.py (+2/-2) breezy/tests/blackbox/test_push.py (+3/-3) breezy/tests/per_branch/test_create_clone.py (+2/-2) breezy/tests/per_branch/test_iter_merge_sorted_revisions.py (+2/-2) breezy/tests/per_branch/test_push.py (+1/-1) breezy/tests/per_interbranch/test_push.py (+4/-4) breezy/tests/per_interrepository/test_fetch.py (+15/-15) breezy/tests/per_merger.py (+2/-2) breezy/tests/per_pack_repository.py (+1/-1) breezy/tests/per_repository/test_fetch.py (+9/-9) breezy/tests/per_repository/test_repository.py (+1/-1) breezy/tests/per_repository_chk/test_supported.py (+1/-1) breezy/tests/per_repository_reference/test_fetch.py (+6/-6) breezy/tests/per_repository_reference/test_get_record_stream.py (+6/-6) breezy/tests/per_repository_reference/test_unlock.py (+2/-2) breezy/tests/per_repository_vf/test_fileid_involved.py (+2/-2) breezy/tests/per_repository_vf/test_merge_directive.py (+1/-1) breezy/tests/per_workingtree/test_annotate_iter.py (+19/-19) breezy/tests/per_workingtree/test_merge_from_branch.py (+9/-12) breezy/tests/per_workingtree/test_pull.py (+1/-1) breezy/tests/per_workingtree/test_workingtree.py (+4/-4) breezy/tests/test_annotate.py (+12/-12) breezy/tests/test_branchbuilder.py (+8/-8) breezy/tests/test_bundle.py (+1/-1) breezy/tests/test_conflicts.py (+26/-14) breezy/tests/test_knit.py (+4/-4) breezy/tests/test_merge.py (+55/-55) breezy/tests/test_merge_core.py (+1/-1) breezy/tests/test_repository.py (+70/-70) breezy/tests/test_workingtree_4.py (+2/-2) |
To merge this branch: | bzr merge lp:~jelmer/brz/conflicts |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman | Approve | ||
Review via email: mp+341069@code.launchpad.net |
Commit message
Description of the change
Change arguments for 'modify' and 'unversion' in BranchBuilder.
To post a comment you must log in.
Revision history for this message
The Breezy Bot (the-breezy-bot) wrote : | # |
Running landing tests failed
https:/
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'breezy/branchbuilder.py' |
2 | --- breezy/branchbuilder.py 2018-03-25 00:39:16 +0000 |
3 | +++ breezy/branchbuilder.py 2018-03-27 00:52:31 +0000 |
4 | @@ -194,8 +194,8 @@ |
5 | It can be None, which indicates to use the last commit. |
6 | :param actions: A list of actions to perform. Supported actions are: |
7 | ('add', ('path', 'file-id', 'kind', 'content' or None)) |
8 | - ('modify', ('file-id', 'new-content')) |
9 | - ('unversion', 'file-id') |
10 | + ('modify', ('path', 'new-content')) |
11 | + ('unversion', 'path') |
12 | ('rename', ('orig-path', 'new-path')) |
13 | ('flush', None) |
14 | :param message: An optional commit message, if not supplied, a default |
15 | @@ -224,8 +224,7 @@ |
16 | tree = self._tree |
17 | else: |
18 | tree = self._branch.create_memorytree() |
19 | - tree.lock_write() |
20 | - try: |
21 | + with tree.lock_write(): |
22 | if parent_ids is not None: |
23 | tree.set_parent_ids(parent_ids, |
24 | allow_leftmost_as_ghost=allow_leftmost_as_ghost) |
25 | @@ -244,12 +243,12 @@ |
26 | pending.to_add_file_ids.append(file_id) |
27 | pending.to_add_kinds.append(kind) |
28 | if content is not None: |
29 | - pending.new_contents[file_id] = content |
30 | + pending.new_contents[path] = content |
31 | elif action == 'modify': |
32 | - file_id, content = info |
33 | - pending.new_contents[file_id] = content |
34 | + path, content = info |
35 | + pending.new_contents[path] = content |
36 | elif action == 'unversion': |
37 | - pending.to_unversion_ids.add(info) |
38 | + pending.to_unversion_paths.add(info) |
39 | elif action == 'rename': |
40 | from_relpath, to_relpath = info |
41 | pending.to_rename.append((from_relpath, to_relpath)) |
42 | @@ -262,30 +261,25 @@ |
43 | return self._do_commit(tree, message=message, rev_id=revision_id, |
44 | timestamp=timestamp, timezone=timezone, committer=committer, |
45 | message_callback=message_callback) |
46 | - finally: |
47 | - tree.unlock() |
48 | |
49 | def _flush_pending(self, tree, pending): |
50 | """Flush the pending actions in 'pending', i.e. apply them to 'tree'.""" |
51 | for path, file_id in pending.to_add_directories: |
52 | if path == '': |
53 | - old_id = tree.path2id(path) |
54 | - if old_id is not None and old_id in pending.to_unversion_ids: |
55 | + if tree.has_filename(path) and path in pending.to_unversion_paths: |
56 | # We're overwriting this path, no need to unversion |
57 | - pending.to_unversion_ids.discard(old_id) |
58 | + pending.to_unversion_paths.discard(path) |
59 | # Special case, because the path already exists |
60 | tree.add([path], [file_id], ['directory']) |
61 | else: |
62 | tree.mkdir(path, file_id) |
63 | for from_relpath, to_relpath in pending.to_rename: |
64 | tree.rename_one(from_relpath, to_relpath) |
65 | - if pending.to_unversion_ids: |
66 | - tree.unversion([tree.id2path(fid) for fid in pending.to_unversion_ids]) |
67 | + if pending.to_unversion_paths: |
68 | + tree.unversion(pending.to_unversion_paths) |
69 | tree.add(pending.to_add_files, pending.to_add_file_ids, pending.to_add_kinds) |
70 | - for file_id, content in viewitems(pending.new_contents): |
71 | - tree.put_file_bytes_non_atomic( |
72 | - tree.id2path(file_id), content, |
73 | - file_id=file_id) |
74 | + for path, content in viewitems(pending.new_contents): |
75 | + tree.put_file_bytes_non_atomic(path, content) |
76 | |
77 | def get_branch(self): |
78 | """Return the branch created by the builder.""" |
79 | @@ -305,6 +299,6 @@ |
80 | self.to_add_file_ids = [] |
81 | self.to_add_kinds = [] |
82 | self.new_contents = {} |
83 | - self.to_unversion_ids = set() |
84 | + self.to_unversion_paths = set() |
85 | self.to_rename = [] |
86 | |
87 | |
88 | === modified file 'breezy/merge.py' |
89 | --- breezy/merge.py 2018-03-25 02:13:54 +0000 |
90 | +++ breezy/merge.py 2018-03-27 00:52:31 +0000 |
91 | @@ -1190,15 +1190,16 @@ |
92 | # At this point, the lcas disagree, and the tip disagree |
93 | return 'conflict' |
94 | |
95 | - def merge_names(self, file_id): |
96 | - def get_entry(tree): |
97 | + def merge_names(self, paths): |
98 | + def get_entry(tree, path): |
99 | try: |
100 | - return tree.root_inventory.get_entry(file_id) |
101 | - except errors.NoSuchId: |
102 | + return next(tree.iter_entries_by_dir(specific_files=[path]))[1] |
103 | + except StopIteration: |
104 | return None |
105 | - this_entry = get_entry(self.this_tree) |
106 | - other_entry = get_entry(self.other_tree) |
107 | - base_entry = get_entry(self.base_tree) |
108 | + used_base_path, other_path, this_path = paths |
109 | + this_entry = get_entry(self.this_tree, this_path) |
110 | + other_entry = get_entry(self.other_tree, other_path) |
111 | + base_entry = get_entry(self.base_tree, base_path) |
112 | entries = (base_entry, other_entry, this_entry) |
113 | names = [] |
114 | parents = [] |
115 | |
116 | === modified file 'breezy/plugins/commitfromnews/tests/test_committemplate.py' |
117 | --- breezy/plugins/commitfromnews/tests/test_committemplate.py 2018-02-18 15:21:06 +0000 |
118 | +++ breezy/plugins/commitfromnews/tests/test_committemplate.py 2018-03-27 00:52:31 +0000 |
119 | @@ -95,7 +95,7 @@ |
120 | builder = self.make_branch_builder('test') |
121 | builder.start_series() |
122 | orig_content = INITIAL_NEWS_CONTENT |
123 | - mod_content = """---------------------------- |
124 | + mod_content = b"""---------------------------- |
125 | commitfromnews release notes |
126 | ---------------------------- |
127 | |
128 | @@ -118,7 +118,7 @@ |
129 | ('add', ('NEWS', b'foo-id', 'file', orig_content)), |
130 | ], revision_id=b'BASE-id') |
131 | builder.build_snapshot(None, |
132 | - [('modify', (b'foo-id', mod_content)), |
133 | + [('modify', ('NEWS', mod_content)), |
134 | ], |
135 | message_callback=msgeditor.generate_commit_message_template) |
136 | builder.finish_series() |
137 | @@ -130,7 +130,7 @@ |
138 | builder = self.make_branch_builder('test') |
139 | builder.start_series() |
140 | orig_content = INITIAL_NEWS_CONTENT |
141 | - mod_content = """---------------------------- |
142 | + mod_content = b"""---------------------------- |
143 | commitfromnews release notes |
144 | ---------------------------- |
145 | |
146 | @@ -155,7 +155,7 @@ |
147 | ('add', ('NEWS', b'foo-id', 'file', orig_content)), |
148 | ], revision_id=b'BASE-id') |
149 | builder.build_snapshot(None, |
150 | - [('modify', (b'foo-id', mod_content)), |
151 | + [('modify', ('NEWS', mod_content)), |
152 | ], |
153 | message_callback=msgeditor.generate_commit_message_template) |
154 | builder.finish_series() |
155 | |
156 | === modified file 'breezy/plugins/po_merge/tests/test_po_merge.py' |
157 | --- breezy/plugins/po_merge/tests/test_po_merge.py 2018-02-18 15:21:06 +0000 |
158 | +++ breezy/plugins/po_merge/tests/test_po_merge.py 2018-03-27 00:52:31 +0000 |
159 | @@ -103,15 +103,15 @@ |
160 | ], revision_id=b'base') |
161 | # The 'other' branch |
162 | builder.build_snapshot(['base'], |
163 | - [('modify', (b'pot-id', |
164 | + [('modify', ('po/adduser.pot', |
165 | _Adduser['other_pot'])), |
166 | - ('modify', (b'po-id', |
167 | + ('modify', ('po/fr.po', |
168 | _Adduser['other_po'])), |
169 | ], revision_id=b'other') |
170 | # The 'this' branch |
171 | builder.build_snapshot(['base'], |
172 | - [('modify', (b'pot-id', _Adduser['this_pot'])), |
173 | - ('modify', (b'po-id', _Adduser['this_po'])), |
174 | + [('modify', ('po/adduser.pot', _Adduser['this_pot'])), |
175 | + ('modify', ('po/fr.po', _Adduser['this_po'])), |
176 | ], revision_id=b'this') |
177 | # builder.get_branch() tip is now 'this' |
178 | builder.finish_series() |
179 | |
180 | === modified file 'breezy/tests/blackbox/test_dpush.py' |
181 | --- breezy/tests/blackbox/test_dpush.py 2018-02-18 15:21:06 +0000 |
182 | +++ breezy/tests/blackbox/test_dpush.py 2018-03-27 00:52:31 +0000 |
183 | @@ -130,7 +130,7 @@ |
184 | dc_tree.commit('msg1') |
185 | |
186 | builder.build_snapshot(None, |
187 | - [('modify', (b'fooid', 'blie'))], revision_id=b'revid2') |
188 | + [('modify', ('foo', b'blie'))], revision_id=b'revid2') |
189 | |
190 | output, error = self.run_bzr("dpush -d dc d", retcode=3) |
191 | self.assertEqual(output, "") |
192 | |
193 | === modified file 'breezy/tests/blackbox/test_merge.py' |
194 | --- breezy/tests/blackbox/test_merge.py 2018-03-25 00:39:16 +0000 |
195 | +++ breezy/tests/blackbox/test_merge.py 2018-03-27 00:52:31 +0000 |
196 | @@ -68,11 +68,11 @@ |
197 | ('add', ('fname', 'f-id', 'file', 'a\nb\nc\n'))], |
198 | revision_id=b'rev1') |
199 | builder.build_snapshot(['rev1'], |
200 | - [('modify', ('f-id', 'a\nB\nD\n'))], |
201 | + [('modify', ('fname', b'a\nB\nD\n'))], |
202 | revision_id=b'rev2other') |
203 | other = builder.get_branch().controldir.sprout('other').open_branch() |
204 | builder.build_snapshot(['rev1'], |
205 | - [('modify', ('f-id', 'a\nB\nC\n'))], revision_id=b'rev2this') |
206 | + [('modify', ('fname', b'a\nB\nC\n'))], revision_id=b'rev2this') |
207 | tree = builder.get_branch().create_checkout('tree', lightweight=True) |
208 | return tree, other |
209 | |
210 | |
211 | === modified file 'breezy/tests/blackbox/test_push.py' |
212 | --- breezy/tests/blackbox/test_push.py 2018-02-18 15:21:06 +0000 |
213 | +++ breezy/tests/blackbox/test_push.py 2018-03-27 00:52:31 +0000 |
214 | @@ -579,9 +579,9 @@ |
215 | ('add', ('', 'root-id', 'directory', '')), |
216 | ('add', ('filename', 'f-id', 'file', 'content\n'))], |
217 | revision_id=b'rev-1') |
218 | - builder.build_snapshot(['rev-1'], [], revision_id=b'rev-2') |
219 | - builder.build_snapshot(['rev-2'], |
220 | - [('modify', ('f-id', 'new-content\n'))], |
221 | + builder.build_snapshot([b'rev-1'], [], revision_id=b'rev-2') |
222 | + builder.build_snapshot([b'rev-2'], |
223 | + [('modify', ('filename', b'new-content\n'))], |
224 | revision_id=b'rev-3') |
225 | builder.finish_series() |
226 | branch = builder.get_branch() |
227 | |
228 | === modified file 'breezy/tests/per_branch/test_create_clone.py' |
229 | --- breezy/tests/per_branch/test_create_clone.py 2017-11-16 00:39:04 +0000 |
230 | +++ breezy/tests/per_branch/test_create_clone.py 2018-03-27 00:52:31 +0000 |
231 | @@ -115,10 +115,10 @@ |
232 | raise tests.TestNotApplicable('format not directly constructable') |
233 | builder.start_series() |
234 | rev1 = builder.build_snapshot(None, [ |
235 | - ('add', ('', 'root-id', 'directory', ''))]) |
236 | + ('add', ('', None, 'directory', ''))]) |
237 | rev2 = builder.build_snapshot([rev1], []) |
238 | other = builder.build_snapshot(None, [ |
239 | - ('add', ('', 'root-id', 'directory', ''))]) |
240 | + ('add', ('', None, 'directory', ''))]) |
241 | rev3 = builder.build_snapshot([rev2, other], []) |
242 | builder.finish_series() |
243 | local = builder.get_branch() |
244 | |
245 | === modified file 'breezy/tests/per_branch/test_iter_merge_sorted_revisions.py' |
246 | --- breezy/tests/per_branch/test_iter_merge_sorted_revisions.py 2018-02-18 15:21:06 +0000 |
247 | +++ breezy/tests/per_branch/test_iter_merge_sorted_revisions.py 2018-03-27 00:52:31 +0000 |
248 | @@ -38,7 +38,7 @@ |
249 | def make_snapshot(self, builder, parents, revid_name): |
250 | self.assertNotIn(revid_name, self.revids) |
251 | if parents is None: |
252 | - files = [('add', ('', 'TREE_ROOT', 'directory', '')),] |
253 | + files = [('add', ('', None, 'directory', '')),] |
254 | else: |
255 | parents = [self.revids[name] for name in parents] |
256 | files = [] |
257 | @@ -168,7 +168,7 @@ |
258 | def make_snapshot(self, builder, parents, revid_name): |
259 | self.assertNotIn(revid_name, self.revids) |
260 | if parents is None: |
261 | - files = [('add', ('', 'TREE_ROOT', 'directory', '')),] |
262 | + files = [('add', ('', None, 'directory', '')),] |
263 | else: |
264 | parents = [self.revids[name] for name in parents] |
265 | files = [] |
266 | |
267 | === modified file 'breezy/tests/per_branch/test_push.py' |
268 | --- breezy/tests/per_branch/test_push.py 2018-02-27 18:44:59 +0000 |
269 | +++ breezy/tests/per_branch/test_push.py 2018-03-27 00:52:31 +0000 |
270 | @@ -285,7 +285,7 @@ |
271 | ('add', ('filename', 'f-id', 'file', 'content\n'))]) |
272 | revid2 = builder.build_snapshot([revid1], []) |
273 | revid3 = builder.build_snapshot([revid2], |
274 | - [('modify', ('f-id', 'new-content\n'))]) |
275 | + [('modify', ('filename', 'new-content\n'))]) |
276 | builder.finish_series() |
277 | trunk = builder.get_branch() |
278 | # Sprout rev-1 to "trunk", so that we can stack on it. |
279 | |
280 | === modified file 'breezy/tests/per_interbranch/test_push.py' |
281 | --- breezy/tests/per_interbranch/test_push.py 2018-03-06 21:57:52 +0000 |
282 | +++ breezy/tests/per_interbranch/test_push.py 2018-03-27 00:52:31 +0000 |
283 | @@ -266,11 +266,11 @@ |
284 | 'BranchBuilder can not initialize some formats') |
285 | builder.start_series() |
286 | revid1 = builder.build_snapshot(None, [ |
287 | - ('add', ('', 'root-id', 'directory', '')), |
288 | - ('add', ('filename', 'f-id', 'file', 'content\n'))]) |
289 | + ('add', ('', None, 'directory', '')), |
290 | + ('add', ('filename', None, 'file', 'content\n'))]) |
291 | revid2 = builder.build_snapshot([revid1], []) |
292 | revid3 = builder.build_snapshot([revid2], |
293 | - [('modify', ('f-id', 'new-content\n'))]) |
294 | + [('modify', ('filename', 'new-content\n'))]) |
295 | builder.finish_series() |
296 | trunk = builder.get_branch() |
297 | # Sprout rev-1 to "trunk", so that we can stack on it. |
298 | @@ -304,7 +304,7 @@ |
299 | raise tests.TestNotApplicable('format not directly constructable') |
300 | builder.start_series() |
301 | first = builder.build_snapshot(None, [ |
302 | - ('add', ('', 'root-id', 'directory', ''))]) |
303 | + ('add', ('', None, 'directory', ''))]) |
304 | second = builder.build_snapshot([first], []) |
305 | third = builder.build_snapshot([second], []) |
306 | fourth = builder.build_snapshot([third], []) |
307 | |
308 | === modified file 'breezy/tests/per_interrepository/test_fetch.py' |
309 | --- breezy/tests/per_interrepository/test_fetch.py 2018-03-25 11:39:36 +0000 |
310 | +++ breezy/tests/per_interrepository/test_fetch.py 2018-03-27 00:52:31 +0000 |
311 | @@ -156,10 +156,10 @@ |
312 | ('add', ('file', 'file-id', 'file', 'content\n'))], |
313 | revision_id=b'first') |
314 | builder.build_snapshot(['first'], [ |
315 | - ('modify', ('file-id', 'second content\n'))], |
316 | + ('modify', ('file', b'second content\n'))], |
317 | revision_id=b'second') |
318 | - builder.build_snapshot(['second'], [ |
319 | - ('modify', ('file-id', 'third content\n'))], |
320 | + builder.build_snapshot([b'second'], [ |
321 | + ('modify', ('file', b'third content\n'))], |
322 | revision_id=b'third') |
323 | builder.finish_series() |
324 | branch = builder.get_branch() |
325 | @@ -207,16 +207,16 @@ |
326 | builder.start_series() |
327 | builder.build_snapshot(None, [ |
328 | ('add', ('', b'root-id', 'directory', '')), |
329 | - ('add', ('file', b'file-id', 'file', b'content\n'))], |
330 | + ('add', ('file', b'file-id', 'file', 'content\n'))], |
331 | revision_id=b'base') |
332 | builder.build_snapshot([b'base'], [ |
333 | - ('modify', (b'file-id', b'left content\n'))], |
334 | + ('modify', ('file', b'left content\n'))], |
335 | revision_id=b'left') |
336 | builder.build_snapshot([b'base'], [ |
337 | - ('modify', (b'file-id', b'right content\n'))], |
338 | + ('modify', ('file', b'right content\n'))], |
339 | revision_id=b'right') |
340 | builder.build_snapshot([b'left', b'right'], [ |
341 | - ('modify', (b'file-id', b'left and right content\n'))], |
342 | + ('modify', ('file', b'left and right content\n'))], |
343 | revision_id=b'merge') |
344 | builder.finish_series() |
345 | branch = builder.get_branch() |
346 | @@ -284,10 +284,10 @@ |
347 | ('add', ('file', b'file-id', 'file', b'content\n'))], |
348 | revision_id=b'base') |
349 | builder.build_snapshot([b'base'], [ |
350 | - ('modify', (b'file-id', b'second content\n'))], |
351 | + ('modify', ('file', b'second content\n'))], |
352 | revision_id=b'second') |
353 | builder.build_snapshot([b'second', b'ghost'], [ |
354 | - ('modify', (b'file-id', 'third content\n'))], |
355 | + ('modify', ('file', b'third content\n'))], |
356 | revision_id=b'third') |
357 | builder.finish_series() |
358 | branch = builder.get_branch() |
359 | @@ -347,14 +347,14 @@ |
360 | ('add', ('', 'root-id', 'directory', '')), |
361 | ('add', ('file', 'file-id', 'file', 'content\n'))], |
362 | revision_id=b'base') |
363 | - builder.build_snapshot(['base'], [ |
364 | - ('modify', ('file-id', 'left content\n'))], |
365 | + builder.build_snapshot([b'base'], [ |
366 | + ('modify', ('file', b'left content\n'))], |
367 | revision_id=b'left') |
368 | - builder.build_snapshot(['base'], [ |
369 | - ('modify', ('file-id', 'right content\n'))], |
370 | + builder.build_snapshot([b'base'], [ |
371 | + ('modify', ('file', b'right content\n'))], |
372 | revision_id=b'right') |
373 | - builder.build_snapshot(['left', 'right'], [ |
374 | - ('modify', ('file-id', 'left and right content\n'))], |
375 | + builder.build_snapshot([b'left', b'right'], [ |
376 | + ('modify', ('file', b'left and right content\n'))], |
377 | revision_id=b'merge') |
378 | builder.finish_series() |
379 | branch = builder.get_branch() |
380 | |
381 | === modified file 'breezy/tests/per_merger.py' |
382 | --- breezy/tests/per_merger.py 2018-02-18 15:21:06 +0000 |
383 | +++ breezy/tests/per_merger.py 2018-03-27 00:52:31 +0000 |
384 | @@ -131,11 +131,11 @@ |
385 | ], revision_id=b'BASE-id') |
386 | # Delete 'b\n' |
387 | builder.build_snapshot([b'BASE-id'], |
388 | - [('modify', (b'foo-id', b'a\nc\nd\ne\n'))], |
389 | + [('modify', ('foo', b'a\nc\nd\ne\n'))], |
390 | revision_id=b'OTHER-id') |
391 | # Modify 'b\n', add 'X\n' |
392 | builder.build_snapshot([b'BASE-id'], |
393 | - [('modify', (b'foo-id', b'a\nb2\nc\nd\nX\ne\n'))], |
394 | + [('modify', ('foo', b'a\nb2\nc\nd\nX\ne\n'))], |
395 | revision_id=b'THIS-id') |
396 | builder.finish_series() |
397 | branch = builder.get_branch() |
398 | |
399 | === modified file 'breezy/tests/per_pack_repository.py' |
400 | --- breezy/tests/per_pack_repository.py 2018-02-18 15:21:06 +0000 |
401 | +++ breezy/tests/per_pack_repository.py 2018-03-27 00:52:31 +0000 |
402 | @@ -324,7 +324,7 @@ |
403 | ('add', ('file', 'file-id', 'file', 'B content\n'))], |
404 | revision_id=b'B-id') |
405 | builder.build_snapshot(None, [ |
406 | - ('modify', ('file-id', 'C content\n'))], |
407 | + ('modify', ('file', b'C content\n'))], |
408 | revision_id=b'C-id') |
409 | builder.finish_series() |
410 | b = builder.get_branch() |
411 | |
412 | === modified file 'breezy/tests/per_repository/test_fetch.py' |
413 | --- breezy/tests/per_repository/test_fetch.py 2018-03-08 23:32:04 +0000 |
414 | +++ breezy/tests/per_repository/test_fetch.py 2018-03-27 00:52:31 +0000 |
415 | @@ -195,7 +195,7 @@ |
416 | self.do_test_fetch_to_rich_root_sets_parents_correctly( |
417 | (), |
418 | [('base', None, [('add', ('', ROOT_ID, 'directory', ''))]), |
419 | - ('tip', None, [('unversion', ROOT_ID), |
420 | + ('tip', None, [('unversion', ''), |
421 | ('add', ('', 'my-root', 'directory', '')), |
422 | ]), |
423 | ], root_id='my-root') |
424 | @@ -208,8 +208,8 @@ |
425 | [('origin', None, [('add', ('', ROOT_ID, 'directory', '')), |
426 | ('add', ('child', 'my-root', 'directory', ''))]), |
427 | ('base', None, []), |
428 | - ('tip', None, [('unversion', 'my-root'), |
429 | - ('unversion', ROOT_ID), |
430 | + ('tip', None, [('unversion', 'child'), |
431 | + ('unversion', ''), |
432 | ('flush', None), |
433 | ('add', ('', 'my-root', 'directory', '')), |
434 | ]), |
435 | @@ -220,9 +220,9 @@ |
436 | self.do_test_fetch_to_rich_root_sets_parents_correctly( |
437 | (('my-root', 'right'),), |
438 | [('base', None, [('add', ('', ROOT_ID, 'directory', ''))]), |
439 | - ('right', None, [('unversion', ROOT_ID), |
440 | + ('right', None, [('unversion', ''), |
441 | ('add', ('', 'my-root', 'directory', ''))]), |
442 | - ('tip', ['base', 'right'], [('unversion', ROOT_ID), |
443 | + ('tip', ['base', 'right'], [('unversion', ''), |
444 | ('add', ('', 'my-root', 'directory', '')), |
445 | ]), |
446 | ], root_id='my-root') |
447 | @@ -237,12 +237,12 @@ |
448 | ('add', ('child', 'my-root', 'directory', ''))]), |
449 | ('base', None, []), |
450 | # 'my-root' at root |
451 | - ('right', None, [('unversion', 'my-root'), |
452 | - ('unversion', ROOT_ID), |
453 | + ('right', None, [('unversion', 'child'), |
454 | + ('unversion', ''), |
455 | ('flush', None), |
456 | ('add', ('', 'my-root', 'directory', ''))]), |
457 | - ('tip', ['base', 'right'], [('unversion', 'my-root'), |
458 | - ('unversion', ROOT_ID), |
459 | + ('tip', ['base', 'right'], [('unversion', ''), |
460 | + ('unversion', 'child'), |
461 | ('flush', None), |
462 | ('add', ('', 'my-root', 'directory', '')), |
463 | ]), |
464 | |
465 | === modified file 'breezy/tests/per_repository/test_repository.py' |
466 | --- breezy/tests/per_repository/test_repository.py 2018-03-25 00:39:16 +0000 |
467 | +++ breezy/tests/per_repository/test_repository.py 2018-03-27 00:52:31 +0000 |
468 | @@ -594,7 +594,7 @@ |
469 | builder = self.make_branch_builder('.') |
470 | builder.start_series() |
471 | rev_a = builder.build_snapshot(None, [ |
472 | - ('add', ('', 'root-id', 'directory', None))]) |
473 | + ('add', ('', None, 'directory', None))]) |
474 | builder.finish_series() |
475 | b = builder.get_branch() |
476 | b.lock_write() |
477 | |
478 | === modified file 'breezy/tests/per_repository_chk/test_supported.py' |
479 | --- breezy/tests/per_repository_chk/test_supported.py 2017-11-16 00:39:04 +0000 |
480 | +++ breezy/tests/per_repository_chk/test_supported.py 2018-03-27 00:52:31 +0000 |
481 | @@ -351,7 +351,7 @@ |
482 | ('add', ('file-' + name, 'file-%s-id' % name, 'file', |
483 | 'content %s\n' % name))) |
484 | file_modifies.append( |
485 | - ('modify', ('file-%s-id' % name, 'new content %s\n' % name))) |
486 | + ('modify', ('file-' + name, 'new content %s\n' % name))) |
487 | builder.build_snapshot(None, [ |
488 | ('add', ('', 'root-id', 'directory', None))] + |
489 | file_adds, |
490 | |
491 | === modified file 'breezy/tests/per_repository_reference/test_fetch.py' |
492 | --- breezy/tests/per_repository_reference/test_fetch.py 2018-02-17 02:02:38 +0000 |
493 | +++ breezy/tests/per_repository_reference/test_fetch.py 2018-03-27 00:52:31 +0000 |
494 | @@ -29,22 +29,22 @@ |
495 | def make_source_branch(self): |
496 | # It would be nice if there was a way to force this to be memory-only |
497 | builder = self.make_branch_builder('source') |
498 | - content = ['content lines\n' |
499 | - 'for the first revision\n' |
500 | - 'which is a marginal amount of content\n' |
501 | + content = [b'content lines\n' |
502 | + b'for the first revision\n' |
503 | + b'which is a marginal amount of content\n' |
504 | ] |
505 | builder.start_series() |
506 | builder.build_snapshot(None, [ |
507 | ('add', ('', b'root-id', 'directory', None)), |
508 | ('add', ('a', b'a-id', 'file', ''.join(content))), |
509 | ], revision_id=b'A-id') |
510 | - content.append('and some more lines for B\n') |
511 | + content.append(b'and some more lines for B\n') |
512 | builder.build_snapshot([b'A-id'], [ |
513 | - ('modify', (b'a-id', ''.join(content)))], |
514 | + ('modify', ('a', b''.join(content)))], |
515 | revision_id=b'B-id') |
516 | content.append('and yet even more content for C\n') |
517 | builder.build_snapshot([b'B-id'], [ |
518 | - ('modify', (b'a-id', ''.join(content)))], |
519 | + ('modify', ('a', b''.join(content)))], |
520 | revision_id=b'C-id') |
521 | builder.finish_series() |
522 | source_b = builder.get_branch() |
523 | |
524 | === modified file 'breezy/tests/per_repository_reference/test_get_record_stream.py' |
525 | --- breezy/tests/per_repository_reference/test_get_record_stream.py 2017-11-16 00:39:04 +0000 |
526 | +++ breezy/tests/per_repository_reference/test_get_record_stream.py 2018-03-27 00:52:31 +0000 |
527 | @@ -50,31 +50,31 @@ |
528 | ('add', ('file', 'f-id', 'file', 'initial content\n')), |
529 | ], revision_id='A') |
530 | builder.build_snapshot(['A'], [ |
531 | - ('modify', ('f-id', 'initial content\n' |
532 | + ('modify', ('file', 'initial content\n' |
533 | 'and B content\n')), |
534 | ], revision_id='B') |
535 | builder.build_snapshot(['A'], [ |
536 | - ('modify', ('f-id', 'initial content\n' |
537 | + ('modify', ('file', 'initial content\n' |
538 | 'and C content\n')), |
539 | ], revision_id='C') |
540 | builder.build_snapshot(['B', 'C'], [ |
541 | - ('modify', ('f-id', 'initial content\n' |
542 | + ('modify', ('file', 'initial content\n' |
543 | 'and B content\n' |
544 | 'and C content\n')), |
545 | ], revision_id='D') |
546 | builder.build_snapshot(['C'], [ |
547 | - ('modify', ('f-id', 'initial content\n' |
548 | + ('modify', ('file', 'initial content\n' |
549 | 'and C content\n' |
550 | 'and E content\n')), |
551 | ], revision_id='E') |
552 | builder.build_snapshot(['D'], [ |
553 | - ('modify', ('f-id', 'initial content\n' |
554 | + ('modify', ('file', 'initial content\n' |
555 | 'and B content\n' |
556 | 'and C content\n' |
557 | 'and F content\n')), |
558 | ], revision_id='F') |
559 | builder.build_snapshot(['E', 'D'], [ |
560 | - ('modify', ('f-id', 'initial content\n' |
561 | + ('modify', ('file', 'initial content\n' |
562 | 'and B content\n' |
563 | 'and C content\n' |
564 | 'and E content\n')), |
565 | |
566 | === modified file 'breezy/tests/per_repository_reference/test_unlock.py' |
567 | --- breezy/tests/per_repository_reference/test_unlock.py 2017-11-16 00:39:04 +0000 |
568 | +++ breezy/tests/per_repository_reference/test_unlock.py 2018-03-27 00:52:31 +0000 |
569 | @@ -39,10 +39,10 @@ |
570 | ('add', ('file', 'file-id', 'file', 'contents\n'))], |
571 | revision_id='A-id') |
572 | builder.build_snapshot(['A-id'], [ |
573 | - ('modify', ('file-id', 'new-content\n'))], |
574 | + ('modify', ('file', 'new-content\n'))], |
575 | revision_id='B-id') |
576 | builder.build_snapshot(['B-id'], [ |
577 | - ('modify', ('file-id', 'yet more content\n'))], |
578 | + ('modify', ('file', 'yet more content\n'))], |
579 | revision_id='C-id') |
580 | builder.finish_series() |
581 | source_b = builder.get_branch() |
582 | |
583 | === modified file 'breezy/tests/per_repository_vf/test_fileid_involved.py' |
584 | --- breezy/tests/per_repository_vf/test_fileid_involved.py 2018-03-24 23:36:29 +0000 |
585 | +++ breezy/tests/per_repository_vf/test_fileid_involved.py 2018-03-27 00:52:31 +0000 |
586 | @@ -100,10 +100,10 @@ |
587 | ('add', ('file', 'file-id', 'file', 'contents\n'))], |
588 | revision_id='A-id') |
589 | builder.build_snapshot(['A-id'], [ |
590 | - ('modify', ('file-id', 'new-content\n'))], |
591 | + ('modify', ('file', 'new-content\n'))], |
592 | revision_id='B-id') |
593 | builder.build_snapshot(['B-id'], [ |
594 | - ('modify', ('file-id', 'yet more content\n'))], |
595 | + ('modify', ('file', 'yet more content\n'))], |
596 | revision_id='C-id') |
597 | builder.finish_series() |
598 | source_b = builder.get_branch() |
599 | |
600 | === modified file 'breezy/tests/per_repository_vf/test_merge_directive.py' |
601 | --- breezy/tests/per_repository_vf/test_merge_directive.py 2017-11-19 18:35:20 +0000 |
602 | +++ breezy/tests/per_repository_vf/test_merge_directive.py 2018-03-27 00:52:31 +0000 |
603 | @@ -48,7 +48,7 @@ |
604 | ('add', ('f', 'f-id', 'file', 'initial content\n')), |
605 | ], revision_id='A') |
606 | builder.build_snapshot('A', [ |
607 | - ('modify', ('f-id', 'new content\n')), |
608 | + ('modify', ('f', 'new content\n')), |
609 | ], revision_id='B') |
610 | builder.finish_series() |
611 | b1 = builder.get_branch() |
612 | |
613 | === modified file 'breezy/tests/per_workingtree/test_annotate_iter.py' |
614 | --- breezy/tests/per_workingtree/test_annotate_iter.py 2018-02-18 15:21:06 +0000 |
615 | +++ breezy/tests/per_workingtree/test_annotate_iter.py 2018-03-27 00:52:31 +0000 |
616 | @@ -24,8 +24,8 @@ |
617 | def make_single_rev_tree(self): |
618 | builder = self.make_branch_builder('branch') |
619 | revid = builder.build_snapshot(None, [ |
620 | - ('add', ('', 'TREE_ROOT', 'directory', None)), |
621 | - ('add', ('file', 'file-id', 'file', 'initial content\n')), |
622 | + ('add', ('', None, 'directory', None)), |
623 | + ('add', ('file', None, 'file', 'initial content\n')), |
624 | ]) |
625 | b = builder.get_branch() |
626 | tree = b.create_checkout('tree', lightweight=True) |
627 | @@ -52,14 +52,14 @@ |
628 | builder = self.make_branch_builder('branch') |
629 | builder.start_series() |
630 | revid1 = builder.build_snapshot(None, [ |
631 | - ('add', ('', b'TREE_ROOT', 'directory', None)), |
632 | - ('add', ('file', b'file-id', 'file', 'initial content\n')), |
633 | + ('add', ('', None, 'directory', None)), |
634 | + ('add', ('file', None, 'file', b'initial content\n')), |
635 | ]) |
636 | revid2 = builder.build_snapshot([revid1], [ |
637 | - ('modify', (b'file-id', 'initial content\ncontent in 2\n')), |
638 | + ('modify', ('file', b'initial content\ncontent in 2\n')), |
639 | ]) |
640 | revid3 = builder.build_snapshot([revid1], [ |
641 | - ('modify', (b'file-id', 'initial content\ncontent in 3\n')), |
642 | + ('modify', ('file', b'initial content\ncontent in 3\n')), |
643 | ]) |
644 | builder.finish_series() |
645 | b = builder.get_branch() |
646 | @@ -81,10 +81,10 @@ |
647 | builder = self.make_branch_builder('branch') |
648 | builder.start_series() |
649 | revid1 = builder.build_snapshot(None, [ |
650 | - ('add', ('', b'TREE_ROOT', 'directory', None)), |
651 | + ('add', ('', None, 'directory', None)), |
652 | ]) |
653 | revid2 = builder.build_snapshot([revid1], [ |
654 | - ('add', ('file', b'file-id', 'file', 'initial content\n')), |
655 | + ('add', ('file', None, 'file', b'initial content\n')), |
656 | ]) |
657 | revid3 = builder.build_snapshot([revid1], []) |
658 | builder.finish_series() |
659 | @@ -104,13 +104,13 @@ |
660 | builder = self.make_branch_builder('branch') |
661 | builder.start_series() |
662 | revid1 = builder.build_snapshot(None, [ |
663 | - ('add', ('', b'TREE_ROOT', 'directory', None)), |
664 | + ('add', ('', None, 'directory', None)), |
665 | ]) |
666 | revid2 = builder.build_snapshot([revid1], [ |
667 | - ('add', ('file', b'file-id', 'file', 'initial content\n')), |
668 | + ('add', ('file', None, 'file', b'initial content\n')), |
669 | ]) |
670 | revid3 = builder.build_snapshot([revid1], [ |
671 | - ('add', ('a_dir', b'file-id', 'directory', None)), |
672 | + ('add', ('a_dir', None, 'directory', None)), |
673 | ]) |
674 | builder.finish_series() |
675 | b = builder.get_branch() |
676 | @@ -129,13 +129,13 @@ |
677 | builder = self.make_branch_builder('branch') |
678 | builder.start_series() |
679 | revid1 = builder.build_snapshot(None, [ |
680 | - ('add', ('', b'TREE_ROOT', 'directory', None)), |
681 | - ('add', ('file', b'file-id', 'file', 'initial content\n')), |
682 | + ('add', ('', None, 'directory', None)), |
683 | + ('add', ('file', None, 'file', b'initial content\n')), |
684 | ]) |
685 | revid2 = builder.build_snapshot([revid1], [ |
686 | ]) |
687 | revid3 = builder.build_snapshot([revid1], [ |
688 | - ('modify', (b'file-id', 'initial content\ncontent in 3\n')), |
689 | + ('modify', ('file', b'initial content\ncontent in 3\n')), |
690 | ]) |
691 | builder.finish_series() |
692 | b = builder.get_branch() |
693 | @@ -154,17 +154,17 @@ |
694 | builder = self.make_branch_builder('branch') |
695 | builder.start_series() |
696 | revid1 = builder.build_snapshot(None, [ |
697 | - ('add', ('', 'TREE_ROOT', 'directory', None)), |
698 | - ('add', ('file', 'file-id', 'file', 'initial content\n')), |
699 | + ('add', ('', None, 'directory', None)), |
700 | + ('add', ('file', None, 'file', 'initial content\n')), |
701 | ]) |
702 | revid2 = builder.build_snapshot([revid1], [ |
703 | - ('modify', ('file-id', 'initial content\nnew content\n')), |
704 | + ('modify', ('file', 'initial content\nnew content\n')), |
705 | ]) |
706 | revid3 = builder.build_snapshot([revid2], [ |
707 | - ('modify', ('file-id', 'initial content\ncontent in 3\n')), |
708 | + ('modify', ('file', 'initial content\ncontent in 3\n')), |
709 | ]) |
710 | revid4 = builder.build_snapshot([revid3], [ |
711 | - ('modify', ('file-id', 'initial content\nnew content\n')), |
712 | + ('modify', ('file', 'initial content\nnew content\n')), |
713 | ]) |
714 | # In this case, the content locally is the same as content in basis |
715 | # tree, but the merge revision states that *it* should win |
716 | |
717 | === modified file 'breezy/tests/per_workingtree/test_merge_from_branch.py' |
718 | --- breezy/tests/per_workingtree/test_merge_from_branch.py 2018-03-25 00:39:16 +0000 |
719 | +++ breezy/tests/per_workingtree/test_merge_from_branch.py 2018-03-27 00:52:31 +0000 |
720 | @@ -124,36 +124,33 @@ |
721 | bld_inner.start_series() |
722 | rev1 = bld_inner.build_snapshot( |
723 | None, |
724 | - [('add', ('', 'inner-root-id', 'directory', '')), |
725 | - ('add', ('dir', 'dir-id', 'directory', '')), |
726 | - ('add', ('dir/file1', 'file1-id', 'file', 'file1 content\n')), |
727 | - ('add', ('file3', 'file3-id', 'file', 'file3 content\n')), |
728 | + [('add', ('', None, 'directory', '')), |
729 | + ('add', ('dir', None, 'directory', '')), |
730 | + ('add', ('dir/file1', None, 'file', 'file1 content\n')), |
731 | + ('add', ('file3', None, 'file', 'file3 content\n')), |
732 | ]) |
733 | rev4 = bld_inner.build_snapshot( |
734 | [rev1], |
735 | - [('add', ('file4', 'file4-id', 'file', 'file4 content\n')) |
736 | + [('add', ('file4', None, 'file', 'file4 content\n')) |
737 | ]) |
738 | rev5 = bld_inner.build_snapshot( |
739 | [rev4], [('rename', ('file4', 'dir/file4'))]) |
740 | rev3 = bld_inner.build_snapshot( |
741 | - [rev1], [('modify', ('file3-id', 'new file3 contents\n')),]) |
742 | + [rev1], [('modify', ('file3', 'new file3 contents\n')),]) |
743 | rev2 = bld_inner.build_snapshot( |
744 | [rev1], |
745 | - [('add', ('dir/file2', 'file2-id', 'file', 'file2 content\n')), |
746 | - ], revision_id='2') |
747 | + [('add', ('dir/file2', None, 'file', 'file2 content\n')), |
748 | + ]) |
749 | bld_inner.finish_series() |
750 | br = bld_inner.get_branch() |
751 | return br, [rev1, rev2, rev3, rev4, rev5] |
752 | |
753 | def assertTreeLayout(self, expected, tree): |
754 | - tree.lock_read() |
755 | - try: |
756 | + with tree.lock_read(): |
757 | actual = [e[0] for e in tree.list_files()] |
758 | # list_files doesn't guarantee order |
759 | actual = sorted(actual) |
760 | self.assertEqual(expected, actual) |
761 | - finally: |
762 | - tree.unlock() |
763 | |
764 | def make_outer_tree(self): |
765 | outer = self.make_branch_and_tree('outer') |
766 | |
767 | === modified file 'breezy/tests/per_workingtree/test_pull.py' |
768 | --- breezy/tests/per_workingtree/test_pull.py 2018-03-25 00:39:16 +0000 |
769 | +++ breezy/tests/per_workingtree/test_pull.py 2018-03-27 00:52:31 +0000 |
770 | @@ -90,7 +90,7 @@ |
771 | ('add', ('file', 'file-id', 'file', 'trunk content\n')),], |
772 | revision_id='2') |
773 | builder.build_snapshot(['2'], [ |
774 | - ('unversion', 'dir-id'),], |
775 | + ('unversion', 'dir'),], |
776 | revision_id='3') |
777 | builder.finish_series() |
778 | return builder.get_branch() |
779 | |
780 | === modified file 'breezy/tests/per_workingtree/test_workingtree.py' |
781 | --- breezy/tests/per_workingtree/test_workingtree.py 2018-03-25 00:39:16 +0000 |
782 | +++ breezy/tests/per_workingtree/test_workingtree.py 2018-03-27 00:52:31 +0000 |
783 | @@ -1109,18 +1109,18 @@ |
784 | # mainline |
785 | revids['1'] = builder.build_snapshot( |
786 | None, |
787 | - [('add', ('', 'root-id', 'directory', '')), |
788 | - ('add', ('file1', 'file1-id', 'file', 'file1 content\n'))]) |
789 | + [('add', ('', None, 'directory', '')), |
790 | + ('add', ('file1', None, 'file', 'file1 content\n'))]) |
791 | # branch |
792 | revids['2'] = builder.build_snapshot([revids['1']], []) |
793 | revids['4'] = builder.build_snapshot( |
794 | [revids['1']], |
795 | - [('add', ('file4', 'file4-id', 'file', 'file4 content\n'))]) |
796 | + [('add', ('file4', None, 'file', 'file4 content\n'))]) |
797 | # master |
798 | revids['3'] = builder.build_snapshot([revids['1']], []) |
799 | revids['5'] = builder.build_snapshot( |
800 | [revids['3']], |
801 | - [('add', ('file5', 'file5-id', 'file', 'file5 content\n'))]) |
802 | + [('add', ('file5', None, 'file', 'file5 content\n'))]) |
803 | builder.finish_series() |
804 | return (builder, builder._branch.last_revision(), revids) |
805 | |
806 | |
807 | === modified file 'breezy/tests/test_annotate.py' |
808 | --- breezy/tests/test_annotate.py 2018-02-18 15:21:06 +0000 |
809 | +++ breezy/tests/test_annotate.py 2018-03-27 00:52:31 +0000 |
810 | @@ -185,15 +185,15 @@ |
811 | ], timestamp=1166046000.00, timezone=0, committer="joe@foo.com", |
812 | revision_id='rev-1') |
813 | builder.build_snapshot(['rev-1'], [ |
814 | - ('modify', ('a-id', 'first\nsecond\n')), |
815 | + ('modify', ('a', 'first\nsecond\n')), |
816 | ], timestamp=1166046001.00, timezone=0, committer="joe@foo.com", |
817 | revision_id='rev-2') |
818 | builder.build_snapshot(['rev-1'], [ |
819 | - ('modify', ('a-id', 'first\nthird\n')), |
820 | + ('modify', ('a', 'first\nthird\n')), |
821 | ], timestamp=1166046002.00, timezone=0, committer="barry@foo.com", |
822 | revision_id='rev-1_1_1') |
823 | builder.build_snapshot(['rev-2', 'rev-1_1_1'], [ |
824 | - ('modify', ('a-id', 'first\nsecond\nthird\n')), |
825 | + ('modify', ('a', 'first\nsecond\nthird\n')), |
826 | ], timestamp=1166046003.00, timezone=0, committer="sal@foo.com", |
827 | revision_id='rev-3') |
828 | return builder |
829 | @@ -225,22 +225,22 @@ |
830 | builder.build_snapshot(['rev-1_1_1'], [], revision_id='rev-1_1_2') |
831 | builder.build_snapshot(['rev-3', 'rev-1_1_2'], [], revision_id='rev-4') |
832 | builder.build_snapshot(['rev-1_1_1'], [ |
833 | - ('modify', ('a-id', 'first\nthird\nfourth\n')), |
834 | + ('modify', ('a', 'first\nthird\nfourth\n')), |
835 | ], timestamp=1166046003.00, timezone=0, committer="jerry@foo.com", |
836 | revision_id='rev-1_2_1') |
837 | builder.build_snapshot(['rev-1_2_1'], [], |
838 | timestamp=1166046004.00, timezone=0, committer="jerry@foo.com", |
839 | revision_id='rev-1_2_2') |
840 | builder.build_snapshot(['rev-4', 'rev-1_2_2'], [ |
841 | - ('modify', ('a-id', 'first\nsecond\nthird\nfourth\n')), |
842 | + ('modify', ('a', 'first\nsecond\nthird\nfourth\n')), |
843 | ], timestamp=1166046004.00, timezone=0, committer="jerry@foo.com", |
844 | revision_id='rev-5') |
845 | builder.build_snapshot(['rev-1_2_1'], [ |
846 | - ('modify', ('a-id', 'first\nthird\nfourth\nfifth\nsixth\n')), |
847 | + ('modify', ('a', 'first\nthird\nfourth\nfifth\nsixth\n')), |
848 | ], timestamp=1166046005.00, timezone=0, committer="george@foo.com", |
849 | revision_id='rev-1_3_1') |
850 | builder.build_snapshot(['rev-5', 'rev-1_3_1'], [ |
851 | - ('modify', ('a-id', |
852 | + ('modify', ('a', |
853 | 'first\nsecond\nthird\nfourth\nfifth\nsixth\n')), |
854 | ], revision_id='rev-6') |
855 | return builder |
856 | @@ -260,19 +260,19 @@ |
857 | ('add', ('file', 'file-id', 'file', base_text)), |
858 | ], revision_id='rev-base') |
859 | builder.build_snapshot(['rev-base'], [ |
860 | - ('modify', ('file-id', a_text))], |
861 | + ('modify', ('file', a_text))], |
862 | revision_id='rev-A') |
863 | builder.build_snapshot(['rev-base'], [ |
864 | - ('modify', ('file-id', b_text))], |
865 | + ('modify', ('file', b_text))], |
866 | revision_id='rev-B') |
867 | builder.build_snapshot(['rev-A'], [ |
868 | - ('modify', ('file-id', c_text))], |
869 | + ('modify', ('file', c_text))], |
870 | revision_id='rev-C') |
871 | builder.build_snapshot(['rev-B', 'rev-A'], [ |
872 | - ('modify', ('file-id', d_text))], |
873 | + ('modify', ('file', d_text))], |
874 | revision_id='rev-D') |
875 | builder.build_snapshot(['rev-C', 'rev-D'], [ |
876 | - ('modify', ('file-id', e_text))], |
877 | + ('modify', ('file', e_text))], |
878 | revision_id='rev-E') |
879 | return builder |
880 | |
881 | |
882 | === modified file 'breezy/tests/test_branchbuilder.py' |
883 | --- breezy/tests/test_branchbuilder.py 2018-02-18 15:21:06 +0000 |
884 | +++ breezy/tests/test_branchbuilder.py 2018-03-27 00:52:31 +0000 |
885 | @@ -200,7 +200,7 @@ |
886 | def test_modify_file(self): |
887 | builder = self.build_a_rev() |
888 | rev_id2 = builder.build_snapshot(None, |
889 | - [('modify', ('a-id', 'new\ncontent\n'))], |
890 | + [('modify', ('a', 'new\ncontent\n'))], |
891 | revision_id='B-id') |
892 | self.assertEqual('B-id', rev_id2) |
893 | branch = builder.get_branch() |
894 | @@ -213,7 +213,7 @@ |
895 | def test_delete_file(self): |
896 | builder = self.build_a_rev() |
897 | rev_id2 = builder.build_snapshot(None, |
898 | - [('unversion', 'a-id')], revision_id='B-id') |
899 | + [('unversion', 'a')], revision_id='B-id') |
900 | self.assertEqual('B-id', rev_id2) |
901 | branch = builder.get_branch() |
902 | rev_tree = branch.repository.revision_tree(rev_id2) |
903 | @@ -238,7 +238,7 @@ |
904 | (u'b/d/e', 'e-id', 'file')], rev_tree) |
905 | # Removing a directory removes all child dirs |
906 | builder.build_snapshot( |
907 | - None, [('unversion', 'b-id')], |
908 | + None, [('unversion', 'b')], |
909 | revision_id='C-id') |
910 | rev_tree = builder.get_branch().repository.revision_tree('C-id') |
911 | self.assertTreeShape([(u'', 'a-root-id', 'directory'), |
912 | @@ -278,7 +278,7 @@ |
913 | revision_id='B-id') |
914 | builder.build_snapshot(None, |
915 | [('rename', ('dir/a', 'a')), |
916 | - ('unversion', 'dir-id')], revision_id='C-id') |
917 | + ('unversion', 'dir')], revision_id='C-id') |
918 | rev_tree = builder.get_branch().repository.revision_tree('C-id') |
919 | self.assertTreeShape([(u'', 'a-root-id', 'directory'), |
920 | (u'a', 'a-id', 'file')], rev_tree) |
921 | @@ -288,7 +288,7 @@ |
922 | builder.start_series() |
923 | self.addCleanup(builder.finish_series) |
924 | builder.build_snapshot(['A-id'], |
925 | - [('modify', ('a-id', 'new\ncontent\n'))], |
926 | + [('modify', ('a', 'new\ncontent\n'))], |
927 | revision_id='B-id') |
928 | builder.build_snapshot(['A-id'], |
929 | [('add', ('c', 'c-id', 'file', 'alt\ncontent\n'))], |
930 | @@ -416,7 +416,7 @@ |
931 | [('add', ('', 'TREE_ROOT', 'directory', ''))], |
932 | revision_id='rev-1') |
933 | builder.build_snapshot(None, |
934 | - [('unversion', 'TREE_ROOT'), |
935 | + [('unversion', ''), |
936 | ('add', ('', 'my-root', 'directory', ''))], |
937 | revision_id='rev-2') |
938 | builder.finish_series() |
939 | @@ -446,7 +446,7 @@ |
940 | ('add', (u'a', 'a-id', 'file', 'content\n'))], |
941 | revision_id='A-id') |
942 | builder.build_snapshot(None, |
943 | - [('unversion', 'a-id'), |
944 | + [('unversion', 'a'), |
945 | ('flush', None), |
946 | ('add', (u'a', 'a-id', 'directory', None))], |
947 | revision_id='B-id') |
948 | @@ -467,7 +467,7 @@ |
949 | ('add', (u'dir', 'dir-id', 'directory', None))], |
950 | revision_id='A-id') |
951 | builder.build_snapshot(None, |
952 | - [('unversion', 'orig-root'), # implicitly unversions all children |
953 | + [('unversion', ''), # implicitly unversions all children |
954 | ('flush', None), |
955 | ('add', (u'', 'dir-id', 'directory', None))], |
956 | revision_id='B-id') |
957 | |
958 | === modified file 'breezy/tests/test_bundle.py' |
959 | --- breezy/tests/test_bundle.py 2018-03-25 00:39:16 +0000 |
960 | +++ breezy/tests/test_bundle.py 2018-03-27 00:52:31 +0000 |
961 | @@ -1517,7 +1517,7 @@ |
962 | ('add', ('file', 'file-id', 'file', 'original content\n')), |
963 | ], revision_id='a@cset-0-1') |
964 | builder.build_snapshot(['a@cset-0-1'], [ |
965 | - ('modify', ('file-id', 'new-content\n')), |
966 | + ('modify', ('file', 'new-content\n')), |
967 | ], revision_id='a@cset-0-2a') |
968 | builder.build_snapshot(['a@cset-0-1'], [ |
969 | ('add', ('other-file', 'file2-id', 'file', 'file2-content\n')), |
970 | |
971 | === modified file 'breezy/tests/test_conflicts.py' |
972 | --- breezy/tests/test_conflicts.py 2018-02-18 15:21:06 +0000 |
973 | +++ breezy/tests/test_conflicts.py 2018-03-27 00:52:31 +0000 |
974 | @@ -385,10 +385,10 @@ |
975 | (dict(_base_actions='create_file_in_dir', |
976 | _path='dir/file', _file_id='file-id'), |
977 | ('filed_modified_A_in_dir', |
978 | - dict(actions='modify_file_A', |
979 | + dict(actions='modify_file_A_in_dir', |
980 | check='file_in_dir_has_content_A')), |
981 | ('file_modified_B', |
982 | - dict(actions='modify_file_B', |
983 | + dict(actions='modify_file_B_in_dir', |
984 | check='file_in_dir_has_content_B')),), |
985 | ]) |
986 | |
987 | @@ -396,10 +396,16 @@ |
988 | return [('add', (path, 'file-id', 'file', 'trunk content\n'))] |
989 | |
990 | def do_modify_file_A(self): |
991 | - return [('modify', ('file-id', 'trunk content\nfeature A\n'))] |
992 | + return [('modify', ('file', 'trunk content\nfeature A\n'))] |
993 | |
994 | def do_modify_file_B(self): |
995 | - return [('modify', ('file-id', 'trunk content\nfeature B\n'))] |
996 | + return [('modify', ('file', 'trunk content\nfeature B\n'))] |
997 | + |
998 | + def do_modify_file_A_in_dir(self): |
999 | + return [('modify', ('dir/file', 'trunk content\nfeature A\n'))] |
1000 | + |
1001 | + def do_modify_file_B_in_dir(self): |
1002 | + return [('modify', ('dir/file', 'trunk content\nfeature B\n'))] |
1003 | |
1004 | def check_file_has_content_A(self, path='file'): |
1005 | self.assertFileEqual('trunk content\nfeature A\n', |
1006 | @@ -461,7 +467,7 @@ |
1007 | dict(actions='modify_file_in_dir', |
1008 | check='file_in_dir_has_more_content')), |
1009 | ('file_deleted_in_dir', |
1010 | - dict(actions='delete_file', |
1011 | + dict(actions='delete_file_in_dir', |
1012 | check='file_in_dir_doesnt_exist')),), |
1013 | ]) |
1014 | |
1015 | @@ -469,10 +475,10 @@ |
1016 | return [('add', ('file', 'file-id', 'file', 'trunk content\n'))] |
1017 | |
1018 | def do_modify_file(self): |
1019 | - return [('modify', ('file-id', 'trunk content\nmore content\n'))] |
1020 | + return [('modify', ('file', 'trunk content\nmore content\n'))] |
1021 | |
1022 | def do_modify_and_rename_file(self): |
1023 | - return [('modify', ('file-id', 'trunk content\nmore content\n')), |
1024 | + return [('modify', ('new-file', 'trunk content\nmore content\n')), |
1025 | ('rename', ('file', 'new-file'))] |
1026 | |
1027 | def check_file_has_more_content(self): |
1028 | @@ -482,7 +488,10 @@ |
1029 | self.assertFileEqual('trunk content\nmore content\n', 'branch/new-file') |
1030 | |
1031 | def do_delete_file(self): |
1032 | - return [('unversion', 'file-id')] |
1033 | + return [('unversion', 'file')] |
1034 | + |
1035 | + def do_delete_file_in_dir(self): |
1036 | + return [('unversion', 'dir/file')] |
1037 | |
1038 | def check_file_doesnt_exist(self): |
1039 | self.assertPathDoesNotExist('branch/file') |
1040 | @@ -492,7 +501,7 @@ |
1041 | ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))] |
1042 | |
1043 | def do_modify_file_in_dir(self): |
1044 | - return [('modify', ('file-id', 'trunk content\nmore content\n'))] |
1045 | + return [('modify', ('dir/file', 'trunk content\nmore content\n'))] |
1046 | |
1047 | def check_file_in_dir_has_more_content(self): |
1048 | self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file') |
1049 | @@ -537,7 +546,7 @@ |
1050 | dict(actions='rename_file_in_dir', check='file_in_dir_renamed', |
1051 | path='dir/new-file', file_id='file-id')), |
1052 | ('file_deleted', |
1053 | - dict(actions='delete_file', check='file_in_dir_doesnt_exist', |
1054 | + dict(actions='delete_file_in_dir', check='file_in_dir_doesnt_exist', |
1055 | # PathConflicts deletion handling requires a special |
1056 | # hard-coded value |
1057 | path='<deleted>', file_id='file-id')),), |
1058 | @@ -604,13 +613,16 @@ |
1059 | self.assertPathExists('branch/new-dir2') |
1060 | |
1061 | def do_delete_file(self): |
1062 | - return [('unversion', 'file-id')] |
1063 | + return [('unversion', 'file')] |
1064 | + |
1065 | + def do_delete_file_in_dir(self): |
1066 | + return [('unversion', 'dir/file')] |
1067 | |
1068 | def check_file_doesnt_exist(self): |
1069 | self.assertPathDoesNotExist('branch/file') |
1070 | |
1071 | def do_delete_dir(self): |
1072 | - return [('unversion', 'dir-id')] |
1073 | + return [('unversion', 'dir')] |
1074 | |
1075 | def check_dir_doesnt_exist(self): |
1076 | self.assertPathDoesNotExist('branch/dir') |
1077 | @@ -703,11 +715,11 @@ |
1078 | self.assertFileEqual('file b content\n', 'branch/file') |
1079 | |
1080 | def do_replace_file_a_by_b(self): |
1081 | - return [('unversion', 'file-a-id'), |
1082 | + return [('unversion', 'file'), |
1083 | ('add', ('file', 'file-b-id', 'file', 'file b content\n'))] |
1084 | |
1085 | def do_modify_file_a(self): |
1086 | - return [('modify', ('file-a-id', 'new content\n'))] |
1087 | + return [('modify', ('file', 'new content\n'))] |
1088 | |
1089 | def check_file_new_content(self): |
1090 | self.assertFileEqual('new content\n', 'branch/file') |
1091 | |
1092 | === modified file 'breezy/tests/test_knit.py' |
1093 | --- breezy/tests/test_knit.py 2017-11-16 00:39:04 +0000 |
1094 | +++ breezy/tests/test_knit.py 2018-03-27 00:52:31 +0000 |
1095 | @@ -387,10 +387,10 @@ |
1096 | ('add', ('file', 'file-id', 'file', 'content\nrev 1\n')), |
1097 | ], revision_id='rev-1') |
1098 | builder.build_snapshot(['rev-1'], [ |
1099 | - ('modify', ('file-id', 'content\nrev 2\n')), |
1100 | + ('modify', ('file', 'content\nrev 2\n')), |
1101 | ], revision_id='rev-2') |
1102 | builder.build_snapshot(['rev-2'], [ |
1103 | - ('modify', ('file-id', 'content\nrev 3\n')), |
1104 | + ('modify', ('file', 'content\nrev 3\n')), |
1105 | ], revision_id='rev-3') |
1106 | self.addCleanup(builder.finish_series) |
1107 | b = builder.get_branch() |
1108 | @@ -420,10 +420,10 @@ |
1109 | ('add', ('file', 'file-id', 'file', 'content\nrev 1\n')), |
1110 | ], revision_id='rev-1') |
1111 | builder.build_snapshot(['rev-1'], [ |
1112 | - ('modify', ('file-id', 'content\nrev 2\n')), |
1113 | + ('modify', ('file', 'content\nrev 2\n')), |
1114 | ], revision_id='rev-2') |
1115 | builder.build_snapshot(['rev-2'], [ |
1116 | - ('modify', ('file-id', 'content\nrev 3\n')), |
1117 | + ('modify', ('file', 'content\nrev 3\n')), |
1118 | ], revision_id='rev-3') |
1119 | builder.finish_series() |
1120 | b = builder.get_branch() |
1121 | |
1122 | === modified file 'breezy/tests/test_merge.py' |
1123 | --- breezy/tests/test_merge.py 2018-03-25 00:39:16 +0000 |
1124 | +++ breezy/tests/test_merge.py 2018-03-27 00:52:31 +0000 |
1125 | @@ -1409,16 +1409,16 @@ |
1126 | ('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))], |
1127 | revision_id='A-id') |
1128 | builder.build_snapshot(['A-id'], |
1129 | - [('modify', ('a-id', 'a\nb\nC\nc\n'))], |
1130 | + [('modify', ('a', 'a\nb\nC\nc\n'))], |
1131 | revision_id='C-id') |
1132 | builder.build_snapshot(['A-id'], |
1133 | - [('modify', ('a-id', 'a\nB\nb\nc\n'))], |
1134 | + [('modify', ('a', 'a\nB\nb\nc\n'))], |
1135 | revision_id='B-id') |
1136 | builder.build_snapshot(['C-id', 'B-id'], |
1137 | - [('modify', ('a-id', 'a\nB\nb\nC\nc\nE\n'))], |
1138 | + [('modify', ('a', 'a\nB\nb\nC\nc\nE\n'))], |
1139 | revision_id='E-id') |
1140 | builder.build_snapshot(['B-id', 'C-id'], |
1141 | - [('modify', ('a-id', 'a\nB\nb\nC\nc\n'))], |
1142 | + [('modify', ('a', 'a\nB\nb\nC\nc\n'))], |
1143 | revision_id='D-id', ) |
1144 | merge_obj = self.make_merge_obj(builder, 'E-id') |
1145 | |
1146 | @@ -1466,7 +1466,7 @@ |
1147 | [('add', (u'foo', 'foo-id', 'file', 'a\nb\nc\n'))], |
1148 | revision_id='E-id') |
1149 | builder.build_snapshot(['E-id', 'D-id'], |
1150 | - [('modify', (u'bar-id', 'd\ne\nf\nG\n'))], |
1151 | + [('modify', (u'bar', 'd\ne\nf\nG\n'))], |
1152 | revision_id='G-id') |
1153 | builder.build_snapshot(['D-id', 'E-id'], [], revision_id='F-id') |
1154 | merge_obj = self.make_merge_obj(builder, 'G-id') |
1155 | @@ -1490,16 +1490,16 @@ |
1156 | ('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))], |
1157 | revision_id='A-id') |
1158 | builder.build_snapshot(['A-id'], |
1159 | - [('modify', ('a-id', 'a\nB\nb\nc\n'))], |
1160 | + [('modify', ('a', 'a\nB\nb\nc\n'))], |
1161 | revision_id='B-id') |
1162 | builder.build_snapshot(['A-id'], |
1163 | - [('modify', ('a-id', 'a\nb\nC\nc\n'))], |
1164 | + [('modify', ('a', 'a\nb\nC\nc\n'))], |
1165 | revision_id='C-id') |
1166 | builder.build_snapshot(['C-id', 'B-id'], |
1167 | - [('modify', ('a-id', 'a\nB\nb\nC\nc\nE\n'))], |
1168 | + [('modify', ('a', 'a\nB\nb\nC\nc\nE\n'))], |
1169 | revision_id='E-id') |
1170 | builder.build_snapshot(['B-id', 'C-id'], |
1171 | - [('unversion', 'a-id')], |
1172 | + [('unversion', 'a')], |
1173 | revision_id='D-id') |
1174 | merge_obj = self.make_merge_obj(builder, 'E-id') |
1175 | |
1176 | @@ -1554,7 +1554,7 @@ |
1177 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1178 | builder.build_snapshot( |
1179 | ['C-id', 'B-id'], |
1180 | - [('unversion', 'a-id')], revision_id='E-id') |
1181 | + [('unversion', 'a')], revision_id='E-id') |
1182 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1183 | merge_obj = self.make_merge_obj(builder, 'E-id') |
1184 | |
1185 | @@ -1586,7 +1586,7 @@ |
1186 | revision_id='A-id') |
1187 | builder.build_snapshot(['A-id'], [], revision_id='B-id') |
1188 | builder.build_snapshot(['A-id'], |
1189 | - [('unversion', 'foo-id')], revision_id='C-id') |
1190 | + [('unversion', 'foo')], revision_id='C-id') |
1191 | builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id') |
1192 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1193 | merge_obj = self.make_merge_obj(builder, 'E-id') |
1194 | @@ -1615,10 +1615,10 @@ |
1195 | ('add', (u'foo', 'foo-id', 'file', 'content\n'))], |
1196 | revision_id='A-id') |
1197 | builder.build_snapshot(['A-id'], [ |
1198 | - ('modify', ('foo-id', 'new-content\n'))], |
1199 | + ('modify', ('foo', 'new-content\n'))], |
1200 | revision_id='B-id') |
1201 | builder.build_snapshot(['A-id'], |
1202 | - [('unversion', 'foo-id')], |
1203 | + [('unversion', 'foo')], |
1204 | revision_id='C-id') |
1205 | builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id') |
1206 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1207 | @@ -1658,7 +1658,7 @@ |
1208 | [('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))], |
1209 | revision_id='C-id') |
1210 | builder.build_snapshot(['C-id', 'B-id'], |
1211 | - [('unversion', 'a-id')], |
1212 | + [('unversion', 'a')], |
1213 | revision_id='E-id') |
1214 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1215 | merge_obj = self.make_merge_obj(builder, 'E-id') |
1216 | @@ -1709,15 +1709,15 @@ |
1217 | revision_id='A-id') |
1218 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1219 | builder.build_snapshot(['A-id'], |
1220 | - [('modify', ('foo-id', 'B content\n'))], |
1221 | + [('modify', ('foo', 'B content\n'))], |
1222 | revision_id='B-id') |
1223 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1224 | builder.build_snapshot(['C-id', 'B-id'], |
1225 | - [('modify', ('foo-id', 'E content\n'))], |
1226 | + [('modify', ('foo', 'E content\n'))], |
1227 | revision_id='E-id') |
1228 | builder.build_snapshot(['E-id', 'D-id'], [], revision_id='G-id') |
1229 | builder.build_snapshot(['D-id', 'E-id'], |
1230 | - [('modify', ('foo-id', 'F content\n'))], |
1231 | + [('modify', ('foo', 'F content\n'))], |
1232 | revision_id='F-id') |
1233 | merge_obj = self.make_merge_obj(builder, 'G-id') |
1234 | |
1235 | @@ -1833,10 +1833,10 @@ |
1236 | ('add', (u'foo', 'foo-id', 'file', 'A content\n'))], |
1237 | revision_id='A-id') |
1238 | builder.build_snapshot(['A-id'], |
1239 | - [('modify', ('foo-id', 'B content\n'))], |
1240 | + [('modify', ('foo', 'B content\n'))], |
1241 | revision_id='B-id') |
1242 | builder.build_snapshot(['A-id'], |
1243 | - [('modify', ('foo-id', 'C content\n'))], |
1244 | + [('modify', ('foo', 'C content\n'))], |
1245 | revision_id='C-id') |
1246 | builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id') |
1247 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1248 | @@ -1868,15 +1868,15 @@ |
1249 | ('add', (u'foo', 'foo-id', 'file', 'A content\n'))], |
1250 | revision_id='A-id') |
1251 | builder.build_snapshot(['A-id'], |
1252 | - [('modify', ('foo-id', 'B content\n'))], |
1253 | + [('modify', ('foo', 'B content\n'))], |
1254 | revision_id='B-id') |
1255 | builder.build_snapshot(['A-id'], |
1256 | - [('modify', ('foo-id', 'C content\n'))], |
1257 | + [('modify', ('foo', 'C content\n'))], |
1258 | revision_id='C-id', ) |
1259 | builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id') |
1260 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1261 | builder.build_snapshot(['D-id'], |
1262 | - [('modify', ('foo-id', 'F content\n'))], |
1263 | + [('modify', ('foo', 'F content\n'))], |
1264 | revision_id='F-id') |
1265 | merge_obj = self.make_merge_obj(builder, 'E-id') |
1266 | |
1267 | @@ -1909,17 +1909,17 @@ |
1268 | ('add', (u'foo', 'foo-id', 'file', 'A content\n'))], |
1269 | revision_id='A-id') |
1270 | builder.build_snapshot(['A-id'], |
1271 | - [('modify', ('foo-id', 'B content\n'))], |
1272 | + [('modify', ('foo', 'B content\n'))], |
1273 | revision_id='B-id') |
1274 | builder.build_snapshot(['A-id'], |
1275 | - [('modify', ('foo-id', 'C content\n'))], |
1276 | + [('modify', ('foo', 'C content\n'))], |
1277 | revision_id='C-id') |
1278 | builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id') |
1279 | builder.build_snapshot(['B-id', 'C-id'], |
1280 | - [('modify', ('foo-id', 'C content\n'))], |
1281 | + [('modify', ('foo', 'C content\n'))], |
1282 | revision_id='D-id') # Same as E |
1283 | builder.build_snapshot(['D-id'], |
1284 | - [('modify', ('foo-id', 'F content\n'))], |
1285 | + [('modify', ('foo', 'F content\n'))], |
1286 | revision_id='F-id') |
1287 | merge_obj = self.make_merge_obj(builder, 'E-id') |
1288 | |
1289 | @@ -1961,7 +1961,7 @@ |
1290 | builder.build_snapshot(['A-id'], [], revision_id='B-id') |
1291 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1292 | builder.build_snapshot(['C-id', 'B-id'], |
1293 | - [('unversion', 'a-id'), |
1294 | + [('unversion', 'a'), |
1295 | ('flush', None), |
1296 | ('add', (u'a', 'a-id', 'directory', None))], |
1297 | revision_id='E-id') |
1298 | @@ -1988,7 +1988,7 @@ |
1299 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1300 | builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id') |
1301 | builder.build_snapshot(['B-id', 'C-id'], |
1302 | - [('unversion', 'a-id'), |
1303 | + [('unversion', 'a'), |
1304 | ('flush', None), |
1305 | ('add', (u'a', 'a-id', 'directory', None))], |
1306 | revision_id='D-id') |
1307 | @@ -2008,8 +2008,8 @@ |
1308 | builder.build_snapshot(['A-id'], [], revision_id='B-id') |
1309 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1310 | builder.build_snapshot(['C-id', 'B-id'], |
1311 | - [('modify', ('a-id', 'new-content\n')), |
1312 | - ('modify', ('b-id', 'new-content\n'))], |
1313 | + [('modify', ('a', 'new-content\n')), |
1314 | + ('modify', ('b', 'new-content\n'))], |
1315 | revision_id='E-id') |
1316 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1317 | merge_obj = self.make_merge_obj(builder, 'E-id', |
1318 | @@ -2034,8 +2034,8 @@ |
1319 | builder.build_snapshot(['A-id'], [], revision_id='B-id') |
1320 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1321 | builder.build_snapshot(['C-id', 'B-id'], |
1322 | - [('modify', ('a-id', 'new-content\n')), |
1323 | - ('modify', ('b-id', 'new-content\n'))], |
1324 | + [('modify', ('a', 'new-content\n')), |
1325 | + ('modify', ('b', 'new-content\n'))], |
1326 | revision_id='E-id') |
1327 | builder.build_snapshot(['B-id', 'C-id'], |
1328 | [('rename', ('b', 'c'))], |
1329 | @@ -2066,8 +2066,8 @@ |
1330 | [('rename', ('c', 'b'))], |
1331 | revision_id='C-id') |
1332 | builder.build_snapshot(['C-id', 'B-id'], |
1333 | - [('modify', ('a-id', 'new-content\n')), |
1334 | - ('modify', ('c-id', 'new-content\n'))], |
1335 | + [('modify', ('a', 'new-content\n')), |
1336 | + ('modify', ('b', 'new-content\n'))], |
1337 | revision_id='E-id') |
1338 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1339 | merge_obj = self.make_merge_obj(builder, 'E-id', |
1340 | @@ -2093,8 +2093,8 @@ |
1341 | [('rename', ('b', 'c'))], revision_id='B-id') |
1342 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1343 | builder.build_snapshot(['C-id', 'B-id'], |
1344 | - [('modify', ('a-id', 'new-content\n')), |
1345 | - ('modify', ('b-id', 'new-content\n'))], |
1346 | + [('modify', ('a', 'new-content\n')), |
1347 | + ('modify', ('b', 'new-content\n'))], |
1348 | revision_id='E-id') |
1349 | builder.build_snapshot(['B-id', 'C-id'], |
1350 | [('rename', ('c', 'b'))], revision_id='D-id') |
1351 | @@ -2120,8 +2120,8 @@ |
1352 | builder.build_snapshot(['A-id'], [], revision_id='B-id') |
1353 | builder.build_snapshot(['A-id'], [], revision_id='C-id') |
1354 | builder.build_snapshot(['C-id', 'B-id'], |
1355 | - [('modify', ('a-id', 'new-content\n')), |
1356 | - ('modify', ('b-id', 'new-content\n'))], revision_id='E-id') |
1357 | + [('modify', ('a', 'new-content\n')), |
1358 | + ('modify', ('b', 'new-content\n'))], revision_id='E-id') |
1359 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1360 | merge_obj = self.make_merge_obj(builder, 'E-id', |
1361 | interesting_files=['b']) |
1362 | @@ -2174,7 +2174,7 @@ |
1363 | builder.build_snapshot(['A-id'], [], revision_id='B-id') |
1364 | builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id') |
1365 | builder.build_snapshot(['B-id', 'C-id'], |
1366 | - [('modify', ('a-id', 'a\nb\nc\nd\ne\nf\n'))], |
1367 | + [('modify', ('a', 'a\nb\nc\nd\ne\nf\n'))], |
1368 | revision_id='D-id') |
1369 | wt, conflicts = self.do_merge(builder, 'E-id') |
1370 | self.assertEqual(0, conflicts) |
1371 | @@ -2235,7 +2235,7 @@ |
1372 | builder.build_snapshot(['C-id', 'B-id'], # merge the rename |
1373 | [('rename', ('foo', 'bar'))], revision_id='E-id') |
1374 | builder.build_snapshot(['E-id'], |
1375 | - [('unversion', 'foo-id')], revision_id='F-id') |
1376 | + [('unversion', 'bar')], revision_id='F-id') |
1377 | builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id') |
1378 | wt, conflicts = self.do_merge(builder, 'F-id') |
1379 | self.assertEqual(0, conflicts) |
1380 | @@ -2333,10 +2333,10 @@ |
1381 | ('add', (u'foo', 'foo-id', 'file', 'A content\n'))], |
1382 | revision_id='A-id') |
1383 | builder.build_snapshot(['A-id'], |
1384 | - [('modify', ('foo-id', 'B content\n'))], |
1385 | + [('modify', ('foo', 'B content\n'))], |
1386 | revision_id='B-id') |
1387 | builder.build_snapshot(['A-id'], |
1388 | - [('modify', ('foo-id', 'C content\n'))], |
1389 | + [('modify', ('foo', 'C content\n'))], |
1390 | revision_id='C-id') |
1391 | builder.build_snapshot(['C-id', 'B-id'], [], |
1392 | revision_id='E-id') |
1393 | @@ -2647,17 +2647,17 @@ |
1394 | builder = self.get_builder() |
1395 | builder.build_snapshot(None, |
1396 | [('add', (u'', b'a-root-id', 'directory', None)), |
1397 | - ('add', (u'foo', b'foo-id', 'file', 'base content\n'))], |
1398 | - revision_id='A-id') |
1399 | - builder.build_snapshot([b'A-id'], [], revision_id='C-id') |
1400 | + ('add', (u'foo', b'foo-id', 'file', b'base content\n'))], |
1401 | + revision_id=b'A-id') |
1402 | + builder.build_snapshot([b'A-id'], [], revision_id=b'C-id') |
1403 | builder.build_snapshot([b'A-id'], |
1404 | - [('modify', (b'foo-id', 'B content\n'))], |
1405 | + [('modify', ('foo', b'B content\n'))], |
1406 | revision_id=b'B-id') |
1407 | builder.build_snapshot([b'C-id', b'B-id'], |
1408 | - [('modify', (b'foo-id', 'B content\n'))], |
1409 | + [('modify', ('foo', b'B content\n'))], |
1410 | revision_id=b'E-id') # merge the content |
1411 | builder.build_snapshot([b'E-id'], |
1412 | - [('modify', (b'foo-id', 'base content\n'))], |
1413 | + [('modify', ('foo', b'base content\n'))], |
1414 | revision_id=b'F-id') # Revert back to BASE |
1415 | builder.build_snapshot([b'B-id', b'C-id'], [], revision_id=b'D-id') |
1416 | wt, conflicts = self.do_merge(builder, b'F-id') |
1417 | @@ -2671,22 +2671,22 @@ |
1418 | builder = self.get_builder() |
1419 | builder.build_snapshot(None, |
1420 | [('add', (u'', b'a-root-id', 'directory', None)), |
1421 | - ('add', (u'foo', b'foo-id', 'file', 'base content\n'))], |
1422 | + ('add', (u'foo', b'foo-id', 'file', b'base content\n'))], |
1423 | revision_id=b'A-id') |
1424 | builder.build_snapshot([b'A-id'], [], revision_id=b'C-id') |
1425 | builder.build_snapshot([b'A-id'], |
1426 | - [('modify', (b'foo-id', 'B content\n'))], |
1427 | + [('modify', ('foo', b'B content\n'))], |
1428 | revision_id=b'B-id') |
1429 | builder.build_snapshot([b'C-id', b'B-id'], |
1430 | - [('modify', (b'foo-id', 'B content\n'))], |
1431 | + [('modify', ('foo', b'B content\n'))], |
1432 | revision_id=b'E-id') # merge the content |
1433 | builder.build_snapshot([b'E-id'], |
1434 | - [('modify', (b'foo-id', 'F content\n'))], |
1435 | + [('modify', ('foo', b'F content\n'))], |
1436 | revision_id=b'F-id') # Override B content |
1437 | builder.build_snapshot([b'B-id', b'C-id'], [], revision_id=b'D-id') |
1438 | wt, conflicts = self.do_merge(builder, b'F-id') |
1439 | self.assertEqual(0, conflicts) |
1440 | - self.assertEqual('F content\n', wt.get_file_text('foo')) |
1441 | + self.assertEqual(b'F content\n', wt.get_file_text('foo')) |
1442 | |
1443 | def test_all_wt(self): |
1444 | """Check behavior if all trees are Working Trees.""" |
1445 | @@ -2705,14 +2705,14 @@ |
1446 | ('add', (u'foo', 'foo-id', 'file', 'base content\n'))], |
1447 | revision_id='A-id') |
1448 | builder.build_snapshot(['A-id'], |
1449 | - [('modify', ('foo-id', 'B content\n'))], |
1450 | + [('modify', ('foo', 'B content\n'))], |
1451 | revision_id='B-id') |
1452 | builder.build_snapshot(['A-id'], |
1453 | [('rename', ('a', 'b'))], |
1454 | revision_id='C-id') |
1455 | builder.build_snapshot(['C-id', 'B-id'], |
1456 | [('rename', ('b', 'c')), |
1457 | - ('modify', ('foo-id', 'E content\n'))], |
1458 | + ('modify', ('foo', 'E content\n'))], |
1459 | revision_id='E-id') |
1460 | builder.build_snapshot(['B-id', 'C-id'], |
1461 | [('rename', ('a', 'b'))], revision_id='D-id') # merged change |
1462 | |
1463 | === modified file 'breezy/tests/test_merge_core.py' |
1464 | --- breezy/tests/test_merge_core.py 2018-03-25 00:39:16 +0000 |
1465 | +++ breezy/tests/test_merge_core.py 2018-03-27 00:52:31 +0000 |
1466 | @@ -535,7 +535,7 @@ |
1467 | ('add', ('foo', 'foo-id', 'file', 'orig\ncontents\nand D\n'))], |
1468 | revision_id='D-id') |
1469 | builder.build_snapshot(['C-id', 'B-id'], [ |
1470 | - ('modify', ('foo-id', 'orig\ncontents\nand E\n'))], |
1471 | + ('modify', ('foo', 'orig\ncontents\nand E\n'))], |
1472 | revision_id='E-id') |
1473 | builder.finish_series() |
1474 | tree = builder.get_branch().create_checkout('tree', lightweight=True) |
1475 | |
1476 | === modified file 'breezy/tests/test_repository.py' |
1477 | --- breezy/tests/test_repository.py 2018-03-25 00:39:16 +0000 |
1478 | +++ breezy/tests/test_repository.py 2018-03-27 00:52:31 +0000 |
1479 | @@ -554,69 +554,69 @@ |
1480 | builder.start_series() |
1481 | builder.build_snapshot(None, [ |
1482 | ('add', ('', b'root-id', 'directory', '')), |
1483 | - ('add', ('file', b'file-id', 'file', 'content\n'))], |
1484 | - revision_id=b'1') |
1485 | - builder.build_snapshot(['1'], [ |
1486 | - ('modify', (b'file-id', 'content-2\n'))], |
1487 | - revision_id=b'2') |
1488 | - builder.finish_series() |
1489 | - source = builder.get_branch() |
1490 | - target = self.make_repository('target', format='2a') |
1491 | - target.fetch(source.repository) |
1492 | - target.lock_read() |
1493 | - self.addCleanup(target.unlock) |
1494 | - details = target.texts._index.get_build_details( |
1495 | - [(b'file-id', '1',), (b'file-id', '2',)]) |
1496 | - file_1_details = details[(b'file-id', '1')] |
1497 | - file_2_details = details[(b'file-id', '2')] |
1498 | - # The index, and what to read off disk, should be the same for both |
1499 | - # versions of the file. |
1500 | - self.assertEqual(file_1_details[0][:3], file_2_details[0][:3]) |
1501 | - |
1502 | - def test_fetch_combines_groups(self): |
1503 | - builder = self.make_branch_builder('source', format='2a') |
1504 | - builder.start_series() |
1505 | - builder.build_snapshot(None, [ |
1506 | - ('add', ('', b'root-id', 'directory', '')), |
1507 | - ('add', ('file', b'file-id', 'file', 'content\n'))], |
1508 | - revision_id=b'1') |
1509 | - builder.build_snapshot([b'1'], [ |
1510 | - ('modify', (b'file-id', 'content-2\n'))], |
1511 | - revision_id=b'2') |
1512 | - builder.finish_series() |
1513 | - source = builder.get_branch() |
1514 | - target = self.make_repository('target', format='2a') |
1515 | - target.fetch(source.repository) |
1516 | - target.lock_read() |
1517 | - self.addCleanup(target.unlock) |
1518 | - details = target.texts._index.get_build_details( |
1519 | - [(b'file-id', '1',), (b'file-id', '2',)]) |
1520 | - file_1_details = details[(b'file-id', '1')] |
1521 | - file_2_details = details[(b'file-id', '2')] |
1522 | - # The index, and what to read off disk, should be the same for both |
1523 | - # versions of the file. |
1524 | - self.assertEqual(file_1_details[0][:3], file_2_details[0][:3]) |
1525 | - |
1526 | - def test_fetch_combines_groups(self): |
1527 | - builder = self.make_branch_builder('source', format='2a') |
1528 | - builder.start_series() |
1529 | - builder.build_snapshot(None, [ |
1530 | - ('add', ('', b'root-id', 'directory', '')), |
1531 | - ('add', ('file', b'file-id', 'file', 'content\n'))], |
1532 | - revision_id=b'1') |
1533 | - builder.build_snapshot([b'1'], [ |
1534 | - ('modify', (b'file-id', 'content-2\n'))], |
1535 | - revision_id=b'2') |
1536 | - builder.finish_series() |
1537 | - source = builder.get_branch() |
1538 | - target = self.make_repository('target', format='2a') |
1539 | - target.fetch(source.repository) |
1540 | - target.lock_read() |
1541 | - self.addCleanup(target.unlock) |
1542 | - details = target.texts._index.get_build_details( |
1543 | - [(b'file-id', '1',), (b'file-id', '2',)]) |
1544 | - file_1_details = details[(b'file-id', '1')] |
1545 | - file_2_details = details[(b'file-id', '2')] |
1546 | + ('add', ('file', b'file-id', 'file', b'content\n'))], |
1547 | + revision_id='1') |
1548 | + builder.build_snapshot([b'1'], [ |
1549 | + ('modify', ('file', b'content-2\n'))], |
1550 | + revision_id=b'2') |
1551 | + builder.finish_series() |
1552 | + source = builder.get_branch() |
1553 | + target = self.make_repository('target', format='2a') |
1554 | + target.fetch(source.repository) |
1555 | + target.lock_read() |
1556 | + self.addCleanup(target.unlock) |
1557 | + details = target.texts._index.get_build_details( |
1558 | + [(b'file-id', b'1',), (b'file-id', b'2',)]) |
1559 | + file_1_details = details[(b'file-id', b'1')] |
1560 | + file_2_details = details[(b'file-id', b'2')] |
1561 | + # The index, and what to read off disk, should be the same for both |
1562 | + # versions of the file. |
1563 | + self.assertEqual(file_1_details[0][:3], file_2_details[0][:3]) |
1564 | + |
1565 | + def test_fetch_combines_groups(self): |
1566 | + builder = self.make_branch_builder('source', format='2a') |
1567 | + builder.start_series() |
1568 | + builder.build_snapshot(None, [ |
1569 | + ('add', ('', b'root-id', 'directory', '')), |
1570 | + ('add', ('file', b'file-id', 'file', 'content\n'))], |
1571 | + revision_id=b'1') |
1572 | + builder.build_snapshot([b'1'], [ |
1573 | + ('modify', ('file', b'content-2\n'))], |
1574 | + revision_id=b'2') |
1575 | + builder.finish_series() |
1576 | + source = builder.get_branch() |
1577 | + target = self.make_repository('target', format='2a') |
1578 | + target.fetch(source.repository) |
1579 | + target.lock_read() |
1580 | + self.addCleanup(target.unlock) |
1581 | + details = target.texts._index.get_build_details( |
1582 | + [(b'file-id', b'1',), (b'file-id', b'2',)]) |
1583 | + file_1_details = details[(b'file-id', b'1')] |
1584 | + file_2_details = details[(b'file-id', b'2')] |
1585 | + # The index, and what to read off disk, should be the same for both |
1586 | + # versions of the file. |
1587 | + self.assertEqual(file_1_details[0][:3], file_2_details[0][:3]) |
1588 | + |
1589 | + def test_fetch_combines_groups(self): |
1590 | + builder = self.make_branch_builder('source', format='2a') |
1591 | + builder.start_series() |
1592 | + builder.build_snapshot(None, [ |
1593 | + ('add', ('', b'root-id', 'directory', '')), |
1594 | + ('add', ('file', b'file-id', 'file', 'content\n'))], |
1595 | + revision_id=b'1') |
1596 | + builder.build_snapshot([b'1'], [ |
1597 | + ('modify', ('file', b'content-2\n'))], |
1598 | + revision_id=b'2') |
1599 | + builder.finish_series() |
1600 | + source = builder.get_branch() |
1601 | + target = self.make_repository('target', format='2a') |
1602 | + target.fetch(source.repository) |
1603 | + target.lock_read() |
1604 | + self.addCleanup(target.unlock) |
1605 | + details = target.texts._index.get_build_details( |
1606 | + [(b'file-id', b'1',), (b'file-id', b'2',)]) |
1607 | + file_1_details = details[(b'file-id', b'1')] |
1608 | + file_2_details = details[(b'file-id', b'2')] |
1609 | # The index, and what to read off disk, should be the same for both |
1610 | # versions of the file. |
1611 | self.assertEqual(file_1_details[0][:3], file_2_details[0][:3]) |
1612 | @@ -705,9 +705,9 @@ |
1613 | # Now change a few of them, so we get a few new pages for the second |
1614 | # revision |
1615 | source_builder.build_snapshot([b'rev-1'], [ |
1616 | - ('modify', (b'aa-id', 'new content for aa-id\n')), |
1617 | - ('modify', (b'cc-id', 'new content for cc-id\n')), |
1618 | - ('modify', (b'zz-id', 'new content for zz-id\n')), |
1619 | + ('modify', ('aa', b'new content for aa-id\n')), |
1620 | + ('modify', ('cc', b'new content for cc-id\n')), |
1621 | + ('modify', ('zz', b'new content for zz-id\n')), |
1622 | ], revision_id=b'rev-2') |
1623 | source_builder.finish_series() |
1624 | source_branch = source_builder.get_branch() |
1625 | @@ -1477,13 +1477,13 @@ |
1626 | ('add', ('f', 'f-id', 'file', 'content\n'))], |
1627 | revision_id='A') |
1628 | builder.build_snapshot(['A'], |
1629 | - [('modify', ('f-id', 'new-content\n'))], |
1630 | + [('modify', ('f', 'new-content\n'))], |
1631 | revision_id='B') |
1632 | builder.build_snapshot(['B'], |
1633 | - [('modify', ('f-id', 'third-content\n'))], |
1634 | + [('modify', ('f', 'third-content\n'))], |
1635 | revision_id='C') |
1636 | builder.build_snapshot(['C'], |
1637 | - [('modify', ('f-id', 'fourth-content\n'))], |
1638 | + [('modify', ('f', 'fourth-content\n'))], |
1639 | revision_id='D') |
1640 | b = builder.get_branch() |
1641 | b.lock_read() |
1642 | @@ -1537,7 +1537,7 @@ |
1643 | ('add', ('dir', 'dir-id', 'directory', None))], |
1644 | revision_id='B') |
1645 | builder.build_snapshot(['B'], [ |
1646 | - ('modify', ('file-id', 'new content\n'))], |
1647 | + ('modify', ('file', 'new content\n'))], |
1648 | revision_id='C') |
1649 | builder.finish_series() |
1650 | return builder.get_branch() |
1651 | |
1652 | === modified file 'breezy/tests/test_workingtree_4.py' |
1653 | --- breezy/tests/test_workingtree_4.py 2018-02-18 15:49:32 +0000 |
1654 | +++ breezy/tests/test_workingtree_4.py 2018-03-27 00:52:31 +0000 |
1655 | @@ -285,7 +285,7 @@ |
1656 | ('add', ('a', 'a-id', 'file', 'content\n'))], |
1657 | revision_id='A') |
1658 | builder.build_snapshot(['A'], [ |
1659 | - ('modify', ('a-id', 'new content\nfor a\n')), |
1660 | + ('modify', ('a', 'new content\nfor a\n')), |
1661 | ('add', ('b', 'b-id', 'file', 'b-content\n'))], |
1662 | revision_id='B') |
1663 | tree = self.make_workingtree('tree') |
1664 | @@ -323,7 +323,7 @@ |
1665 | ('add', ('a', 'a-id', 'file', 'content\n'))], |
1666 | revision_id='A') |
1667 | builder.build_snapshot(['A'], [ |
1668 | - ('modify', ('a-id', 'new content\nfor a\n')), |
1669 | + ('modify', ('a', 'new content\nfor a\n')), |
1670 | ('add', ('b', 'b-id', 'file', 'b-content\n'))], |
1671 | revision_id='B') |
1672 | builder.build_snapshot(['A'], [ |
Looks good, though I wish some of these lines changed had their b-s added for file contents already.