Merge lp:~jelmer/brz/conflicts into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 6896
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
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+341069@code.launchpad.net

Description of the change

Change arguments for 'modify' and 'unversion' in BranchBuilder.build_snapshot from a file-id to path.

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

Looks good, though I wish some of these lines changed had their b-s added for file contents already.

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

Running landing tests failed
https://ci.breezy-vcs.org/job/brz-dev/52/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/branchbuilder.py'
--- breezy/branchbuilder.py 2018-03-25 00:39:16 +0000
+++ breezy/branchbuilder.py 2018-03-27 00:52:31 +0000
@@ -194,8 +194,8 @@
194 It can be None, which indicates to use the last commit.194 It can be None, which indicates to use the last commit.
195 :param actions: A list of actions to perform. Supported actions are:195 :param actions: A list of actions to perform. Supported actions are:
196 ('add', ('path', 'file-id', 'kind', 'content' or None))196 ('add', ('path', 'file-id', 'kind', 'content' or None))
197 ('modify', ('file-id', 'new-content'))197 ('modify', ('path', 'new-content'))
198 ('unversion', 'file-id')198 ('unversion', 'path')
199 ('rename', ('orig-path', 'new-path'))199 ('rename', ('orig-path', 'new-path'))
200 ('flush', None)200 ('flush', None)
201 :param message: An optional commit message, if not supplied, a default201 :param message: An optional commit message, if not supplied, a default
@@ -224,8 +224,7 @@
224 tree = self._tree224 tree = self._tree
225 else:225 else:
226 tree = self._branch.create_memorytree()226 tree = self._branch.create_memorytree()
227 tree.lock_write()227 with tree.lock_write():
228 try:
229 if parent_ids is not None:228 if parent_ids is not None:
230 tree.set_parent_ids(parent_ids,229 tree.set_parent_ids(parent_ids,
231 allow_leftmost_as_ghost=allow_leftmost_as_ghost)230 allow_leftmost_as_ghost=allow_leftmost_as_ghost)
@@ -244,12 +243,12 @@
244 pending.to_add_file_ids.append(file_id)243 pending.to_add_file_ids.append(file_id)
245 pending.to_add_kinds.append(kind)244 pending.to_add_kinds.append(kind)
246 if content is not None:245 if content is not None:
247 pending.new_contents[file_id] = content246 pending.new_contents[path] = content
248 elif action == 'modify':247 elif action == 'modify':
249 file_id, content = info248 path, content = info
250 pending.new_contents[file_id] = content249 pending.new_contents[path] = content
251 elif action == 'unversion':250 elif action == 'unversion':
252 pending.to_unversion_ids.add(info)251 pending.to_unversion_paths.add(info)
253 elif action == 'rename':252 elif action == 'rename':
254 from_relpath, to_relpath = info253 from_relpath, to_relpath = info
255 pending.to_rename.append((from_relpath, to_relpath))254 pending.to_rename.append((from_relpath, to_relpath))
@@ -262,30 +261,25 @@
262 return self._do_commit(tree, message=message, rev_id=revision_id,261 return self._do_commit(tree, message=message, rev_id=revision_id,
263 timestamp=timestamp, timezone=timezone, committer=committer,262 timestamp=timestamp, timezone=timezone, committer=committer,
264 message_callback=message_callback)263 message_callback=message_callback)
265 finally:
266 tree.unlock()
267264
268 def _flush_pending(self, tree, pending):265 def _flush_pending(self, tree, pending):
269 """Flush the pending actions in 'pending', i.e. apply them to 'tree'."""266 """Flush the pending actions in 'pending', i.e. apply them to 'tree'."""
270 for path, file_id in pending.to_add_directories:267 for path, file_id in pending.to_add_directories:
271 if path == '':268 if path == '':
272 old_id = tree.path2id(path)269 if tree.has_filename(path) and path in pending.to_unversion_paths:
273 if old_id is not None and old_id in pending.to_unversion_ids:
274 # We're overwriting this path, no need to unversion270 # We're overwriting this path, no need to unversion
275 pending.to_unversion_ids.discard(old_id)271 pending.to_unversion_paths.discard(path)
276 # Special case, because the path already exists272 # Special case, because the path already exists
277 tree.add([path], [file_id], ['directory'])273 tree.add([path], [file_id], ['directory'])
278 else:274 else:
279 tree.mkdir(path, file_id)275 tree.mkdir(path, file_id)
280 for from_relpath, to_relpath in pending.to_rename:276 for from_relpath, to_relpath in pending.to_rename:
281 tree.rename_one(from_relpath, to_relpath)277 tree.rename_one(from_relpath, to_relpath)
282 if pending.to_unversion_ids:278 if pending.to_unversion_paths:
283 tree.unversion([tree.id2path(fid) for fid in pending.to_unversion_ids])279 tree.unversion(pending.to_unversion_paths)
284 tree.add(pending.to_add_files, pending.to_add_file_ids, pending.to_add_kinds)280 tree.add(pending.to_add_files, pending.to_add_file_ids, pending.to_add_kinds)
285 for file_id, content in viewitems(pending.new_contents):281 for path, content in viewitems(pending.new_contents):
286 tree.put_file_bytes_non_atomic(282 tree.put_file_bytes_non_atomic(path, content)
287 tree.id2path(file_id), content,
288 file_id=file_id)
289283
290 def get_branch(self):284 def get_branch(self):
291 """Return the branch created by the builder."""285 """Return the branch created by the builder."""
@@ -305,6 +299,6 @@
305 self.to_add_file_ids = []299 self.to_add_file_ids = []
306 self.to_add_kinds = []300 self.to_add_kinds = []
307 self.new_contents = {}301 self.new_contents = {}
308 self.to_unversion_ids = set()302 self.to_unversion_paths = set()
309 self.to_rename = []303 self.to_rename = []
310304
311305
=== modified file 'breezy/merge.py'
--- breezy/merge.py 2018-03-25 02:13:54 +0000
+++ breezy/merge.py 2018-03-27 00:52:31 +0000
@@ -1190,15 +1190,16 @@
1190 # At this point, the lcas disagree, and the tip disagree1190 # At this point, the lcas disagree, and the tip disagree
1191 return 'conflict'1191 return 'conflict'
11921192
1193 def merge_names(self, file_id):1193 def merge_names(self, paths):
1194 def get_entry(tree):1194 def get_entry(tree, path):
1195 try:1195 try:
1196 return tree.root_inventory.get_entry(file_id)1196 return next(tree.iter_entries_by_dir(specific_files=[path]))[1]
1197 except errors.NoSuchId:1197 except StopIteration:
1198 return None1198 return None
1199 this_entry = get_entry(self.this_tree)1199 used_base_path, other_path, this_path = paths
1200 other_entry = get_entry(self.other_tree)1200 this_entry = get_entry(self.this_tree, this_path)
1201 base_entry = get_entry(self.base_tree)1201 other_entry = get_entry(self.other_tree, other_path)
1202 base_entry = get_entry(self.base_tree, base_path)
1202 entries = (base_entry, other_entry, this_entry)1203 entries = (base_entry, other_entry, this_entry)
1203 names = []1204 names = []
1204 parents = []1205 parents = []
12051206
=== modified file 'breezy/plugins/commitfromnews/tests/test_committemplate.py'
--- breezy/plugins/commitfromnews/tests/test_committemplate.py 2018-02-18 15:21:06 +0000
+++ breezy/plugins/commitfromnews/tests/test_committemplate.py 2018-03-27 00:52:31 +0000
@@ -95,7 +95,7 @@
95 builder = self.make_branch_builder('test')95 builder = self.make_branch_builder('test')
96 builder.start_series()96 builder.start_series()
97 orig_content = INITIAL_NEWS_CONTENT97 orig_content = INITIAL_NEWS_CONTENT
98 mod_content = """----------------------------98 mod_content = b"""----------------------------
99commitfromnews release notes99commitfromnews release notes
100----------------------------100----------------------------
101101
@@ -118,7 +118,7 @@
118 ('add', ('NEWS', b'foo-id', 'file', orig_content)),118 ('add', ('NEWS', b'foo-id', 'file', orig_content)),
119 ], revision_id=b'BASE-id')119 ], revision_id=b'BASE-id')
120 builder.build_snapshot(None,120 builder.build_snapshot(None,
121 [('modify', (b'foo-id', mod_content)),121 [('modify', ('NEWS', mod_content)),
122 ],122 ],
123 message_callback=msgeditor.generate_commit_message_template)123 message_callback=msgeditor.generate_commit_message_template)
124 builder.finish_series()124 builder.finish_series()
@@ -130,7 +130,7 @@
130 builder = self.make_branch_builder('test')130 builder = self.make_branch_builder('test')
131 builder.start_series()131 builder.start_series()
132 orig_content = INITIAL_NEWS_CONTENT132 orig_content = INITIAL_NEWS_CONTENT
133 mod_content = """----------------------------133 mod_content = b"""----------------------------
134commitfromnews release notes134commitfromnews release notes
135----------------------------135----------------------------
136136
@@ -155,7 +155,7 @@
155 ('add', ('NEWS', b'foo-id', 'file', orig_content)),155 ('add', ('NEWS', b'foo-id', 'file', orig_content)),
156 ], revision_id=b'BASE-id')156 ], revision_id=b'BASE-id')
157 builder.build_snapshot(None,157 builder.build_snapshot(None,
158 [('modify', (b'foo-id', mod_content)),158 [('modify', ('NEWS', mod_content)),
159 ],159 ],
160 message_callback=msgeditor.generate_commit_message_template)160 message_callback=msgeditor.generate_commit_message_template)
161 builder.finish_series()161 builder.finish_series()
162162
=== modified file 'breezy/plugins/po_merge/tests/test_po_merge.py'
--- breezy/plugins/po_merge/tests/test_po_merge.py 2018-02-18 15:21:06 +0000
+++ breezy/plugins/po_merge/tests/test_po_merge.py 2018-03-27 00:52:31 +0000
@@ -103,15 +103,15 @@
103 ], revision_id=b'base')103 ], revision_id=b'base')
104 # The 'other' branch104 # The 'other' branch
105 builder.build_snapshot(['base'],105 builder.build_snapshot(['base'],
106 [('modify', (b'pot-id',106 [('modify', ('po/adduser.pot',
107 _Adduser['other_pot'])),107 _Adduser['other_pot'])),
108 ('modify', (b'po-id',108 ('modify', ('po/fr.po',
109 _Adduser['other_po'])),109 _Adduser['other_po'])),
110 ], revision_id=b'other')110 ], revision_id=b'other')
111 # The 'this' branch111 # The 'this' branch
112 builder.build_snapshot(['base'],112 builder.build_snapshot(['base'],
113 [('modify', (b'pot-id', _Adduser['this_pot'])),113 [('modify', ('po/adduser.pot', _Adduser['this_pot'])),
114 ('modify', (b'po-id', _Adduser['this_po'])),114 ('modify', ('po/fr.po', _Adduser['this_po'])),
115 ], revision_id=b'this')115 ], revision_id=b'this')
116 # builder.get_branch() tip is now 'this'116 # builder.get_branch() tip is now 'this'
117 builder.finish_series()117 builder.finish_series()
118118
=== modified file 'breezy/tests/blackbox/test_dpush.py'
--- breezy/tests/blackbox/test_dpush.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/blackbox/test_dpush.py 2018-03-27 00:52:31 +0000
@@ -130,7 +130,7 @@
130 dc_tree.commit('msg1')130 dc_tree.commit('msg1')
131131
132 builder.build_snapshot(None,132 builder.build_snapshot(None,
133 [('modify', (b'fooid', 'blie'))], revision_id=b'revid2')133 [('modify', ('foo', b'blie'))], revision_id=b'revid2')
134134
135 output, error = self.run_bzr("dpush -d dc d", retcode=3)135 output, error = self.run_bzr("dpush -d dc d", retcode=3)
136 self.assertEqual(output, "")136 self.assertEqual(output, "")
137137
=== modified file 'breezy/tests/blackbox/test_merge.py'
--- breezy/tests/blackbox/test_merge.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/blackbox/test_merge.py 2018-03-27 00:52:31 +0000
@@ -68,11 +68,11 @@
68 ('add', ('fname', 'f-id', 'file', 'a\nb\nc\n'))],68 ('add', ('fname', 'f-id', 'file', 'a\nb\nc\n'))],
69 revision_id=b'rev1')69 revision_id=b'rev1')
70 builder.build_snapshot(['rev1'],70 builder.build_snapshot(['rev1'],
71 [('modify', ('f-id', 'a\nB\nD\n'))],71 [('modify', ('fname', b'a\nB\nD\n'))],
72 revision_id=b'rev2other')72 revision_id=b'rev2other')
73 other = builder.get_branch().controldir.sprout('other').open_branch()73 other = builder.get_branch().controldir.sprout('other').open_branch()
74 builder.build_snapshot(['rev1'],74 builder.build_snapshot(['rev1'],
75 [('modify', ('f-id', 'a\nB\nC\n'))], revision_id=b'rev2this')75 [('modify', ('fname', b'a\nB\nC\n'))], revision_id=b'rev2this')
76 tree = builder.get_branch().create_checkout('tree', lightweight=True)76 tree = builder.get_branch().create_checkout('tree', lightweight=True)
77 return tree, other77 return tree, other
7878
7979
=== modified file 'breezy/tests/blackbox/test_push.py'
--- breezy/tests/blackbox/test_push.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/blackbox/test_push.py 2018-03-27 00:52:31 +0000
@@ -579,9 +579,9 @@
579 ('add', ('', 'root-id', 'directory', '')),579 ('add', ('', 'root-id', 'directory', '')),
580 ('add', ('filename', 'f-id', 'file', 'content\n'))],580 ('add', ('filename', 'f-id', 'file', 'content\n'))],
581 revision_id=b'rev-1')581 revision_id=b'rev-1')
582 builder.build_snapshot(['rev-1'], [], revision_id=b'rev-2')582 builder.build_snapshot([b'rev-1'], [], revision_id=b'rev-2')
583 builder.build_snapshot(['rev-2'],583 builder.build_snapshot([b'rev-2'],
584 [('modify', ('f-id', 'new-content\n'))],584 [('modify', ('filename', b'new-content\n'))],
585 revision_id=b'rev-3')585 revision_id=b'rev-3')
586 builder.finish_series()586 builder.finish_series()
587 branch = builder.get_branch()587 branch = builder.get_branch()
588588
=== modified file 'breezy/tests/per_branch/test_create_clone.py'
--- breezy/tests/per_branch/test_create_clone.py 2017-11-16 00:39:04 +0000
+++ breezy/tests/per_branch/test_create_clone.py 2018-03-27 00:52:31 +0000
@@ -115,10 +115,10 @@
115 raise tests.TestNotApplicable('format not directly constructable')115 raise tests.TestNotApplicable('format not directly constructable')
116 builder.start_series()116 builder.start_series()
117 rev1 = builder.build_snapshot(None, [117 rev1 = builder.build_snapshot(None, [
118 ('add', ('', 'root-id', 'directory', ''))])118 ('add', ('', None, 'directory', ''))])
119 rev2 = builder.build_snapshot([rev1], [])119 rev2 = builder.build_snapshot([rev1], [])
120 other = builder.build_snapshot(None, [120 other = builder.build_snapshot(None, [
121 ('add', ('', 'root-id', 'directory', ''))])121 ('add', ('', None, 'directory', ''))])
122 rev3 = builder.build_snapshot([rev2, other], [])122 rev3 = builder.build_snapshot([rev2, other], [])
123 builder.finish_series()123 builder.finish_series()
124 local = builder.get_branch()124 local = builder.get_branch()
125125
=== modified file 'breezy/tests/per_branch/test_iter_merge_sorted_revisions.py'
--- breezy/tests/per_branch/test_iter_merge_sorted_revisions.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/per_branch/test_iter_merge_sorted_revisions.py 2018-03-27 00:52:31 +0000
@@ -38,7 +38,7 @@
38 def make_snapshot(self, builder, parents, revid_name):38 def make_snapshot(self, builder, parents, revid_name):
39 self.assertNotIn(revid_name, self.revids)39 self.assertNotIn(revid_name, self.revids)
40 if parents is None:40 if parents is None:
41 files = [('add', ('', 'TREE_ROOT', 'directory', '')),]41 files = [('add', ('', None, 'directory', '')),]
42 else:42 else:
43 parents = [self.revids[name] for name in parents]43 parents = [self.revids[name] for name in parents]
44 files = []44 files = []
@@ -168,7 +168,7 @@
168 def make_snapshot(self, builder, parents, revid_name):168 def make_snapshot(self, builder, parents, revid_name):
169 self.assertNotIn(revid_name, self.revids)169 self.assertNotIn(revid_name, self.revids)
170 if parents is None:170 if parents is None:
171 files = [('add', ('', 'TREE_ROOT', 'directory', '')),]171 files = [('add', ('', None, 'directory', '')),]
172 else:172 else:
173 parents = [self.revids[name] for name in parents]173 parents = [self.revids[name] for name in parents]
174 files = []174 files = []
175175
=== modified file 'breezy/tests/per_branch/test_push.py'
--- breezy/tests/per_branch/test_push.py 2018-02-27 18:44:59 +0000
+++ breezy/tests/per_branch/test_push.py 2018-03-27 00:52:31 +0000
@@ -285,7 +285,7 @@
285 ('add', ('filename', 'f-id', 'file', 'content\n'))])285 ('add', ('filename', 'f-id', 'file', 'content\n'))])
286 revid2 = builder.build_snapshot([revid1], [])286 revid2 = builder.build_snapshot([revid1], [])
287 revid3 = builder.build_snapshot([revid2],287 revid3 = builder.build_snapshot([revid2],
288 [('modify', ('f-id', 'new-content\n'))])288 [('modify', ('filename', 'new-content\n'))])
289 builder.finish_series()289 builder.finish_series()
290 trunk = builder.get_branch()290 trunk = builder.get_branch()
291 # Sprout rev-1 to "trunk", so that we can stack on it.291 # Sprout rev-1 to "trunk", so that we can stack on it.
292292
=== modified file 'breezy/tests/per_interbranch/test_push.py'
--- breezy/tests/per_interbranch/test_push.py 2018-03-06 21:57:52 +0000
+++ breezy/tests/per_interbranch/test_push.py 2018-03-27 00:52:31 +0000
@@ -266,11 +266,11 @@
266 'BranchBuilder can not initialize some formats')266 'BranchBuilder can not initialize some formats')
267 builder.start_series()267 builder.start_series()
268 revid1 = builder.build_snapshot(None, [268 revid1 = builder.build_snapshot(None, [
269 ('add', ('', 'root-id', 'directory', '')),269 ('add', ('', None, 'directory', '')),
270 ('add', ('filename', 'f-id', 'file', 'content\n'))])270 ('add', ('filename', None, 'file', 'content\n'))])
271 revid2 = builder.build_snapshot([revid1], [])271 revid2 = builder.build_snapshot([revid1], [])
272 revid3 = builder.build_snapshot([revid2],272 revid3 = builder.build_snapshot([revid2],
273 [('modify', ('f-id', 'new-content\n'))])273 [('modify', ('filename', 'new-content\n'))])
274 builder.finish_series()274 builder.finish_series()
275 trunk = builder.get_branch()275 trunk = builder.get_branch()
276 # Sprout rev-1 to "trunk", so that we can stack on it.276 # Sprout rev-1 to "trunk", so that we can stack on it.
@@ -304,7 +304,7 @@
304 raise tests.TestNotApplicable('format not directly constructable')304 raise tests.TestNotApplicable('format not directly constructable')
305 builder.start_series()305 builder.start_series()
306 first = builder.build_snapshot(None, [306 first = builder.build_snapshot(None, [
307 ('add', ('', 'root-id', 'directory', ''))])307 ('add', ('', None, 'directory', ''))])
308 second = builder.build_snapshot([first], [])308 second = builder.build_snapshot([first], [])
309 third = builder.build_snapshot([second], [])309 third = builder.build_snapshot([second], [])
310 fourth = builder.build_snapshot([third], [])310 fourth = builder.build_snapshot([third], [])
311311
=== modified file 'breezy/tests/per_interrepository/test_fetch.py'
--- breezy/tests/per_interrepository/test_fetch.py 2018-03-25 11:39:36 +0000
+++ breezy/tests/per_interrepository/test_fetch.py 2018-03-27 00:52:31 +0000
@@ -156,10 +156,10 @@
156 ('add', ('file', 'file-id', 'file', 'content\n'))],156 ('add', ('file', 'file-id', 'file', 'content\n'))],
157 revision_id=b'first')157 revision_id=b'first')
158 builder.build_snapshot(['first'], [158 builder.build_snapshot(['first'], [
159 ('modify', ('file-id', 'second content\n'))],159 ('modify', ('file', b'second content\n'))],
160 revision_id=b'second')160 revision_id=b'second')
161 builder.build_snapshot(['second'], [161 builder.build_snapshot([b'second'], [
162 ('modify', ('file-id', 'third content\n'))],162 ('modify', ('file', b'third content\n'))],
163 revision_id=b'third')163 revision_id=b'third')
164 builder.finish_series()164 builder.finish_series()
165 branch = builder.get_branch()165 branch = builder.get_branch()
@@ -207,16 +207,16 @@
207 builder.start_series()207 builder.start_series()
208 builder.build_snapshot(None, [208 builder.build_snapshot(None, [
209 ('add', ('', b'root-id', 'directory', '')),209 ('add', ('', b'root-id', 'directory', '')),
210 ('add', ('file', b'file-id', 'file', b'content\n'))],210 ('add', ('file', b'file-id', 'file', 'content\n'))],
211 revision_id=b'base')211 revision_id=b'base')
212 builder.build_snapshot([b'base'], [212 builder.build_snapshot([b'base'], [
213 ('modify', (b'file-id', b'left content\n'))],213 ('modify', ('file', b'left content\n'))],
214 revision_id=b'left')214 revision_id=b'left')
215 builder.build_snapshot([b'base'], [215 builder.build_snapshot([b'base'], [
216 ('modify', (b'file-id', b'right content\n'))],216 ('modify', ('file', b'right content\n'))],
217 revision_id=b'right')217 revision_id=b'right')
218 builder.build_snapshot([b'left', b'right'], [218 builder.build_snapshot([b'left', b'right'], [
219 ('modify', (b'file-id', b'left and right content\n'))],219 ('modify', ('file', b'left and right content\n'))],
220 revision_id=b'merge')220 revision_id=b'merge')
221 builder.finish_series()221 builder.finish_series()
222 branch = builder.get_branch()222 branch = builder.get_branch()
@@ -284,10 +284,10 @@
284 ('add', ('file', b'file-id', 'file', b'content\n'))],284 ('add', ('file', b'file-id', 'file', b'content\n'))],
285 revision_id=b'base')285 revision_id=b'base')
286 builder.build_snapshot([b'base'], [286 builder.build_snapshot([b'base'], [
287 ('modify', (b'file-id', b'second content\n'))],287 ('modify', ('file', b'second content\n'))],
288 revision_id=b'second')288 revision_id=b'second')
289 builder.build_snapshot([b'second', b'ghost'], [289 builder.build_snapshot([b'second', b'ghost'], [
290 ('modify', (b'file-id', 'third content\n'))],290 ('modify', ('file', b'third content\n'))],
291 revision_id=b'third')291 revision_id=b'third')
292 builder.finish_series()292 builder.finish_series()
293 branch = builder.get_branch()293 branch = builder.get_branch()
@@ -347,14 +347,14 @@
347 ('add', ('', 'root-id', 'directory', '')),347 ('add', ('', 'root-id', 'directory', '')),
348 ('add', ('file', 'file-id', 'file', 'content\n'))],348 ('add', ('file', 'file-id', 'file', 'content\n'))],
349 revision_id=b'base')349 revision_id=b'base')
350 builder.build_snapshot(['base'], [350 builder.build_snapshot([b'base'], [
351 ('modify', ('file-id', 'left content\n'))],351 ('modify', ('file', b'left content\n'))],
352 revision_id=b'left')352 revision_id=b'left')
353 builder.build_snapshot(['base'], [353 builder.build_snapshot([b'base'], [
354 ('modify', ('file-id', 'right content\n'))],354 ('modify', ('file', b'right content\n'))],
355 revision_id=b'right')355 revision_id=b'right')
356 builder.build_snapshot(['left', 'right'], [356 builder.build_snapshot([b'left', b'right'], [
357 ('modify', ('file-id', 'left and right content\n'))],357 ('modify', ('file', b'left and right content\n'))],
358 revision_id=b'merge')358 revision_id=b'merge')
359 builder.finish_series()359 builder.finish_series()
360 branch = builder.get_branch()360 branch = builder.get_branch()
361361
=== modified file 'breezy/tests/per_merger.py'
--- breezy/tests/per_merger.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/per_merger.py 2018-03-27 00:52:31 +0000
@@ -131,11 +131,11 @@
131 ], revision_id=b'BASE-id')131 ], revision_id=b'BASE-id')
132 # Delete 'b\n'132 # Delete 'b\n'
133 builder.build_snapshot([b'BASE-id'],133 builder.build_snapshot([b'BASE-id'],
134 [('modify', (b'foo-id', b'a\nc\nd\ne\n'))],134 [('modify', ('foo', b'a\nc\nd\ne\n'))],
135 revision_id=b'OTHER-id')135 revision_id=b'OTHER-id')
136 # Modify 'b\n', add 'X\n'136 # Modify 'b\n', add 'X\n'
137 builder.build_snapshot([b'BASE-id'],137 builder.build_snapshot([b'BASE-id'],
138 [('modify', (b'foo-id', b'a\nb2\nc\nd\nX\ne\n'))],138 [('modify', ('foo', b'a\nb2\nc\nd\nX\ne\n'))],
139 revision_id=b'THIS-id')139 revision_id=b'THIS-id')
140 builder.finish_series()140 builder.finish_series()
141 branch = builder.get_branch()141 branch = builder.get_branch()
142142
=== modified file 'breezy/tests/per_pack_repository.py'
--- breezy/tests/per_pack_repository.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/per_pack_repository.py 2018-03-27 00:52:31 +0000
@@ -324,7 +324,7 @@
324 ('add', ('file', 'file-id', 'file', 'B content\n'))],324 ('add', ('file', 'file-id', 'file', 'B content\n'))],
325 revision_id=b'B-id')325 revision_id=b'B-id')
326 builder.build_snapshot(None, [326 builder.build_snapshot(None, [
327 ('modify', ('file-id', 'C content\n'))],327 ('modify', ('file', b'C content\n'))],
328 revision_id=b'C-id')328 revision_id=b'C-id')
329 builder.finish_series()329 builder.finish_series()
330 b = builder.get_branch()330 b = builder.get_branch()
331331
=== modified file 'breezy/tests/per_repository/test_fetch.py'
--- breezy/tests/per_repository/test_fetch.py 2018-03-08 23:32:04 +0000
+++ breezy/tests/per_repository/test_fetch.py 2018-03-27 00:52:31 +0000
@@ -195,7 +195,7 @@
195 self.do_test_fetch_to_rich_root_sets_parents_correctly(195 self.do_test_fetch_to_rich_root_sets_parents_correctly(
196 (),196 (),
197 [('base', None, [('add', ('', ROOT_ID, 'directory', ''))]),197 [('base', None, [('add', ('', ROOT_ID, 'directory', ''))]),
198 ('tip', None, [('unversion', ROOT_ID),198 ('tip', None, [('unversion', ''),
199 ('add', ('', 'my-root', 'directory', '')),199 ('add', ('', 'my-root', 'directory', '')),
200 ]),200 ]),
201 ], root_id='my-root')201 ], root_id='my-root')
@@ -208,8 +208,8 @@
208 [('origin', None, [('add', ('', ROOT_ID, 'directory', '')),208 [('origin', None, [('add', ('', ROOT_ID, 'directory', '')),
209 ('add', ('child', 'my-root', 'directory', ''))]),209 ('add', ('child', 'my-root', 'directory', ''))]),
210 ('base', None, []),210 ('base', None, []),
211 ('tip', None, [('unversion', 'my-root'),211 ('tip', None, [('unversion', 'child'),
212 ('unversion', ROOT_ID),212 ('unversion', ''),
213 ('flush', None),213 ('flush', None),
214 ('add', ('', 'my-root', 'directory', '')),214 ('add', ('', 'my-root', 'directory', '')),
215 ]),215 ]),
@@ -220,9 +220,9 @@
220 self.do_test_fetch_to_rich_root_sets_parents_correctly(220 self.do_test_fetch_to_rich_root_sets_parents_correctly(
221 (('my-root', 'right'),),221 (('my-root', 'right'),),
222 [('base', None, [('add', ('', ROOT_ID, 'directory', ''))]),222 [('base', None, [('add', ('', ROOT_ID, 'directory', ''))]),
223 ('right', None, [('unversion', ROOT_ID),223 ('right', None, [('unversion', ''),
224 ('add', ('', 'my-root', 'directory', ''))]),224 ('add', ('', 'my-root', 'directory', ''))]),
225 ('tip', ['base', 'right'], [('unversion', ROOT_ID),225 ('tip', ['base', 'right'], [('unversion', ''),
226 ('add', ('', 'my-root', 'directory', '')),226 ('add', ('', 'my-root', 'directory', '')),
227 ]),227 ]),
228 ], root_id='my-root')228 ], root_id='my-root')
@@ -237,12 +237,12 @@
237 ('add', ('child', 'my-root', 'directory', ''))]),237 ('add', ('child', 'my-root', 'directory', ''))]),
238 ('base', None, []),238 ('base', None, []),
239 # 'my-root' at root239 # 'my-root' at root
240 ('right', None, [('unversion', 'my-root'),240 ('right', None, [('unversion', 'child'),
241 ('unversion', ROOT_ID),241 ('unversion', ''),
242 ('flush', None),242 ('flush', None),
243 ('add', ('', 'my-root', 'directory', ''))]),243 ('add', ('', 'my-root', 'directory', ''))]),
244 ('tip', ['base', 'right'], [('unversion', 'my-root'),244 ('tip', ['base', 'right'], [('unversion', ''),
245 ('unversion', ROOT_ID),245 ('unversion', 'child'),
246 ('flush', None),246 ('flush', None),
247 ('add', ('', 'my-root', 'directory', '')),247 ('add', ('', 'my-root', 'directory', '')),
248 ]),248 ]),
249249
=== modified file 'breezy/tests/per_repository/test_repository.py'
--- breezy/tests/per_repository/test_repository.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/per_repository/test_repository.py 2018-03-27 00:52:31 +0000
@@ -594,7 +594,7 @@
594 builder = self.make_branch_builder('.')594 builder = self.make_branch_builder('.')
595 builder.start_series()595 builder.start_series()
596 rev_a = builder.build_snapshot(None, [596 rev_a = builder.build_snapshot(None, [
597 ('add', ('', 'root-id', 'directory', None))])597 ('add', ('', None, 'directory', None))])
598 builder.finish_series()598 builder.finish_series()
599 b = builder.get_branch()599 b = builder.get_branch()
600 b.lock_write()600 b.lock_write()
601601
=== modified file 'breezy/tests/per_repository_chk/test_supported.py'
--- breezy/tests/per_repository_chk/test_supported.py 2017-11-16 00:39:04 +0000
+++ breezy/tests/per_repository_chk/test_supported.py 2018-03-27 00:52:31 +0000
@@ -351,7 +351,7 @@
351 ('add', ('file-' + name, 'file-%s-id' % name, 'file',351 ('add', ('file-' + name, 'file-%s-id' % name, 'file',
352 'content %s\n' % name)))352 'content %s\n' % name)))
353 file_modifies.append(353 file_modifies.append(
354 ('modify', ('file-%s-id' % name, 'new content %s\n' % name)))354 ('modify', ('file-' + name, 'new content %s\n' % name)))
355 builder.build_snapshot(None, [355 builder.build_snapshot(None, [
356 ('add', ('', 'root-id', 'directory', None))] +356 ('add', ('', 'root-id', 'directory', None))] +
357 file_adds,357 file_adds,
358358
=== modified file 'breezy/tests/per_repository_reference/test_fetch.py'
--- breezy/tests/per_repository_reference/test_fetch.py 2018-02-17 02:02:38 +0000
+++ breezy/tests/per_repository_reference/test_fetch.py 2018-03-27 00:52:31 +0000
@@ -29,22 +29,22 @@
29 def make_source_branch(self):29 def make_source_branch(self):
30 # It would be nice if there was a way to force this to be memory-only30 # It would be nice if there was a way to force this to be memory-only
31 builder = self.make_branch_builder('source')31 builder = self.make_branch_builder('source')
32 content = ['content lines\n'32 content = [b'content lines\n'
33 'for the first revision\n'33 b'for the first revision\n'
34 'which is a marginal amount of content\n'34 b'which is a marginal amount of content\n'
35 ]35 ]
36 builder.start_series()36 builder.start_series()
37 builder.build_snapshot(None, [37 builder.build_snapshot(None, [
38 ('add', ('', b'root-id', 'directory', None)),38 ('add', ('', b'root-id', 'directory', None)),
39 ('add', ('a', b'a-id', 'file', ''.join(content))),39 ('add', ('a', b'a-id', 'file', ''.join(content))),
40 ], revision_id=b'A-id')40 ], revision_id=b'A-id')
41 content.append('and some more lines for B\n')41 content.append(b'and some more lines for B\n')
42 builder.build_snapshot([b'A-id'], [42 builder.build_snapshot([b'A-id'], [
43 ('modify', (b'a-id', ''.join(content)))],43 ('modify', ('a', b''.join(content)))],
44 revision_id=b'B-id')44 revision_id=b'B-id')
45 content.append('and yet even more content for C\n')45 content.append('and yet even more content for C\n')
46 builder.build_snapshot([b'B-id'], [46 builder.build_snapshot([b'B-id'], [
47 ('modify', (b'a-id', ''.join(content)))],47 ('modify', ('a', b''.join(content)))],
48 revision_id=b'C-id')48 revision_id=b'C-id')
49 builder.finish_series()49 builder.finish_series()
50 source_b = builder.get_branch()50 source_b = builder.get_branch()
5151
=== modified file 'breezy/tests/per_repository_reference/test_get_record_stream.py'
--- breezy/tests/per_repository_reference/test_get_record_stream.py 2017-11-16 00:39:04 +0000
+++ breezy/tests/per_repository_reference/test_get_record_stream.py 2018-03-27 00:52:31 +0000
@@ -50,31 +50,31 @@
50 ('add', ('file', 'f-id', 'file', 'initial content\n')),50 ('add', ('file', 'f-id', 'file', 'initial content\n')),
51 ], revision_id='A')51 ], revision_id='A')
52 builder.build_snapshot(['A'], [52 builder.build_snapshot(['A'], [
53 ('modify', ('f-id', 'initial content\n'53 ('modify', ('file', 'initial content\n'
54 'and B content\n')),54 'and B content\n')),
55 ], revision_id='B')55 ], revision_id='B')
56 builder.build_snapshot(['A'], [56 builder.build_snapshot(['A'], [
57 ('modify', ('f-id', 'initial content\n'57 ('modify', ('file', 'initial content\n'
58 'and C content\n')),58 'and C content\n')),
59 ], revision_id='C')59 ], revision_id='C')
60 builder.build_snapshot(['B', 'C'], [60 builder.build_snapshot(['B', 'C'], [
61 ('modify', ('f-id', 'initial content\n'61 ('modify', ('file', 'initial content\n'
62 'and B content\n'62 'and B content\n'
63 'and C content\n')),63 'and C content\n')),
64 ], revision_id='D')64 ], revision_id='D')
65 builder.build_snapshot(['C'], [65 builder.build_snapshot(['C'], [
66 ('modify', ('f-id', 'initial content\n'66 ('modify', ('file', 'initial content\n'
67 'and C content\n'67 'and C content\n'
68 'and E content\n')),68 'and E content\n')),
69 ], revision_id='E')69 ], revision_id='E')
70 builder.build_snapshot(['D'], [70 builder.build_snapshot(['D'], [
71 ('modify', ('f-id', 'initial content\n'71 ('modify', ('file', 'initial content\n'
72 'and B content\n'72 'and B content\n'
73 'and C content\n'73 'and C content\n'
74 'and F content\n')),74 'and F content\n')),
75 ], revision_id='F')75 ], revision_id='F')
76 builder.build_snapshot(['E', 'D'], [76 builder.build_snapshot(['E', 'D'], [
77 ('modify', ('f-id', 'initial content\n'77 ('modify', ('file', 'initial content\n'
78 'and B content\n'78 'and B content\n'
79 'and C content\n'79 'and C content\n'
80 'and E content\n')),80 'and E content\n')),
8181
=== modified file 'breezy/tests/per_repository_reference/test_unlock.py'
--- breezy/tests/per_repository_reference/test_unlock.py 2017-11-16 00:39:04 +0000
+++ breezy/tests/per_repository_reference/test_unlock.py 2018-03-27 00:52:31 +0000
@@ -39,10 +39,10 @@
39 ('add', ('file', 'file-id', 'file', 'contents\n'))],39 ('add', ('file', 'file-id', 'file', 'contents\n'))],
40 revision_id='A-id')40 revision_id='A-id')
41 builder.build_snapshot(['A-id'], [41 builder.build_snapshot(['A-id'], [
42 ('modify', ('file-id', 'new-content\n'))],42 ('modify', ('file', 'new-content\n'))],
43 revision_id='B-id')43 revision_id='B-id')
44 builder.build_snapshot(['B-id'], [44 builder.build_snapshot(['B-id'], [
45 ('modify', ('file-id', 'yet more content\n'))],45 ('modify', ('file', 'yet more content\n'))],
46 revision_id='C-id')46 revision_id='C-id')
47 builder.finish_series()47 builder.finish_series()
48 source_b = builder.get_branch()48 source_b = builder.get_branch()
4949
=== modified file 'breezy/tests/per_repository_vf/test_fileid_involved.py'
--- breezy/tests/per_repository_vf/test_fileid_involved.py 2018-03-24 23:36:29 +0000
+++ breezy/tests/per_repository_vf/test_fileid_involved.py 2018-03-27 00:52:31 +0000
@@ -100,10 +100,10 @@
100 ('add', ('file', 'file-id', 'file', 'contents\n'))],100 ('add', ('file', 'file-id', 'file', 'contents\n'))],
101 revision_id='A-id')101 revision_id='A-id')
102 builder.build_snapshot(['A-id'], [102 builder.build_snapshot(['A-id'], [
103 ('modify', ('file-id', 'new-content\n'))],103 ('modify', ('file', 'new-content\n'))],
104 revision_id='B-id')104 revision_id='B-id')
105 builder.build_snapshot(['B-id'], [105 builder.build_snapshot(['B-id'], [
106 ('modify', ('file-id', 'yet more content\n'))],106 ('modify', ('file', 'yet more content\n'))],
107 revision_id='C-id')107 revision_id='C-id')
108 builder.finish_series()108 builder.finish_series()
109 source_b = builder.get_branch()109 source_b = builder.get_branch()
110110
=== modified file 'breezy/tests/per_repository_vf/test_merge_directive.py'
--- breezy/tests/per_repository_vf/test_merge_directive.py 2017-11-19 18:35:20 +0000
+++ breezy/tests/per_repository_vf/test_merge_directive.py 2018-03-27 00:52:31 +0000
@@ -48,7 +48,7 @@
48 ('add', ('f', 'f-id', 'file', 'initial content\n')),48 ('add', ('f', 'f-id', 'file', 'initial content\n')),
49 ], revision_id='A')49 ], revision_id='A')
50 builder.build_snapshot('A', [50 builder.build_snapshot('A', [
51 ('modify', ('f-id', 'new content\n')),51 ('modify', ('f', 'new content\n')),
52 ], revision_id='B')52 ], revision_id='B')
53 builder.finish_series()53 builder.finish_series()
54 b1 = builder.get_branch()54 b1 = builder.get_branch()
5555
=== modified file 'breezy/tests/per_workingtree/test_annotate_iter.py'
--- breezy/tests/per_workingtree/test_annotate_iter.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/per_workingtree/test_annotate_iter.py 2018-03-27 00:52:31 +0000
@@ -24,8 +24,8 @@
24 def make_single_rev_tree(self):24 def make_single_rev_tree(self):
25 builder = self.make_branch_builder('branch')25 builder = self.make_branch_builder('branch')
26 revid = builder.build_snapshot(None, [26 revid = builder.build_snapshot(None, [
27 ('add', ('', 'TREE_ROOT', 'directory', None)),27 ('add', ('', None, 'directory', None)),
28 ('add', ('file', 'file-id', 'file', 'initial content\n')),28 ('add', ('file', None, 'file', 'initial content\n')),
29 ])29 ])
30 b = builder.get_branch()30 b = builder.get_branch()
31 tree = b.create_checkout('tree', lightweight=True)31 tree = b.create_checkout('tree', lightweight=True)
@@ -52,14 +52,14 @@
52 builder = self.make_branch_builder('branch')52 builder = self.make_branch_builder('branch')
53 builder.start_series()53 builder.start_series()
54 revid1 = builder.build_snapshot(None, [54 revid1 = builder.build_snapshot(None, [
55 ('add', ('', b'TREE_ROOT', 'directory', None)),55 ('add', ('', None, 'directory', None)),
56 ('add', ('file', b'file-id', 'file', 'initial content\n')),56 ('add', ('file', None, 'file', b'initial content\n')),
57 ])57 ])
58 revid2 = builder.build_snapshot([revid1], [58 revid2 = builder.build_snapshot([revid1], [
59 ('modify', (b'file-id', 'initial content\ncontent in 2\n')),59 ('modify', ('file', b'initial content\ncontent in 2\n')),
60 ])60 ])
61 revid3 = builder.build_snapshot([revid1], [61 revid3 = builder.build_snapshot([revid1], [
62 ('modify', (b'file-id', 'initial content\ncontent in 3\n')),62 ('modify', ('file', b'initial content\ncontent in 3\n')),
63 ])63 ])
64 builder.finish_series()64 builder.finish_series()
65 b = builder.get_branch()65 b = builder.get_branch()
@@ -81,10 +81,10 @@
81 builder = self.make_branch_builder('branch')81 builder = self.make_branch_builder('branch')
82 builder.start_series()82 builder.start_series()
83 revid1 = builder.build_snapshot(None, [83 revid1 = builder.build_snapshot(None, [
84 ('add', ('', b'TREE_ROOT', 'directory', None)),84 ('add', ('', None, 'directory', None)),
85 ])85 ])
86 revid2 = builder.build_snapshot([revid1], [86 revid2 = builder.build_snapshot([revid1], [
87 ('add', ('file', b'file-id', 'file', 'initial content\n')),87 ('add', ('file', None, 'file', b'initial content\n')),
88 ])88 ])
89 revid3 = builder.build_snapshot([revid1], [])89 revid3 = builder.build_snapshot([revid1], [])
90 builder.finish_series()90 builder.finish_series()
@@ -104,13 +104,13 @@
104 builder = self.make_branch_builder('branch')104 builder = self.make_branch_builder('branch')
105 builder.start_series()105 builder.start_series()
106 revid1 = builder.build_snapshot(None, [106 revid1 = builder.build_snapshot(None, [
107 ('add', ('', b'TREE_ROOT', 'directory', None)),107 ('add', ('', None, 'directory', None)),
108 ])108 ])
109 revid2 = builder.build_snapshot([revid1], [109 revid2 = builder.build_snapshot([revid1], [
110 ('add', ('file', b'file-id', 'file', 'initial content\n')),110 ('add', ('file', None, 'file', b'initial content\n')),
111 ])111 ])
112 revid3 = builder.build_snapshot([revid1], [112 revid3 = builder.build_snapshot([revid1], [
113 ('add', ('a_dir', b'file-id', 'directory', None)),113 ('add', ('a_dir', None, 'directory', None)),
114 ])114 ])
115 builder.finish_series()115 builder.finish_series()
116 b = builder.get_branch()116 b = builder.get_branch()
@@ -129,13 +129,13 @@
129 builder = self.make_branch_builder('branch')129 builder = self.make_branch_builder('branch')
130 builder.start_series()130 builder.start_series()
131 revid1 = builder.build_snapshot(None, [131 revid1 = builder.build_snapshot(None, [
132 ('add', ('', b'TREE_ROOT', 'directory', None)),132 ('add', ('', None, 'directory', None)),
133 ('add', ('file', b'file-id', 'file', 'initial content\n')),133 ('add', ('file', None, 'file', b'initial content\n')),
134 ])134 ])
135 revid2 = builder.build_snapshot([revid1], [135 revid2 = builder.build_snapshot([revid1], [
136 ])136 ])
137 revid3 = builder.build_snapshot([revid1], [137 revid3 = builder.build_snapshot([revid1], [
138 ('modify', (b'file-id', 'initial content\ncontent in 3\n')),138 ('modify', ('file', b'initial content\ncontent in 3\n')),
139 ])139 ])
140 builder.finish_series()140 builder.finish_series()
141 b = builder.get_branch()141 b = builder.get_branch()
@@ -154,17 +154,17 @@
154 builder = self.make_branch_builder('branch')154 builder = self.make_branch_builder('branch')
155 builder.start_series()155 builder.start_series()
156 revid1 = builder.build_snapshot(None, [156 revid1 = builder.build_snapshot(None, [
157 ('add', ('', 'TREE_ROOT', 'directory', None)),157 ('add', ('', None, 'directory', None)),
158 ('add', ('file', 'file-id', 'file', 'initial content\n')),158 ('add', ('file', None, 'file', 'initial content\n')),
159 ])159 ])
160 revid2 = builder.build_snapshot([revid1], [160 revid2 = builder.build_snapshot([revid1], [
161 ('modify', ('file-id', 'initial content\nnew content\n')),161 ('modify', ('file', 'initial content\nnew content\n')),
162 ])162 ])
163 revid3 = builder.build_snapshot([revid2], [163 revid3 = builder.build_snapshot([revid2], [
164 ('modify', ('file-id', 'initial content\ncontent in 3\n')),164 ('modify', ('file', 'initial content\ncontent in 3\n')),
165 ])165 ])
166 revid4 = builder.build_snapshot([revid3], [166 revid4 = builder.build_snapshot([revid3], [
167 ('modify', ('file-id', 'initial content\nnew content\n')),167 ('modify', ('file', 'initial content\nnew content\n')),
168 ])168 ])
169 # In this case, the content locally is the same as content in basis169 # In this case, the content locally is the same as content in basis
170 # tree, but the merge revision states that *it* should win170 # tree, but the merge revision states that *it* should win
171171
=== modified file 'breezy/tests/per_workingtree/test_merge_from_branch.py'
--- breezy/tests/per_workingtree/test_merge_from_branch.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/per_workingtree/test_merge_from_branch.py 2018-03-27 00:52:31 +0000
@@ -124,36 +124,33 @@
124 bld_inner.start_series()124 bld_inner.start_series()
125 rev1 = bld_inner.build_snapshot(125 rev1 = bld_inner.build_snapshot(
126 None,126 None,
127 [('add', ('', 'inner-root-id', 'directory', '')),127 [('add', ('', None, 'directory', '')),
128 ('add', ('dir', 'dir-id', 'directory', '')),128 ('add', ('dir', None, 'directory', '')),
129 ('add', ('dir/file1', 'file1-id', 'file', 'file1 content\n')),129 ('add', ('dir/file1', None, 'file', 'file1 content\n')),
130 ('add', ('file3', 'file3-id', 'file', 'file3 content\n')),130 ('add', ('file3', None, 'file', 'file3 content\n')),
131 ])131 ])
132 rev4 = bld_inner.build_snapshot(132 rev4 = bld_inner.build_snapshot(
133 [rev1],133 [rev1],
134 [('add', ('file4', 'file4-id', 'file', 'file4 content\n'))134 [('add', ('file4', None, 'file', 'file4 content\n'))
135 ])135 ])
136 rev5 = bld_inner.build_snapshot(136 rev5 = bld_inner.build_snapshot(
137 [rev4], [('rename', ('file4', 'dir/file4'))])137 [rev4], [('rename', ('file4', 'dir/file4'))])
138 rev3 = bld_inner.build_snapshot(138 rev3 = bld_inner.build_snapshot(
139 [rev1], [('modify', ('file3-id', 'new file3 contents\n')),])139 [rev1], [('modify', ('file3', 'new file3 contents\n')),])
140 rev2 = bld_inner.build_snapshot(140 rev2 = bld_inner.build_snapshot(
141 [rev1],141 [rev1],
142 [('add', ('dir/file2', 'file2-id', 'file', 'file2 content\n')),142 [('add', ('dir/file2', None, 'file', 'file2 content\n')),
143 ], revision_id='2')143 ])
144 bld_inner.finish_series()144 bld_inner.finish_series()
145 br = bld_inner.get_branch()145 br = bld_inner.get_branch()
146 return br, [rev1, rev2, rev3, rev4, rev5]146 return br, [rev1, rev2, rev3, rev4, rev5]
147147
148 def assertTreeLayout(self, expected, tree):148 def assertTreeLayout(self, expected, tree):
149 tree.lock_read()149 with tree.lock_read():
150 try:
151 actual = [e[0] for e in tree.list_files()]150 actual = [e[0] for e in tree.list_files()]
152 # list_files doesn't guarantee order151 # list_files doesn't guarantee order
153 actual = sorted(actual)152 actual = sorted(actual)
154 self.assertEqual(expected, actual)153 self.assertEqual(expected, actual)
155 finally:
156 tree.unlock()
157154
158 def make_outer_tree(self):155 def make_outer_tree(self):
159 outer = self.make_branch_and_tree('outer')156 outer = self.make_branch_and_tree('outer')
160157
=== modified file 'breezy/tests/per_workingtree/test_pull.py'
--- breezy/tests/per_workingtree/test_pull.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/per_workingtree/test_pull.py 2018-03-27 00:52:31 +0000
@@ -90,7 +90,7 @@
90 ('add', ('file', 'file-id', 'file', 'trunk content\n')),],90 ('add', ('file', 'file-id', 'file', 'trunk content\n')),],
91 revision_id='2')91 revision_id='2')
92 builder.build_snapshot(['2'], [92 builder.build_snapshot(['2'], [
93 ('unversion', 'dir-id'),],93 ('unversion', 'dir'),],
94 revision_id='3')94 revision_id='3')
95 builder.finish_series()95 builder.finish_series()
96 return builder.get_branch()96 return builder.get_branch()
9797
=== modified file 'breezy/tests/per_workingtree/test_workingtree.py'
--- breezy/tests/per_workingtree/test_workingtree.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/per_workingtree/test_workingtree.py 2018-03-27 00:52:31 +0000
@@ -1109,18 +1109,18 @@
1109 # mainline1109 # mainline
1110 revids['1'] = builder.build_snapshot(1110 revids['1'] = builder.build_snapshot(
1111 None,1111 None,
1112 [('add', ('', 'root-id', 'directory', '')),1112 [('add', ('', None, 'directory', '')),
1113 ('add', ('file1', 'file1-id', 'file', 'file1 content\n'))])1113 ('add', ('file1', None, 'file', 'file1 content\n'))])
1114 # branch1114 # branch
1115 revids['2'] = builder.build_snapshot([revids['1']], [])1115 revids['2'] = builder.build_snapshot([revids['1']], [])
1116 revids['4'] = builder.build_snapshot(1116 revids['4'] = builder.build_snapshot(
1117 [revids['1']],1117 [revids['1']],
1118 [('add', ('file4', 'file4-id', 'file', 'file4 content\n'))])1118 [('add', ('file4', None, 'file', 'file4 content\n'))])
1119 # master1119 # master
1120 revids['3'] = builder.build_snapshot([revids['1']], [])1120 revids['3'] = builder.build_snapshot([revids['1']], [])
1121 revids['5'] = builder.build_snapshot(1121 revids['5'] = builder.build_snapshot(
1122 [revids['3']],1122 [revids['3']],
1123 [('add', ('file5', 'file5-id', 'file', 'file5 content\n'))])1123 [('add', ('file5', None, 'file', 'file5 content\n'))])
1124 builder.finish_series()1124 builder.finish_series()
1125 return (builder, builder._branch.last_revision(), revids)1125 return (builder, builder._branch.last_revision(), revids)
11261126
11271127
=== modified file 'breezy/tests/test_annotate.py'
--- breezy/tests/test_annotate.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/test_annotate.py 2018-03-27 00:52:31 +0000
@@ -185,15 +185,15 @@
185 ], timestamp=1166046000.00, timezone=0, committer="joe@foo.com",185 ], timestamp=1166046000.00, timezone=0, committer="joe@foo.com",
186 revision_id='rev-1')186 revision_id='rev-1')
187 builder.build_snapshot(['rev-1'], [187 builder.build_snapshot(['rev-1'], [
188 ('modify', ('a-id', 'first\nsecond\n')),188 ('modify', ('a', 'first\nsecond\n')),
189 ], timestamp=1166046001.00, timezone=0, committer="joe@foo.com",189 ], timestamp=1166046001.00, timezone=0, committer="joe@foo.com",
190 revision_id='rev-2')190 revision_id='rev-2')
191 builder.build_snapshot(['rev-1'], [191 builder.build_snapshot(['rev-1'], [
192 ('modify', ('a-id', 'first\nthird\n')),192 ('modify', ('a', 'first\nthird\n')),
193 ], timestamp=1166046002.00, timezone=0, committer="barry@foo.com",193 ], timestamp=1166046002.00, timezone=0, committer="barry@foo.com",
194 revision_id='rev-1_1_1')194 revision_id='rev-1_1_1')
195 builder.build_snapshot(['rev-2', 'rev-1_1_1'], [195 builder.build_snapshot(['rev-2', 'rev-1_1_1'], [
196 ('modify', ('a-id', 'first\nsecond\nthird\n')),196 ('modify', ('a', 'first\nsecond\nthird\n')),
197 ], timestamp=1166046003.00, timezone=0, committer="sal@foo.com",197 ], timestamp=1166046003.00, timezone=0, committer="sal@foo.com",
198 revision_id='rev-3')198 revision_id='rev-3')
199 return builder199 return builder
@@ -225,22 +225,22 @@
225 builder.build_snapshot(['rev-1_1_1'], [], revision_id='rev-1_1_2')225 builder.build_snapshot(['rev-1_1_1'], [], revision_id='rev-1_1_2')
226 builder.build_snapshot(['rev-3', 'rev-1_1_2'], [], revision_id='rev-4')226 builder.build_snapshot(['rev-3', 'rev-1_1_2'], [], revision_id='rev-4')
227 builder.build_snapshot(['rev-1_1_1'], [227 builder.build_snapshot(['rev-1_1_1'], [
228 ('modify', ('a-id', 'first\nthird\nfourth\n')),228 ('modify', ('a', 'first\nthird\nfourth\n')),
229 ], timestamp=1166046003.00, timezone=0, committer="jerry@foo.com",229 ], timestamp=1166046003.00, timezone=0, committer="jerry@foo.com",
230 revision_id='rev-1_2_1')230 revision_id='rev-1_2_1')
231 builder.build_snapshot(['rev-1_2_1'], [],231 builder.build_snapshot(['rev-1_2_1'], [],
232 timestamp=1166046004.00, timezone=0, committer="jerry@foo.com",232 timestamp=1166046004.00, timezone=0, committer="jerry@foo.com",
233 revision_id='rev-1_2_2')233 revision_id='rev-1_2_2')
234 builder.build_snapshot(['rev-4', 'rev-1_2_2'], [234 builder.build_snapshot(['rev-4', 'rev-1_2_2'], [
235 ('modify', ('a-id', 'first\nsecond\nthird\nfourth\n')),235 ('modify', ('a', 'first\nsecond\nthird\nfourth\n')),
236 ], timestamp=1166046004.00, timezone=0, committer="jerry@foo.com",236 ], timestamp=1166046004.00, timezone=0, committer="jerry@foo.com",
237 revision_id='rev-5')237 revision_id='rev-5')
238 builder.build_snapshot(['rev-1_2_1'], [238 builder.build_snapshot(['rev-1_2_1'], [
239 ('modify', ('a-id', 'first\nthird\nfourth\nfifth\nsixth\n')),239 ('modify', ('a', 'first\nthird\nfourth\nfifth\nsixth\n')),
240 ], timestamp=1166046005.00, timezone=0, committer="george@foo.com",240 ], timestamp=1166046005.00, timezone=0, committer="george@foo.com",
241 revision_id='rev-1_3_1')241 revision_id='rev-1_3_1')
242 builder.build_snapshot(['rev-5', 'rev-1_3_1'], [242 builder.build_snapshot(['rev-5', 'rev-1_3_1'], [
243 ('modify', ('a-id',243 ('modify', ('a',
244 'first\nsecond\nthird\nfourth\nfifth\nsixth\n')),244 'first\nsecond\nthird\nfourth\nfifth\nsixth\n')),
245 ], revision_id='rev-6')245 ], revision_id='rev-6')
246 return builder246 return builder
@@ -260,19 +260,19 @@
260 ('add', ('file', 'file-id', 'file', base_text)),260 ('add', ('file', 'file-id', 'file', base_text)),
261 ], revision_id='rev-base')261 ], revision_id='rev-base')
262 builder.build_snapshot(['rev-base'], [262 builder.build_snapshot(['rev-base'], [
263 ('modify', ('file-id', a_text))],263 ('modify', ('file', a_text))],
264 revision_id='rev-A')264 revision_id='rev-A')
265 builder.build_snapshot(['rev-base'], [265 builder.build_snapshot(['rev-base'], [
266 ('modify', ('file-id', b_text))],266 ('modify', ('file', b_text))],
267 revision_id='rev-B')267 revision_id='rev-B')
268 builder.build_snapshot(['rev-A'], [268 builder.build_snapshot(['rev-A'], [
269 ('modify', ('file-id', c_text))],269 ('modify', ('file', c_text))],
270 revision_id='rev-C')270 revision_id='rev-C')
271 builder.build_snapshot(['rev-B', 'rev-A'], [271 builder.build_snapshot(['rev-B', 'rev-A'], [
272 ('modify', ('file-id', d_text))],272 ('modify', ('file', d_text))],
273 revision_id='rev-D')273 revision_id='rev-D')
274 builder.build_snapshot(['rev-C', 'rev-D'], [274 builder.build_snapshot(['rev-C', 'rev-D'], [
275 ('modify', ('file-id', e_text))],275 ('modify', ('file', e_text))],
276 revision_id='rev-E')276 revision_id='rev-E')
277 return builder277 return builder
278278
279279
=== modified file 'breezy/tests/test_branchbuilder.py'
--- breezy/tests/test_branchbuilder.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/test_branchbuilder.py 2018-03-27 00:52:31 +0000
@@ -200,7 +200,7 @@
200 def test_modify_file(self):200 def test_modify_file(self):
201 builder = self.build_a_rev()201 builder = self.build_a_rev()
202 rev_id2 = builder.build_snapshot(None,202 rev_id2 = builder.build_snapshot(None,
203 [('modify', ('a-id', 'new\ncontent\n'))],203 [('modify', ('a', 'new\ncontent\n'))],
204 revision_id='B-id')204 revision_id='B-id')
205 self.assertEqual('B-id', rev_id2)205 self.assertEqual('B-id', rev_id2)
206 branch = builder.get_branch()206 branch = builder.get_branch()
@@ -213,7 +213,7 @@
213 def test_delete_file(self):213 def test_delete_file(self):
214 builder = self.build_a_rev()214 builder = self.build_a_rev()
215 rev_id2 = builder.build_snapshot(None,215 rev_id2 = builder.build_snapshot(None,
216 [('unversion', 'a-id')], revision_id='B-id')216 [('unversion', 'a')], revision_id='B-id')
217 self.assertEqual('B-id', rev_id2)217 self.assertEqual('B-id', rev_id2)
218 branch = builder.get_branch()218 branch = builder.get_branch()
219 rev_tree = branch.repository.revision_tree(rev_id2)219 rev_tree = branch.repository.revision_tree(rev_id2)
@@ -238,7 +238,7 @@
238 (u'b/d/e', 'e-id', 'file')], rev_tree)238 (u'b/d/e', 'e-id', 'file')], rev_tree)
239 # Removing a directory removes all child dirs239 # Removing a directory removes all child dirs
240 builder.build_snapshot(240 builder.build_snapshot(
241 None, [('unversion', 'b-id')],241 None, [('unversion', 'b')],
242 revision_id='C-id')242 revision_id='C-id')
243 rev_tree = builder.get_branch().repository.revision_tree('C-id')243 rev_tree = builder.get_branch().repository.revision_tree('C-id')
244 self.assertTreeShape([(u'', 'a-root-id', 'directory'),244 self.assertTreeShape([(u'', 'a-root-id', 'directory'),
@@ -278,7 +278,7 @@
278 revision_id='B-id')278 revision_id='B-id')
279 builder.build_snapshot(None,279 builder.build_snapshot(None,
280 [('rename', ('dir/a', 'a')),280 [('rename', ('dir/a', 'a')),
281 ('unversion', 'dir-id')], revision_id='C-id')281 ('unversion', 'dir')], revision_id='C-id')
282 rev_tree = builder.get_branch().repository.revision_tree('C-id')282 rev_tree = builder.get_branch().repository.revision_tree('C-id')
283 self.assertTreeShape([(u'', 'a-root-id', 'directory'),283 self.assertTreeShape([(u'', 'a-root-id', 'directory'),
284 (u'a', 'a-id', 'file')], rev_tree)284 (u'a', 'a-id', 'file')], rev_tree)
@@ -288,7 +288,7 @@
288 builder.start_series()288 builder.start_series()
289 self.addCleanup(builder.finish_series)289 self.addCleanup(builder.finish_series)
290 builder.build_snapshot(['A-id'],290 builder.build_snapshot(['A-id'],
291 [('modify', ('a-id', 'new\ncontent\n'))],291 [('modify', ('a', 'new\ncontent\n'))],
292 revision_id='B-id')292 revision_id='B-id')
293 builder.build_snapshot(['A-id'],293 builder.build_snapshot(['A-id'],
294 [('add', ('c', 'c-id', 'file', 'alt\ncontent\n'))],294 [('add', ('c', 'c-id', 'file', 'alt\ncontent\n'))],
@@ -416,7 +416,7 @@
416 [('add', ('', 'TREE_ROOT', 'directory', ''))],416 [('add', ('', 'TREE_ROOT', 'directory', ''))],
417 revision_id='rev-1')417 revision_id='rev-1')
418 builder.build_snapshot(None,418 builder.build_snapshot(None,
419 [('unversion', 'TREE_ROOT'),419 [('unversion', ''),
420 ('add', ('', 'my-root', 'directory', ''))],420 ('add', ('', 'my-root', 'directory', ''))],
421 revision_id='rev-2')421 revision_id='rev-2')
422 builder.finish_series()422 builder.finish_series()
@@ -446,7 +446,7 @@
446 ('add', (u'a', 'a-id', 'file', 'content\n'))],446 ('add', (u'a', 'a-id', 'file', 'content\n'))],
447 revision_id='A-id')447 revision_id='A-id')
448 builder.build_snapshot(None,448 builder.build_snapshot(None,
449 [('unversion', 'a-id'),449 [('unversion', 'a'),
450 ('flush', None),450 ('flush', None),
451 ('add', (u'a', 'a-id', 'directory', None))],451 ('add', (u'a', 'a-id', 'directory', None))],
452 revision_id='B-id')452 revision_id='B-id')
@@ -467,7 +467,7 @@
467 ('add', (u'dir', 'dir-id', 'directory', None))],467 ('add', (u'dir', 'dir-id', 'directory', None))],
468 revision_id='A-id')468 revision_id='A-id')
469 builder.build_snapshot(None,469 builder.build_snapshot(None,
470 [('unversion', 'orig-root'), # implicitly unversions all children470 [('unversion', ''), # implicitly unversions all children
471 ('flush', None),471 ('flush', None),
472 ('add', (u'', 'dir-id', 'directory', None))],472 ('add', (u'', 'dir-id', 'directory', None))],
473 revision_id='B-id')473 revision_id='B-id')
474474
=== modified file 'breezy/tests/test_bundle.py'
--- breezy/tests/test_bundle.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/test_bundle.py 2018-03-27 00:52:31 +0000
@@ -1517,7 +1517,7 @@
1517 ('add', ('file', 'file-id', 'file', 'original content\n')),1517 ('add', ('file', 'file-id', 'file', 'original content\n')),
1518 ], revision_id='a@cset-0-1')1518 ], revision_id='a@cset-0-1')
1519 builder.build_snapshot(['a@cset-0-1'], [1519 builder.build_snapshot(['a@cset-0-1'], [
1520 ('modify', ('file-id', 'new-content\n')),1520 ('modify', ('file', 'new-content\n')),
1521 ], revision_id='a@cset-0-2a')1521 ], revision_id='a@cset-0-2a')
1522 builder.build_snapshot(['a@cset-0-1'], [1522 builder.build_snapshot(['a@cset-0-1'], [
1523 ('add', ('other-file', 'file2-id', 'file', 'file2-content\n')),1523 ('add', ('other-file', 'file2-id', 'file', 'file2-content\n')),
15241524
=== modified file 'breezy/tests/test_conflicts.py'
--- breezy/tests/test_conflicts.py 2018-02-18 15:21:06 +0000
+++ breezy/tests/test_conflicts.py 2018-03-27 00:52:31 +0000
@@ -385,10 +385,10 @@
385 (dict(_base_actions='create_file_in_dir',385 (dict(_base_actions='create_file_in_dir',
386 _path='dir/file', _file_id='file-id'),386 _path='dir/file', _file_id='file-id'),
387 ('filed_modified_A_in_dir',387 ('filed_modified_A_in_dir',
388 dict(actions='modify_file_A',388 dict(actions='modify_file_A_in_dir',
389 check='file_in_dir_has_content_A')),389 check='file_in_dir_has_content_A')),
390 ('file_modified_B',390 ('file_modified_B',
391 dict(actions='modify_file_B',391 dict(actions='modify_file_B_in_dir',
392 check='file_in_dir_has_content_B')),),392 check='file_in_dir_has_content_B')),),
393 ])393 ])
394394
@@ -396,10 +396,16 @@
396 return [('add', (path, 'file-id', 'file', 'trunk content\n'))]396 return [('add', (path, 'file-id', 'file', 'trunk content\n'))]
397397
398 def do_modify_file_A(self):398 def do_modify_file_A(self):
399 return [('modify', ('file-id', 'trunk content\nfeature A\n'))]399 return [('modify', ('file', 'trunk content\nfeature A\n'))]
400400
401 def do_modify_file_B(self):401 def do_modify_file_B(self):
402 return [('modify', ('file-id', 'trunk content\nfeature B\n'))]402 return [('modify', ('file', 'trunk content\nfeature B\n'))]
403
404 def do_modify_file_A_in_dir(self):
405 return [('modify', ('dir/file', 'trunk content\nfeature A\n'))]
406
407 def do_modify_file_B_in_dir(self):
408 return [('modify', ('dir/file', 'trunk content\nfeature B\n'))]
403409
404 def check_file_has_content_A(self, path='file'):410 def check_file_has_content_A(self, path='file'):
405 self.assertFileEqual('trunk content\nfeature A\n',411 self.assertFileEqual('trunk content\nfeature A\n',
@@ -461,7 +467,7 @@
461 dict(actions='modify_file_in_dir',467 dict(actions='modify_file_in_dir',
462 check='file_in_dir_has_more_content')),468 check='file_in_dir_has_more_content')),
463 ('file_deleted_in_dir',469 ('file_deleted_in_dir',
464 dict(actions='delete_file',470 dict(actions='delete_file_in_dir',
465 check='file_in_dir_doesnt_exist')),),471 check='file_in_dir_doesnt_exist')),),
466 ])472 ])
467473
@@ -469,10 +475,10 @@
469 return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]475 return [('add', ('file', 'file-id', 'file', 'trunk content\n'))]
470476
471 def do_modify_file(self):477 def do_modify_file(self):
472 return [('modify', ('file-id', 'trunk content\nmore content\n'))]478 return [('modify', ('file', 'trunk content\nmore content\n'))]
473479
474 def do_modify_and_rename_file(self):480 def do_modify_and_rename_file(self):
475 return [('modify', ('file-id', 'trunk content\nmore content\n')),481 return [('modify', ('new-file', 'trunk content\nmore content\n')),
476 ('rename', ('file', 'new-file'))]482 ('rename', ('file', 'new-file'))]
477483
478 def check_file_has_more_content(self):484 def check_file_has_more_content(self):
@@ -482,7 +488,10 @@
482 self.assertFileEqual('trunk content\nmore content\n', 'branch/new-file')488 self.assertFileEqual('trunk content\nmore content\n', 'branch/new-file')
483489
484 def do_delete_file(self):490 def do_delete_file(self):
485 return [('unversion', 'file-id')]491 return [('unversion', 'file')]
492
493 def do_delete_file_in_dir(self):
494 return [('unversion', 'dir/file')]
486495
487 def check_file_doesnt_exist(self):496 def check_file_doesnt_exist(self):
488 self.assertPathDoesNotExist('branch/file')497 self.assertPathDoesNotExist('branch/file')
@@ -492,7 +501,7 @@
492 ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]501 ('add', ('dir/file', 'file-id', 'file', 'trunk content\n'))]
493502
494 def do_modify_file_in_dir(self):503 def do_modify_file_in_dir(self):
495 return [('modify', ('file-id', 'trunk content\nmore content\n'))]504 return [('modify', ('dir/file', 'trunk content\nmore content\n'))]
496505
497 def check_file_in_dir_has_more_content(self):506 def check_file_in_dir_has_more_content(self):
498 self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file')507 self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file')
@@ -537,7 +546,7 @@
537 dict(actions='rename_file_in_dir', check='file_in_dir_renamed',546 dict(actions='rename_file_in_dir', check='file_in_dir_renamed',
538 path='dir/new-file', file_id='file-id')),547 path='dir/new-file', file_id='file-id')),
539 ('file_deleted',548 ('file_deleted',
540 dict(actions='delete_file', check='file_in_dir_doesnt_exist',549 dict(actions='delete_file_in_dir', check='file_in_dir_doesnt_exist',
541 # PathConflicts deletion handling requires a special550 # PathConflicts deletion handling requires a special
542 # hard-coded value551 # hard-coded value
543 path='<deleted>', file_id='file-id')),),552 path='<deleted>', file_id='file-id')),),
@@ -604,13 +613,16 @@
604 self.assertPathExists('branch/new-dir2')613 self.assertPathExists('branch/new-dir2')
605614
606 def do_delete_file(self):615 def do_delete_file(self):
607 return [('unversion', 'file-id')]616 return [('unversion', 'file')]
617
618 def do_delete_file_in_dir(self):
619 return [('unversion', 'dir/file')]
608620
609 def check_file_doesnt_exist(self):621 def check_file_doesnt_exist(self):
610 self.assertPathDoesNotExist('branch/file')622 self.assertPathDoesNotExist('branch/file')
611623
612 def do_delete_dir(self):624 def do_delete_dir(self):
613 return [('unversion', 'dir-id')]625 return [('unversion', 'dir')]
614626
615 def check_dir_doesnt_exist(self):627 def check_dir_doesnt_exist(self):
616 self.assertPathDoesNotExist('branch/dir')628 self.assertPathDoesNotExist('branch/dir')
@@ -703,11 +715,11 @@
703 self.assertFileEqual('file b content\n', 'branch/file')715 self.assertFileEqual('file b content\n', 'branch/file')
704716
705 def do_replace_file_a_by_b(self):717 def do_replace_file_a_by_b(self):
706 return [('unversion', 'file-a-id'),718 return [('unversion', 'file'),
707 ('add', ('file', 'file-b-id', 'file', 'file b content\n'))]719 ('add', ('file', 'file-b-id', 'file', 'file b content\n'))]
708720
709 def do_modify_file_a(self):721 def do_modify_file_a(self):
710 return [('modify', ('file-a-id', 'new content\n'))]722 return [('modify', ('file', 'new content\n'))]
711723
712 def check_file_new_content(self):724 def check_file_new_content(self):
713 self.assertFileEqual('new content\n', 'branch/file')725 self.assertFileEqual('new content\n', 'branch/file')
714726
=== modified file 'breezy/tests/test_knit.py'
--- breezy/tests/test_knit.py 2017-11-16 00:39:04 +0000
+++ breezy/tests/test_knit.py 2018-03-27 00:52:31 +0000
@@ -387,10 +387,10 @@
387 ('add', ('file', 'file-id', 'file', 'content\nrev 1\n')),387 ('add', ('file', 'file-id', 'file', 'content\nrev 1\n')),
388 ], revision_id='rev-1')388 ], revision_id='rev-1')
389 builder.build_snapshot(['rev-1'], [389 builder.build_snapshot(['rev-1'], [
390 ('modify', ('file-id', 'content\nrev 2\n')),390 ('modify', ('file', 'content\nrev 2\n')),
391 ], revision_id='rev-2')391 ], revision_id='rev-2')
392 builder.build_snapshot(['rev-2'], [392 builder.build_snapshot(['rev-2'], [
393 ('modify', ('file-id', 'content\nrev 3\n')),393 ('modify', ('file', 'content\nrev 3\n')),
394 ], revision_id='rev-3')394 ], revision_id='rev-3')
395 self.addCleanup(builder.finish_series)395 self.addCleanup(builder.finish_series)
396 b = builder.get_branch()396 b = builder.get_branch()
@@ -420,10 +420,10 @@
420 ('add', ('file', 'file-id', 'file', 'content\nrev 1\n')),420 ('add', ('file', 'file-id', 'file', 'content\nrev 1\n')),
421 ], revision_id='rev-1')421 ], revision_id='rev-1')
422 builder.build_snapshot(['rev-1'], [422 builder.build_snapshot(['rev-1'], [
423 ('modify', ('file-id', 'content\nrev 2\n')),423 ('modify', ('file', 'content\nrev 2\n')),
424 ], revision_id='rev-2')424 ], revision_id='rev-2')
425 builder.build_snapshot(['rev-2'], [425 builder.build_snapshot(['rev-2'], [
426 ('modify', ('file-id', 'content\nrev 3\n')),426 ('modify', ('file', 'content\nrev 3\n')),
427 ], revision_id='rev-3')427 ], revision_id='rev-3')
428 builder.finish_series()428 builder.finish_series()
429 b = builder.get_branch()429 b = builder.get_branch()
430430
=== modified file 'breezy/tests/test_merge.py'
--- breezy/tests/test_merge.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/test_merge.py 2018-03-27 00:52:31 +0000
@@ -1409,16 +1409,16 @@
1409 ('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))],1409 ('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))],
1410 revision_id='A-id')1410 revision_id='A-id')
1411 builder.build_snapshot(['A-id'],1411 builder.build_snapshot(['A-id'],
1412 [('modify', ('a-id', 'a\nb\nC\nc\n'))],1412 [('modify', ('a', 'a\nb\nC\nc\n'))],
1413 revision_id='C-id')1413 revision_id='C-id')
1414 builder.build_snapshot(['A-id'],1414 builder.build_snapshot(['A-id'],
1415 [('modify', ('a-id', 'a\nB\nb\nc\n'))],1415 [('modify', ('a', 'a\nB\nb\nc\n'))],
1416 revision_id='B-id')1416 revision_id='B-id')
1417 builder.build_snapshot(['C-id', 'B-id'],1417 builder.build_snapshot(['C-id', 'B-id'],
1418 [('modify', ('a-id', 'a\nB\nb\nC\nc\nE\n'))],1418 [('modify', ('a', 'a\nB\nb\nC\nc\nE\n'))],
1419 revision_id='E-id')1419 revision_id='E-id')
1420 builder.build_snapshot(['B-id', 'C-id'],1420 builder.build_snapshot(['B-id', 'C-id'],
1421 [('modify', ('a-id', 'a\nB\nb\nC\nc\n'))],1421 [('modify', ('a', 'a\nB\nb\nC\nc\n'))],
1422 revision_id='D-id', )1422 revision_id='D-id', )
1423 merge_obj = self.make_merge_obj(builder, 'E-id')1423 merge_obj = self.make_merge_obj(builder, 'E-id')
14241424
@@ -1466,7 +1466,7 @@
1466 [('add', (u'foo', 'foo-id', 'file', 'a\nb\nc\n'))],1466 [('add', (u'foo', 'foo-id', 'file', 'a\nb\nc\n'))],
1467 revision_id='E-id')1467 revision_id='E-id')
1468 builder.build_snapshot(['E-id', 'D-id'],1468 builder.build_snapshot(['E-id', 'D-id'],
1469 [('modify', (u'bar-id', 'd\ne\nf\nG\n'))],1469 [('modify', (u'bar', 'd\ne\nf\nG\n'))],
1470 revision_id='G-id')1470 revision_id='G-id')
1471 builder.build_snapshot(['D-id', 'E-id'], [], revision_id='F-id')1471 builder.build_snapshot(['D-id', 'E-id'], [], revision_id='F-id')
1472 merge_obj = self.make_merge_obj(builder, 'G-id')1472 merge_obj = self.make_merge_obj(builder, 'G-id')
@@ -1490,16 +1490,16 @@
1490 ('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))],1490 ('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))],
1491 revision_id='A-id')1491 revision_id='A-id')
1492 builder.build_snapshot(['A-id'],1492 builder.build_snapshot(['A-id'],
1493 [('modify', ('a-id', 'a\nB\nb\nc\n'))],1493 [('modify', ('a', 'a\nB\nb\nc\n'))],
1494 revision_id='B-id')1494 revision_id='B-id')
1495 builder.build_snapshot(['A-id'],1495 builder.build_snapshot(['A-id'],
1496 [('modify', ('a-id', 'a\nb\nC\nc\n'))],1496 [('modify', ('a', 'a\nb\nC\nc\n'))],
1497 revision_id='C-id')1497 revision_id='C-id')
1498 builder.build_snapshot(['C-id', 'B-id'],1498 builder.build_snapshot(['C-id', 'B-id'],
1499 [('modify', ('a-id', 'a\nB\nb\nC\nc\nE\n'))],1499 [('modify', ('a', 'a\nB\nb\nC\nc\nE\n'))],
1500 revision_id='E-id')1500 revision_id='E-id')
1501 builder.build_snapshot(['B-id', 'C-id'],1501 builder.build_snapshot(['B-id', 'C-id'],
1502 [('unversion', 'a-id')],1502 [('unversion', 'a')],
1503 revision_id='D-id')1503 revision_id='D-id')
1504 merge_obj = self.make_merge_obj(builder, 'E-id')1504 merge_obj = self.make_merge_obj(builder, 'E-id')
15051505
@@ -1554,7 +1554,7 @@
1554 builder.build_snapshot(['A-id'], [], revision_id='C-id')1554 builder.build_snapshot(['A-id'], [], revision_id='C-id')
1555 builder.build_snapshot(1555 builder.build_snapshot(
1556 ['C-id', 'B-id'],1556 ['C-id', 'B-id'],
1557 [('unversion', 'a-id')], revision_id='E-id')1557 [('unversion', 'a')], revision_id='E-id')
1558 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')1558 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
1559 merge_obj = self.make_merge_obj(builder, 'E-id')1559 merge_obj = self.make_merge_obj(builder, 'E-id')
15601560
@@ -1586,7 +1586,7 @@
1586 revision_id='A-id')1586 revision_id='A-id')
1587 builder.build_snapshot(['A-id'], [], revision_id='B-id')1587 builder.build_snapshot(['A-id'], [], revision_id='B-id')
1588 builder.build_snapshot(['A-id'],1588 builder.build_snapshot(['A-id'],
1589 [('unversion', 'foo-id')], revision_id='C-id')1589 [('unversion', 'foo')], revision_id='C-id')
1590 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')1590 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')
1591 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')1591 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
1592 merge_obj = self.make_merge_obj(builder, 'E-id')1592 merge_obj = self.make_merge_obj(builder, 'E-id')
@@ -1615,10 +1615,10 @@
1615 ('add', (u'foo', 'foo-id', 'file', 'content\n'))],1615 ('add', (u'foo', 'foo-id', 'file', 'content\n'))],
1616 revision_id='A-id')1616 revision_id='A-id')
1617 builder.build_snapshot(['A-id'], [1617 builder.build_snapshot(['A-id'], [
1618 ('modify', ('foo-id', 'new-content\n'))],1618 ('modify', ('foo', 'new-content\n'))],
1619 revision_id='B-id')1619 revision_id='B-id')
1620 builder.build_snapshot(['A-id'],1620 builder.build_snapshot(['A-id'],
1621 [('unversion', 'foo-id')],1621 [('unversion', 'foo')],
1622 revision_id='C-id')1622 revision_id='C-id')
1623 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')1623 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')
1624 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')1624 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
@@ -1658,7 +1658,7 @@
1658 [('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))],1658 [('add', (u'a', 'a-id', 'file', 'a\nb\nc\n'))],
1659 revision_id='C-id')1659 revision_id='C-id')
1660 builder.build_snapshot(['C-id', 'B-id'],1660 builder.build_snapshot(['C-id', 'B-id'],
1661 [('unversion', 'a-id')],1661 [('unversion', 'a')],
1662 revision_id='E-id')1662 revision_id='E-id')
1663 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')1663 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
1664 merge_obj = self.make_merge_obj(builder, 'E-id')1664 merge_obj = self.make_merge_obj(builder, 'E-id')
@@ -1709,15 +1709,15 @@
1709 revision_id='A-id')1709 revision_id='A-id')
1710 builder.build_snapshot(['A-id'], [], revision_id='C-id')1710 builder.build_snapshot(['A-id'], [], revision_id='C-id')
1711 builder.build_snapshot(['A-id'],1711 builder.build_snapshot(['A-id'],
1712 [('modify', ('foo-id', 'B content\n'))],1712 [('modify', ('foo', 'B content\n'))],
1713 revision_id='B-id')1713 revision_id='B-id')
1714 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')1714 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
1715 builder.build_snapshot(['C-id', 'B-id'],1715 builder.build_snapshot(['C-id', 'B-id'],
1716 [('modify', ('foo-id', 'E content\n'))],1716 [('modify', ('foo', 'E content\n'))],
1717 revision_id='E-id')1717 revision_id='E-id')
1718 builder.build_snapshot(['E-id', 'D-id'], [], revision_id='G-id')1718 builder.build_snapshot(['E-id', 'D-id'], [], revision_id='G-id')
1719 builder.build_snapshot(['D-id', 'E-id'],1719 builder.build_snapshot(['D-id', 'E-id'],
1720 [('modify', ('foo-id', 'F content\n'))],1720 [('modify', ('foo', 'F content\n'))],
1721 revision_id='F-id')1721 revision_id='F-id')
1722 merge_obj = self.make_merge_obj(builder, 'G-id')1722 merge_obj = self.make_merge_obj(builder, 'G-id')
17231723
@@ -1833,10 +1833,10 @@
1833 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],1833 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],
1834 revision_id='A-id')1834 revision_id='A-id')
1835 builder.build_snapshot(['A-id'],1835 builder.build_snapshot(['A-id'],
1836 [('modify', ('foo-id', 'B content\n'))],1836 [('modify', ('foo', 'B content\n'))],
1837 revision_id='B-id')1837 revision_id='B-id')
1838 builder.build_snapshot(['A-id'],1838 builder.build_snapshot(['A-id'],
1839 [('modify', ('foo-id', 'C content\n'))],1839 [('modify', ('foo', 'C content\n'))],
1840 revision_id='C-id')1840 revision_id='C-id')
1841 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')1841 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')
1842 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')1842 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
@@ -1868,15 +1868,15 @@
1868 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],1868 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],
1869 revision_id='A-id')1869 revision_id='A-id')
1870 builder.build_snapshot(['A-id'],1870 builder.build_snapshot(['A-id'],
1871 [('modify', ('foo-id', 'B content\n'))],1871 [('modify', ('foo', 'B content\n'))],
1872 revision_id='B-id')1872 revision_id='B-id')
1873 builder.build_snapshot(['A-id'],1873 builder.build_snapshot(['A-id'],
1874 [('modify', ('foo-id', 'C content\n'))],1874 [('modify', ('foo', 'C content\n'))],
1875 revision_id='C-id', )1875 revision_id='C-id', )
1876 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')1876 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')
1877 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')1877 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
1878 builder.build_snapshot(['D-id'],1878 builder.build_snapshot(['D-id'],
1879 [('modify', ('foo-id', 'F content\n'))],1879 [('modify', ('foo', 'F content\n'))],
1880 revision_id='F-id')1880 revision_id='F-id')
1881 merge_obj = self.make_merge_obj(builder, 'E-id')1881 merge_obj = self.make_merge_obj(builder, 'E-id')
18821882
@@ -1909,17 +1909,17 @@
1909 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],1909 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],
1910 revision_id='A-id')1910 revision_id='A-id')
1911 builder.build_snapshot(['A-id'],1911 builder.build_snapshot(['A-id'],
1912 [('modify', ('foo-id', 'B content\n'))],1912 [('modify', ('foo', 'B content\n'))],
1913 revision_id='B-id')1913 revision_id='B-id')
1914 builder.build_snapshot(['A-id'],1914 builder.build_snapshot(['A-id'],
1915 [('modify', ('foo-id', 'C content\n'))],1915 [('modify', ('foo', 'C content\n'))],
1916 revision_id='C-id')1916 revision_id='C-id')
1917 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')1917 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')
1918 builder.build_snapshot(['B-id', 'C-id'],1918 builder.build_snapshot(['B-id', 'C-id'],
1919 [('modify', ('foo-id', 'C content\n'))],1919 [('modify', ('foo', 'C content\n'))],
1920 revision_id='D-id') # Same as E1920 revision_id='D-id') # Same as E
1921 builder.build_snapshot(['D-id'],1921 builder.build_snapshot(['D-id'],
1922 [('modify', ('foo-id', 'F content\n'))],1922 [('modify', ('foo', 'F content\n'))],
1923 revision_id='F-id')1923 revision_id='F-id')
1924 merge_obj = self.make_merge_obj(builder, 'E-id')1924 merge_obj = self.make_merge_obj(builder, 'E-id')
19251925
@@ -1961,7 +1961,7 @@
1961 builder.build_snapshot(['A-id'], [], revision_id='B-id')1961 builder.build_snapshot(['A-id'], [], revision_id='B-id')
1962 builder.build_snapshot(['A-id'], [], revision_id='C-id')1962 builder.build_snapshot(['A-id'], [], revision_id='C-id')
1963 builder.build_snapshot(['C-id', 'B-id'],1963 builder.build_snapshot(['C-id', 'B-id'],
1964 [('unversion', 'a-id'),1964 [('unversion', 'a'),
1965 ('flush', None),1965 ('flush', None),
1966 ('add', (u'a', 'a-id', 'directory', None))],1966 ('add', (u'a', 'a-id', 'directory', None))],
1967 revision_id='E-id')1967 revision_id='E-id')
@@ -1988,7 +1988,7 @@
1988 builder.build_snapshot(['A-id'], [], revision_id='C-id')1988 builder.build_snapshot(['A-id'], [], revision_id='C-id')
1989 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')1989 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')
1990 builder.build_snapshot(['B-id', 'C-id'],1990 builder.build_snapshot(['B-id', 'C-id'],
1991 [('unversion', 'a-id'),1991 [('unversion', 'a'),
1992 ('flush', None),1992 ('flush', None),
1993 ('add', (u'a', 'a-id', 'directory', None))],1993 ('add', (u'a', 'a-id', 'directory', None))],
1994 revision_id='D-id')1994 revision_id='D-id')
@@ -2008,8 +2008,8 @@
2008 builder.build_snapshot(['A-id'], [], revision_id='B-id')2008 builder.build_snapshot(['A-id'], [], revision_id='B-id')
2009 builder.build_snapshot(['A-id'], [], revision_id='C-id')2009 builder.build_snapshot(['A-id'], [], revision_id='C-id')
2010 builder.build_snapshot(['C-id', 'B-id'],2010 builder.build_snapshot(['C-id', 'B-id'],
2011 [('modify', ('a-id', 'new-content\n')),2011 [('modify', ('a', 'new-content\n')),
2012 ('modify', ('b-id', 'new-content\n'))],2012 ('modify', ('b', 'new-content\n'))],
2013 revision_id='E-id')2013 revision_id='E-id')
2014 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')2014 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
2015 merge_obj = self.make_merge_obj(builder, 'E-id',2015 merge_obj = self.make_merge_obj(builder, 'E-id',
@@ -2034,8 +2034,8 @@
2034 builder.build_snapshot(['A-id'], [], revision_id='B-id')2034 builder.build_snapshot(['A-id'], [], revision_id='B-id')
2035 builder.build_snapshot(['A-id'], [], revision_id='C-id')2035 builder.build_snapshot(['A-id'], [], revision_id='C-id')
2036 builder.build_snapshot(['C-id', 'B-id'],2036 builder.build_snapshot(['C-id', 'B-id'],
2037 [('modify', ('a-id', 'new-content\n')),2037 [('modify', ('a', 'new-content\n')),
2038 ('modify', ('b-id', 'new-content\n'))],2038 ('modify', ('b', 'new-content\n'))],
2039 revision_id='E-id')2039 revision_id='E-id')
2040 builder.build_snapshot(['B-id', 'C-id'],2040 builder.build_snapshot(['B-id', 'C-id'],
2041 [('rename', ('b', 'c'))],2041 [('rename', ('b', 'c'))],
@@ -2066,8 +2066,8 @@
2066 [('rename', ('c', 'b'))],2066 [('rename', ('c', 'b'))],
2067 revision_id='C-id')2067 revision_id='C-id')
2068 builder.build_snapshot(['C-id', 'B-id'],2068 builder.build_snapshot(['C-id', 'B-id'],
2069 [('modify', ('a-id', 'new-content\n')),2069 [('modify', ('a', 'new-content\n')),
2070 ('modify', ('c-id', 'new-content\n'))],2070 ('modify', ('b', 'new-content\n'))],
2071 revision_id='E-id')2071 revision_id='E-id')
2072 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')2072 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
2073 merge_obj = self.make_merge_obj(builder, 'E-id',2073 merge_obj = self.make_merge_obj(builder, 'E-id',
@@ -2093,8 +2093,8 @@
2093 [('rename', ('b', 'c'))], revision_id='B-id')2093 [('rename', ('b', 'c'))], revision_id='B-id')
2094 builder.build_snapshot(['A-id'], [], revision_id='C-id')2094 builder.build_snapshot(['A-id'], [], revision_id='C-id')
2095 builder.build_snapshot(['C-id', 'B-id'],2095 builder.build_snapshot(['C-id', 'B-id'],
2096 [('modify', ('a-id', 'new-content\n')),2096 [('modify', ('a', 'new-content\n')),
2097 ('modify', ('b-id', 'new-content\n'))],2097 ('modify', ('b', 'new-content\n'))],
2098 revision_id='E-id')2098 revision_id='E-id')
2099 builder.build_snapshot(['B-id', 'C-id'],2099 builder.build_snapshot(['B-id', 'C-id'],
2100 [('rename', ('c', 'b'))], revision_id='D-id')2100 [('rename', ('c', 'b'))], revision_id='D-id')
@@ -2120,8 +2120,8 @@
2120 builder.build_snapshot(['A-id'], [], revision_id='B-id')2120 builder.build_snapshot(['A-id'], [], revision_id='B-id')
2121 builder.build_snapshot(['A-id'], [], revision_id='C-id')2121 builder.build_snapshot(['A-id'], [], revision_id='C-id')
2122 builder.build_snapshot(['C-id', 'B-id'],2122 builder.build_snapshot(['C-id', 'B-id'],
2123 [('modify', ('a-id', 'new-content\n')),2123 [('modify', ('a', 'new-content\n')),
2124 ('modify', ('b-id', 'new-content\n'))], revision_id='E-id')2124 ('modify', ('b', 'new-content\n'))], revision_id='E-id')
2125 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')2125 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
2126 merge_obj = self.make_merge_obj(builder, 'E-id',2126 merge_obj = self.make_merge_obj(builder, 'E-id',
2127 interesting_files=['b'])2127 interesting_files=['b'])
@@ -2174,7 +2174,7 @@
2174 builder.build_snapshot(['A-id'], [], revision_id='B-id')2174 builder.build_snapshot(['A-id'], [], revision_id='B-id')
2175 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')2175 builder.build_snapshot(['C-id', 'B-id'], [], revision_id='E-id')
2176 builder.build_snapshot(['B-id', 'C-id'],2176 builder.build_snapshot(['B-id', 'C-id'],
2177 [('modify', ('a-id', 'a\nb\nc\nd\ne\nf\n'))],2177 [('modify', ('a', 'a\nb\nc\nd\ne\nf\n'))],
2178 revision_id='D-id')2178 revision_id='D-id')
2179 wt, conflicts = self.do_merge(builder, 'E-id')2179 wt, conflicts = self.do_merge(builder, 'E-id')
2180 self.assertEqual(0, conflicts)2180 self.assertEqual(0, conflicts)
@@ -2235,7 +2235,7 @@
2235 builder.build_snapshot(['C-id', 'B-id'], # merge the rename2235 builder.build_snapshot(['C-id', 'B-id'], # merge the rename
2236 [('rename', ('foo', 'bar'))], revision_id='E-id')2236 [('rename', ('foo', 'bar'))], revision_id='E-id')
2237 builder.build_snapshot(['E-id'],2237 builder.build_snapshot(['E-id'],
2238 [('unversion', 'foo-id')], revision_id='F-id')2238 [('unversion', 'bar')], revision_id='F-id')
2239 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')2239 builder.build_snapshot(['B-id', 'C-id'], [], revision_id='D-id')
2240 wt, conflicts = self.do_merge(builder, 'F-id')2240 wt, conflicts = self.do_merge(builder, 'F-id')
2241 self.assertEqual(0, conflicts)2241 self.assertEqual(0, conflicts)
@@ -2333,10 +2333,10 @@
2333 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],2333 ('add', (u'foo', 'foo-id', 'file', 'A content\n'))],
2334 revision_id='A-id')2334 revision_id='A-id')
2335 builder.build_snapshot(['A-id'],2335 builder.build_snapshot(['A-id'],
2336 [('modify', ('foo-id', 'B content\n'))],2336 [('modify', ('foo', 'B content\n'))],
2337 revision_id='B-id')2337 revision_id='B-id')
2338 builder.build_snapshot(['A-id'],2338 builder.build_snapshot(['A-id'],
2339 [('modify', ('foo-id', 'C content\n'))],2339 [('modify', ('foo', 'C content\n'))],
2340 revision_id='C-id')2340 revision_id='C-id')
2341 builder.build_snapshot(['C-id', 'B-id'], [],2341 builder.build_snapshot(['C-id', 'B-id'], [],
2342 revision_id='E-id')2342 revision_id='E-id')
@@ -2647,17 +2647,17 @@
2647 builder = self.get_builder()2647 builder = self.get_builder()
2648 builder.build_snapshot(None,2648 builder.build_snapshot(None,
2649 [('add', (u'', b'a-root-id', 'directory', None)),2649 [('add', (u'', b'a-root-id', 'directory', None)),
2650 ('add', (u'foo', b'foo-id', 'file', 'base content\n'))],2650 ('add', (u'foo', b'foo-id', 'file', b'base content\n'))],
2651 revision_id='A-id')2651 revision_id=b'A-id')
2652 builder.build_snapshot([b'A-id'], [], revision_id='C-id')2652 builder.build_snapshot([b'A-id'], [], revision_id=b'C-id')
2653 builder.build_snapshot([b'A-id'],2653 builder.build_snapshot([b'A-id'],
2654 [('modify', (b'foo-id', 'B content\n'))],2654 [('modify', ('foo', b'B content\n'))],
2655 revision_id=b'B-id')2655 revision_id=b'B-id')
2656 builder.build_snapshot([b'C-id', b'B-id'],2656 builder.build_snapshot([b'C-id', b'B-id'],
2657 [('modify', (b'foo-id', 'B content\n'))],2657 [('modify', ('foo', b'B content\n'))],
2658 revision_id=b'E-id') # merge the content2658 revision_id=b'E-id') # merge the content
2659 builder.build_snapshot([b'E-id'],2659 builder.build_snapshot([b'E-id'],
2660 [('modify', (b'foo-id', 'base content\n'))],2660 [('modify', ('foo', b'base content\n'))],
2661 revision_id=b'F-id') # Revert back to BASE2661 revision_id=b'F-id') # Revert back to BASE
2662 builder.build_snapshot([b'B-id', b'C-id'], [], revision_id=b'D-id')2662 builder.build_snapshot([b'B-id', b'C-id'], [], revision_id=b'D-id')
2663 wt, conflicts = self.do_merge(builder, b'F-id')2663 wt, conflicts = self.do_merge(builder, b'F-id')
@@ -2671,22 +2671,22 @@
2671 builder = self.get_builder()2671 builder = self.get_builder()
2672 builder.build_snapshot(None,2672 builder.build_snapshot(None,
2673 [('add', (u'', b'a-root-id', 'directory', None)),2673 [('add', (u'', b'a-root-id', 'directory', None)),
2674 ('add', (u'foo', b'foo-id', 'file', 'base content\n'))],2674 ('add', (u'foo', b'foo-id', 'file', b'base content\n'))],
2675 revision_id=b'A-id')2675 revision_id=b'A-id')
2676 builder.build_snapshot([b'A-id'], [], revision_id=b'C-id')2676 builder.build_snapshot([b'A-id'], [], revision_id=b'C-id')
2677 builder.build_snapshot([b'A-id'],2677 builder.build_snapshot([b'A-id'],
2678 [('modify', (b'foo-id', 'B content\n'))],2678 [('modify', ('foo', b'B content\n'))],
2679 revision_id=b'B-id')2679 revision_id=b'B-id')
2680 builder.build_snapshot([b'C-id', b'B-id'],2680 builder.build_snapshot([b'C-id', b'B-id'],
2681 [('modify', (b'foo-id', 'B content\n'))],2681 [('modify', ('foo', b'B content\n'))],
2682 revision_id=b'E-id') # merge the content2682 revision_id=b'E-id') # merge the content
2683 builder.build_snapshot([b'E-id'],2683 builder.build_snapshot([b'E-id'],
2684 [('modify', (b'foo-id', 'F content\n'))],2684 [('modify', ('foo', b'F content\n'))],
2685 revision_id=b'F-id') # Override B content2685 revision_id=b'F-id') # Override B content
2686 builder.build_snapshot([b'B-id', b'C-id'], [], revision_id=b'D-id')2686 builder.build_snapshot([b'B-id', b'C-id'], [], revision_id=b'D-id')
2687 wt, conflicts = self.do_merge(builder, b'F-id')2687 wt, conflicts = self.do_merge(builder, b'F-id')
2688 self.assertEqual(0, conflicts)2688 self.assertEqual(0, conflicts)
2689 self.assertEqual('F content\n', wt.get_file_text('foo'))2689 self.assertEqual(b'F content\n', wt.get_file_text('foo'))
26902690
2691 def test_all_wt(self):2691 def test_all_wt(self):
2692 """Check behavior if all trees are Working Trees."""2692 """Check behavior if all trees are Working Trees."""
@@ -2705,14 +2705,14 @@
2705 ('add', (u'foo', 'foo-id', 'file', 'base content\n'))],2705 ('add', (u'foo', 'foo-id', 'file', 'base content\n'))],
2706 revision_id='A-id')2706 revision_id='A-id')
2707 builder.build_snapshot(['A-id'],2707 builder.build_snapshot(['A-id'],
2708 [('modify', ('foo-id', 'B content\n'))],2708 [('modify', ('foo', 'B content\n'))],
2709 revision_id='B-id')2709 revision_id='B-id')
2710 builder.build_snapshot(['A-id'],2710 builder.build_snapshot(['A-id'],
2711 [('rename', ('a', 'b'))],2711 [('rename', ('a', 'b'))],
2712 revision_id='C-id')2712 revision_id='C-id')
2713 builder.build_snapshot(['C-id', 'B-id'],2713 builder.build_snapshot(['C-id', 'B-id'],
2714 [('rename', ('b', 'c')),2714 [('rename', ('b', 'c')),
2715 ('modify', ('foo-id', 'E content\n'))],2715 ('modify', ('foo', 'E content\n'))],
2716 revision_id='E-id')2716 revision_id='E-id')
2717 builder.build_snapshot(['B-id', 'C-id'],2717 builder.build_snapshot(['B-id', 'C-id'],
2718 [('rename', ('a', 'b'))], revision_id='D-id') # merged change2718 [('rename', ('a', 'b'))], revision_id='D-id') # merged change
27192719
=== modified file 'breezy/tests/test_merge_core.py'
--- breezy/tests/test_merge_core.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/test_merge_core.py 2018-03-27 00:52:31 +0000
@@ -535,7 +535,7 @@
535 ('add', ('foo', 'foo-id', 'file', 'orig\ncontents\nand D\n'))],535 ('add', ('foo', 'foo-id', 'file', 'orig\ncontents\nand D\n'))],
536 revision_id='D-id')536 revision_id='D-id')
537 builder.build_snapshot(['C-id', 'B-id'], [537 builder.build_snapshot(['C-id', 'B-id'], [
538 ('modify', ('foo-id', 'orig\ncontents\nand E\n'))],538 ('modify', ('foo', 'orig\ncontents\nand E\n'))],
539 revision_id='E-id')539 revision_id='E-id')
540 builder.finish_series()540 builder.finish_series()
541 tree = builder.get_branch().create_checkout('tree', lightweight=True)541 tree = builder.get_branch().create_checkout('tree', lightweight=True)
542542
=== modified file 'breezy/tests/test_repository.py'
--- breezy/tests/test_repository.py 2018-03-25 00:39:16 +0000
+++ breezy/tests/test_repository.py 2018-03-27 00:52:31 +0000
@@ -554,69 +554,69 @@
554 builder.start_series()554 builder.start_series()
555 builder.build_snapshot(None, [555 builder.build_snapshot(None, [
556 ('add', ('', b'root-id', 'directory', '')),556 ('add', ('', b'root-id', 'directory', '')),
557 ('add', ('file', b'file-id', 'file', 'content\n'))],557 ('add', ('file', b'file-id', 'file', b'content\n'))],
558 revision_id=b'1')558 revision_id='1')
559 builder.build_snapshot(['1'], [559 builder.build_snapshot([b'1'], [
560 ('modify', (b'file-id', 'content-2\n'))],560 ('modify', ('file', b'content-2\n'))],
561 revision_id=b'2')561 revision_id=b'2')
562 builder.finish_series()562 builder.finish_series()
563 source = builder.get_branch()563 source = builder.get_branch()
564 target = self.make_repository('target', format='2a')564 target = self.make_repository('target', format='2a')
565 target.fetch(source.repository)565 target.fetch(source.repository)
566 target.lock_read()566 target.lock_read()
567 self.addCleanup(target.unlock)567 self.addCleanup(target.unlock)
568 details = target.texts._index.get_build_details(568 details = target.texts._index.get_build_details(
569 [(b'file-id', '1',), (b'file-id', '2',)])569 [(b'file-id', b'1',), (b'file-id', b'2',)])
570 file_1_details = details[(b'file-id', '1')]570 file_1_details = details[(b'file-id', b'1')]
571 file_2_details = details[(b'file-id', '2')]571 file_2_details = details[(b'file-id', b'2')]
572 # The index, and what to read off disk, should be the same for both572 # The index, and what to read off disk, should be the same for both
573 # versions of the file.573 # versions of the file.
574 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])574 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
575575
576 def test_fetch_combines_groups(self):576 def test_fetch_combines_groups(self):
577 builder = self.make_branch_builder('source', format='2a')577 builder = self.make_branch_builder('source', format='2a')
578 builder.start_series()578 builder.start_series()
579 builder.build_snapshot(None, [579 builder.build_snapshot(None, [
580 ('add', ('', b'root-id', 'directory', '')),580 ('add', ('', b'root-id', 'directory', '')),
581 ('add', ('file', b'file-id', 'file', 'content\n'))],581 ('add', ('file', b'file-id', 'file', 'content\n'))],
582 revision_id=b'1')582 revision_id=b'1')
583 builder.build_snapshot([b'1'], [583 builder.build_snapshot([b'1'], [
584 ('modify', (b'file-id', 'content-2\n'))],584 ('modify', ('file', b'content-2\n'))],
585 revision_id=b'2')585 revision_id=b'2')
586 builder.finish_series()586 builder.finish_series()
587 source = builder.get_branch()587 source = builder.get_branch()
588 target = self.make_repository('target', format='2a')588 target = self.make_repository('target', format='2a')
589 target.fetch(source.repository)589 target.fetch(source.repository)
590 target.lock_read()590 target.lock_read()
591 self.addCleanup(target.unlock)591 self.addCleanup(target.unlock)
592 details = target.texts._index.get_build_details(592 details = target.texts._index.get_build_details(
593 [(b'file-id', '1',), (b'file-id', '2',)])593 [(b'file-id', b'1',), (b'file-id', b'2',)])
594 file_1_details = details[(b'file-id', '1')]594 file_1_details = details[(b'file-id', b'1')]
595 file_2_details = details[(b'file-id', '2')]595 file_2_details = details[(b'file-id', b'2')]
596 # The index, and what to read off disk, should be the same for both596 # The index, and what to read off disk, should be the same for both
597 # versions of the file.597 # versions of the file.
598 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])598 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
599599
600 def test_fetch_combines_groups(self):600 def test_fetch_combines_groups(self):
601 builder = self.make_branch_builder('source', format='2a')601 builder = self.make_branch_builder('source', format='2a')
602 builder.start_series()602 builder.start_series()
603 builder.build_snapshot(None, [603 builder.build_snapshot(None, [
604 ('add', ('', b'root-id', 'directory', '')),604 ('add', ('', b'root-id', 'directory', '')),
605 ('add', ('file', b'file-id', 'file', 'content\n'))],605 ('add', ('file', b'file-id', 'file', 'content\n'))],
606 revision_id=b'1')606 revision_id=b'1')
607 builder.build_snapshot([b'1'], [607 builder.build_snapshot([b'1'], [
608 ('modify', (b'file-id', 'content-2\n'))],608 ('modify', ('file', b'content-2\n'))],
609 revision_id=b'2')609 revision_id=b'2')
610 builder.finish_series()610 builder.finish_series()
611 source = builder.get_branch()611 source = builder.get_branch()
612 target = self.make_repository('target', format='2a')612 target = self.make_repository('target', format='2a')
613 target.fetch(source.repository)613 target.fetch(source.repository)
614 target.lock_read()614 target.lock_read()
615 self.addCleanup(target.unlock)615 self.addCleanup(target.unlock)
616 details = target.texts._index.get_build_details(616 details = target.texts._index.get_build_details(
617 [(b'file-id', '1',), (b'file-id', '2',)])617 [(b'file-id', b'1',), (b'file-id', b'2',)])
618 file_1_details = details[(b'file-id', '1')]618 file_1_details = details[(b'file-id', b'1')]
619 file_2_details = details[(b'file-id', '2')]619 file_2_details = details[(b'file-id', b'2')]
620 # The index, and what to read off disk, should be the same for both620 # The index, and what to read off disk, should be the same for both
621 # versions of the file.621 # versions of the file.
622 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])622 self.assertEqual(file_1_details[0][:3], file_2_details[0][:3])
@@ -705,9 +705,9 @@
705 # Now change a few of them, so we get a few new pages for the second705 # Now change a few of them, so we get a few new pages for the second
706 # revision706 # revision
707 source_builder.build_snapshot([b'rev-1'], [707 source_builder.build_snapshot([b'rev-1'], [
708 ('modify', (b'aa-id', 'new content for aa-id\n')),708 ('modify', ('aa', b'new content for aa-id\n')),
709 ('modify', (b'cc-id', 'new content for cc-id\n')),709 ('modify', ('cc', b'new content for cc-id\n')),
710 ('modify', (b'zz-id', 'new content for zz-id\n')),710 ('modify', ('zz', b'new content for zz-id\n')),
711 ], revision_id=b'rev-2')711 ], revision_id=b'rev-2')
712 source_builder.finish_series()712 source_builder.finish_series()
713 source_branch = source_builder.get_branch()713 source_branch = source_builder.get_branch()
@@ -1477,13 +1477,13 @@
1477 ('add', ('f', 'f-id', 'file', 'content\n'))],1477 ('add', ('f', 'f-id', 'file', 'content\n'))],
1478 revision_id='A')1478 revision_id='A')
1479 builder.build_snapshot(['A'],1479 builder.build_snapshot(['A'],
1480 [('modify', ('f-id', 'new-content\n'))],1480 [('modify', ('f', 'new-content\n'))],
1481 revision_id='B')1481 revision_id='B')
1482 builder.build_snapshot(['B'],1482 builder.build_snapshot(['B'],
1483 [('modify', ('f-id', 'third-content\n'))],1483 [('modify', ('f', 'third-content\n'))],
1484 revision_id='C')1484 revision_id='C')
1485 builder.build_snapshot(['C'],1485 builder.build_snapshot(['C'],
1486 [('modify', ('f-id', 'fourth-content\n'))],1486 [('modify', ('f', 'fourth-content\n'))],
1487 revision_id='D')1487 revision_id='D')
1488 b = builder.get_branch()1488 b = builder.get_branch()
1489 b.lock_read()1489 b.lock_read()
@@ -1537,7 +1537,7 @@
1537 ('add', ('dir', 'dir-id', 'directory', None))],1537 ('add', ('dir', 'dir-id', 'directory', None))],
1538 revision_id='B')1538 revision_id='B')
1539 builder.build_snapshot(['B'], [1539 builder.build_snapshot(['B'], [
1540 ('modify', ('file-id', 'new content\n'))],1540 ('modify', ('file', 'new content\n'))],
1541 revision_id='C')1541 revision_id='C')
1542 builder.finish_series()1542 builder.finish_series()
1543 return builder.get_branch()1543 return builder.get_branch()
15441544
=== modified file 'breezy/tests/test_workingtree_4.py'
--- breezy/tests/test_workingtree_4.py 2018-02-18 15:49:32 +0000
+++ breezy/tests/test_workingtree_4.py 2018-03-27 00:52:31 +0000
@@ -285,7 +285,7 @@
285 ('add', ('a', 'a-id', 'file', 'content\n'))],285 ('add', ('a', 'a-id', 'file', 'content\n'))],
286 revision_id='A')286 revision_id='A')
287 builder.build_snapshot(['A'], [287 builder.build_snapshot(['A'], [
288 ('modify', ('a-id', 'new content\nfor a\n')),288 ('modify', ('a', 'new content\nfor a\n')),
289 ('add', ('b', 'b-id', 'file', 'b-content\n'))],289 ('add', ('b', 'b-id', 'file', 'b-content\n'))],
290 revision_id='B')290 revision_id='B')
291 tree = self.make_workingtree('tree')291 tree = self.make_workingtree('tree')
@@ -323,7 +323,7 @@
323 ('add', ('a', 'a-id', 'file', 'content\n'))],323 ('add', ('a', 'a-id', 'file', 'content\n'))],
324 revision_id='A')324 revision_id='A')
325 builder.build_snapshot(['A'], [325 builder.build_snapshot(['A'], [
326 ('modify', ('a-id', 'new content\nfor a\n')),326 ('modify', ('a', 'new content\nfor a\n')),
327 ('add', ('b', 'b-id', 'file', 'b-content\n'))],327 ('add', ('b', 'b-id', 'file', 'b-content\n'))],
328 revision_id='B')328 revision_id='B')
329 builder.build_snapshot(['A'], [329 builder.build_snapshot(['A'], [

Subscribers

People subscribed via source and target branches