Merge lp:~jelmer/brz/fix-datetime into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/fix-datetime
Merge into: lp:brz
Diff against target: 4025 lines (+466/-495)
97 files modified
breezy/branchbuilder.py (+3/-3)
breezy/bzr/tests/per_repository_vf/test_fileid_involved.py (+12/-8)
breezy/bzr/tests/per_repository_vf/test_refresh_data.py (+1/-1)
breezy/bzr/tests/per_repository_vf/test_repository.py (+2/-2)
breezy/bzr/tests/per_repository_vf/test_write_group.py (+3/-3)
breezy/bzr/tests/test__dirstate_helpers.py (+5/-5)
breezy/bzr/tests/test_bundle.py (+13/-13)
breezy/bzr/tests/test_conflicts.py (+1/-1)
breezy/bzr/tests/test_dirstate.py (+10/-10)
breezy/bzr/tests/test_inv.py (+4/-4)
breezy/bzr/tests/test_repository.py (+4/-4)
breezy/bzr/tests/test_smart.py (+6/-6)
breezy/bzr/tests/test_testament.py (+2/-2)
breezy/bzr/tests/test_transform.py (+12/-12)
breezy/bzr/tests/test_workingtree_4.py (+11/-11)
breezy/bzr/workingtree.py (+15/-1)
breezy/bzr/workingtree_4.py (+2/-2)
breezy/commands.py (+2/-4)
breezy/config.py (+9/-8)
breezy/filters/__init__.py (+2/-9)
breezy/git/memorytree.py (+1/-1)
breezy/git/tests/test_memorytree.py (+5/-6)
breezy/git/tree.py (+1/-1)
breezy/git/workingtree.py (+1/-1)
breezy/memorytree.py (+2/-2)
breezy/merge.py (+6/-11)
breezy/mergeable.py (+11/-10)
breezy/mutabletree.py (+12/-12)
breezy/plugins/repodebug/fetch_all_records.py (+2/-1)
breezy/plugins/repodebug/missing_keys_for_stacking_fixer.py (+2/-1)
breezy/plugins/rewrite/tests/test_rebase.py (+6/-6)
breezy/plugins/weave_fmt/test_repository.py (+1/-1)
breezy/plugins/weave_fmt/test_workingtree.py (+1/-1)
breezy/repository.py (+1/-2)
breezy/revisionspec.py (+7/-9)
breezy/tests/blackbox/test_bound_branches.py (+2/-2)
breezy/tests/blackbox/test_init.py (+1/-1)
breezy/tests/blackbox/test_inventory.py (+2/-2)
breezy/tests/blackbox/test_join.py (+1/-1)
breezy/tests/blackbox/test_link_tree.py (+1/-1)
breezy/tests/blackbox/test_ls.py (+1/-1)
breezy/tests/blackbox/test_merge.py (+1/-1)
breezy/tests/blackbox/test_mv.py (+1/-1)
breezy/tests/blackbox/test_push.py (+2/-2)
breezy/tests/blackbox/test_remove.py (+1/-1)
breezy/tests/blackbox/test_resolve.py (+1/-1)
breezy/tests/blackbox/test_split.py (+1/-1)
breezy/tests/fixtures.py (+1/-1)
breezy/tests/per_interrepository/test_fetch.py (+2/-2)
breezy/tests/per_intertree/test_compare.py (+56/-56)
breezy/tests/per_intertree/test_file_content_matches.py (+4/-4)
breezy/tests/per_repository/test_repository.py (+1/-1)
breezy/tests/per_repository_reference/test_check.py (+1/-1)
breezy/tests/per_repository_reference/test_commit_with_stacking.py (+6/-6)
breezy/tests/per_tree/test_ids.py (+1/-1)
breezy/tests/per_tree/test_test_trees.py (+3/-3)
breezy/tests/per_tree/test_transform.py (+1/-1)
breezy/tests/per_workingtree/test_add.py (+10/-10)
breezy/tests/per_workingtree/test_commit.py (+1/-1)
breezy/tests/per_workingtree/test_inv.py (+8/-8)
breezy/tests/per_workingtree/test_mkdir.py (+1/-1)
breezy/tests/per_workingtree/test_paths2ids.py (+4/-4)
breezy/tests/per_workingtree/test_workingtree.py (+1/-1)
breezy/tests/test_annotate.py (+4/-4)
breezy/tests/test_bad_files.py (+1/-1)
breezy/tests/test_commit.py (+8/-8)
breezy/tests/test_commit_merge.py (+2/-2)
breezy/tests/test_conflicts.py (+1/-1)
breezy/tests/test_delta.py (+2/-2)
breezy/tests/test_diff.py (+25/-25)
breezy/tests/test_extract.py (+3/-4)
breezy/tests/test_fetch.py (+4/-4)
breezy/tests/test_matchers.py (+3/-3)
breezy/tests/test_memorytree.py (+5/-6)
breezy/tests/test_merge.py (+13/-13)
breezy/tests/test_missing.py (+2/-2)
breezy/tests/test_multiwalker.py (+12/-12)
breezy/tests/test_nonascii.py (+1/-1)
breezy/tests/test_permissions.py (+1/-1)
breezy/tests/test_rename_map.py (+8/-8)
breezy/tests/test_revert.py (+2/-2)
breezy/tests/test_shelf.py (+20/-20)
breezy/tests/test_shelf_ui.py (+4/-4)
breezy/tests/test_smart_add.py (+1/-1)
breezy/tests/test_subsume.py (+2/-2)
breezy/tests/test_transform.py (+7/-7)
breezy/tests/test_upgrade.py (+1/-1)
breezy/tests/test_workingtree.py (+6/-6)
breezy/textmerge.py (+1/-5)
breezy/trace.py (+6/-7)
breezy/transform.py (+0/-3)
breezy/transport/http/urllib.py (+0/-1)
breezy/transport/local.py (+9/-12)
breezy/treebuilder.py (+2/-2)
breezy/ui/__init__.py (+3/-11)
breezy/ui/text.py (+1/-1)
breezy/workingtree.py (+12/-23)
To merge this branch: bzr merge lp:~jelmer/brz/fix-datetime
Reviewer Review Type Date Requested Status
Jelmer Vernooij Approve
Review via email: mp+426102@code.launchpad.net

Commit message

Remove more uses of lazy_imports, move ids in Tree.add() to end of argument list.

Description of the change

Remove more uses of lazy_imports, move ids in Tree.add() to end of argument list.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/branchbuilder.py'
2--- breezy/branchbuilder.py 2020-02-18 01:57:45 +0000
3+++ breezy/branchbuilder.py 2022-07-02 16:16:10 +0000
4@@ -261,15 +261,15 @@
5 # We're overwriting this path, no need to unversion
6 pending.to_unversion_paths.discard(path)
7 # Special case, because the path already exists
8- tree.add([path], [file_id], ['directory'])
9+ tree.add([path], ['directory'], ids=[file_id])
10 else:
11 tree.mkdir(path, file_id)
12 for from_relpath, to_relpath in pending.to_rename:
13 tree.rename_one(from_relpath, to_relpath)
14 if pending.to_unversion_paths:
15 tree.unversion(pending.to_unversion_paths)
16- tree.add(pending.to_add_files, pending.to_add_file_ids,
17- pending.to_add_kinds)
18+ tree.add(pending.to_add_files,
19+ pending.to_add_kinds, pending.to_add_file_ids)
20 for path, content in pending.new_contents.items():
21 tree.put_file_bytes_non_atomic(path, content)
22
23
24=== modified file 'breezy/bzr/tests/per_repository_vf/test_fileid_involved.py'
25--- breezy/bzr/tests/per_repository_vf/test_fileid_involved.py 2020-07-04 12:29:00 +0000
26+++ breezy/bzr/tests/per_repository_vf/test_fileid_involved.py 2022-07-02 16:16:10 +0000
27@@ -171,9 +171,11 @@
28 main_branch = main_wt.branch
29 self.build_tree(["main/a", "main/b", "main/c"])
30
31- main_wt.add(['a', 'b', 'c'], [b'a-file-id-2006-01-01-abcd',
32- b'b-file-id-2006-01-01-defg',
33- b'c-funky<file-id>quiji%bo'])
34+ main_wt.add(
35+ ['a', 'b', 'c'],
36+ ids=[b'a-file-id-2006-01-01-abcd',
37+ b'b-file-id-2006-01-01-defg',
38+ b'c-funky<file-id>quiji%bo'])
39 try:
40 main_wt.commit("Commit one", rev_id=b"rev-A")
41 except errors.IllegalPath:
42@@ -192,7 +194,7 @@
43 bt1.pull(main_branch)
44 b1 = bt1.branch
45 self.build_tree(["branch1/d"])
46- bt1.add(['d'], [b'file-d'])
47+ bt1.add(['d'], ids=[b'file-d'])
48 bt1.commit("branch1, Commit one", rev_id=b"rev-E")
49
50 # -------- end E -----------
51@@ -339,7 +341,7 @@
52 self.build_tree(["main/a"])
53
54 file_id = u'a-f\xedle-id'.encode('utf8')
55- main_wt.add(['a'], [file_id])
56+ main_wt.add(['a'], ids=[file_id])
57 revision_id = u'r\xe9v-a'.encode('utf8')
58 try:
59 main_wt.commit('a', rev_id=revision_id)
60@@ -372,9 +374,11 @@
61 main_branch = main_wt.branch
62 self.build_tree(["main/a", "main/b", "main/c"])
63
64- main_wt.add(['a', 'b', 'c'], [b'a-file-id-2006-01-01-abcd',
65- b'b-file-id-2006-01-01-defg',
66- b'c-funky<file-id>quiji\'"%bo'])
67+ main_wt.add(
68+ ['a', 'b', 'c'],
69+ ids=[b'a-file-id-2006-01-01-abcd',
70+ b'b-file-id-2006-01-01-defg',
71+ b'c-funky<file-id>quiji\'"%bo'])
72 try:
73 main_wt.commit("Commit one", rev_id=b"rev-A")
74 except errors.IllegalPath:
75
76=== modified file 'breezy/bzr/tests/per_repository_vf/test_refresh_data.py'
77--- breezy/bzr/tests/per_repository_vf/test_refresh_data.py 2020-06-10 02:56:53 +0000
78+++ breezy/bzr/tests/per_repository_vf/test_refresh_data.py 2022-07-02 16:16:10 +0000
79@@ -64,7 +64,7 @@
80 tree = self.make_branch_and_memory_tree('target')
81 tree.lock_write()
82 self.addCleanup(tree.unlock)
83- tree.add([''], [b'root-id'])
84+ tree.add([''], ids=[b'root-id'])
85 tree.commit('foo', rev_id=b'commit-in-target')
86 repo = tree.branch.repository
87 token = repo.lock_write().repository_token
88
89=== modified file 'breezy/bzr/tests/per_repository_vf/test_repository.py'
90--- breezy/bzr/tests/per_repository_vf/test_repository.py 2020-06-28 19:19:25 +0000
91+++ breezy/bzr/tests/per_repository_vf/test_repository.py 2022-07-02 16:16:10 +0000
92@@ -217,7 +217,7 @@
93 # Make a repo with one revision and one versioned file.
94 tree = self.make_branch_and_tree('t')
95 self.build_tree(['t/foo'])
96- tree.add('foo', b'file1')
97+ tree.add('foo', ids=b'file1')
98 tree.commit('message', rev_id=b'rev_id')
99 repo = tree.branch.repository
100 repo.lock_write()
101@@ -270,7 +270,7 @@
102 file_key = (file_id,)
103 with tree.lock_write():
104 self.assertEqual(set(), set(repo.texts.keys()))
105- tree.add(['foo'], [file_id], ['file'])
106+ tree.add(['foo'], ['file'], [file_id])
107 tree.put_file_bytes_non_atomic(
108 'foo', b'content\n')
109 try:
110
111=== modified file 'breezy/bzr/tests/per_repository_vf/test_write_group.py'
112--- breezy/bzr/tests/per_repository_vf/test_write_group.py 2020-06-10 02:56:53 +0000
113+++ breezy/bzr/tests/per_repository_vf/test_write_group.py 2022-07-02 16:16:10 +0000
114@@ -67,9 +67,9 @@
115 trunk = repo.controldir.create_branch()
116 tree = memorytree.MemoryTree.create_on_branch(trunk)
117 tree.lock_write()
118- tree.add([''], [b'TREE_ROOT'], ['directory'])
119- tree.add(['dir'], [b'dir-id'], ['directory'])
120- tree.add(['filename'], [b'file-id'], ['file'])
121+ tree.add([''], ['directory'], [b'TREE_ROOT'])
122+ tree.add(['dir'], ['directory'], [b'dir-id'])
123+ tree.add(['filename'], ['file'], [b'file-id'], )
124 tree.put_file_bytes_non_atomic('filename', b'content\n')
125 tree.commit('Trunk commit', rev_id=b'rev-0')
126 tree.commit('Trunk commit', rev_id=b'rev-1')
127
128=== modified file 'breezy/bzr/tests/test__dirstate_helpers.py'
129--- breezy/bzr/tests/test__dirstate_helpers.py 2021-12-08 18:46:11 +0000
130+++ breezy/bzr/tests/test__dirstate_helpers.py 2022-07-02 16:16:10 +0000
131@@ -858,7 +858,7 @@
132 tree.lock_write()
133 empty_revid = tree.commit('empty')
134 self.build_tree(['tree/a'])
135- tree.add(['a'], [b'a-id'])
136+ tree.add(['a'], ids=[b'a-id'])
137 with_a_id = tree.commit('with_a')
138 self.addCleanup(tree.unlock)
139 state.set_parent_trees(
140@@ -1052,7 +1052,7 @@
141 tree = self.make_branch_and_tree('tree')
142 tree.lock_write()
143 self.build_tree(['tree/a'])
144- tree.add(['a'], [b'a-id'])
145+ tree.add(['a'], ids=[b'a-id'])
146 with_a_id = tree.commit('witha')
147 self.addCleanup(tree.unlock)
148 state.set_parent_trees(
149@@ -1232,7 +1232,7 @@
150 text = b'Hello World\n'
151 tree = self.make_branch_and_tree('tree')
152 self.build_tree_contents([('tree/a file', text)])
153- tree.add('a file', b'a-file-id')
154+ tree.add('a file', ids=b'a-file-id')
155 # Note: dirstate does not sha prior to the first commit
156 # so commit now in order for the test to work
157 tree.commit('first')
158@@ -1325,7 +1325,7 @@
159 def test_simple_changes(self):
160 tree = self.make_branch_and_tree('tree')
161 self.build_tree(['tree/file'])
162- tree.add(['file'], [b'file-id'])
163+ tree.add(['file'], ids=[b'file-id'])
164 self.assertChangedFileIds([tree.path2id(''), b'file-id'], tree)
165 tree.commit('one')
166 self.assertChangedFileIds([], tree)
167@@ -1333,7 +1333,7 @@
168 def test_sha1provider_stat_and_sha1_used(self):
169 tree = self.make_branch_and_tree('tree')
170 self.build_tree(['tree/file'])
171- tree.add(['file'], [b'file-id'])
172+ tree.add(['file'], ids=[b'file-id'])
173 tree.commit('one')
174 tree.lock_write()
175 self.addCleanup(tree.unlock)
176
177=== modified file 'breezy/bzr/tests/test_bundle.py'
178--- breezy/bzr/tests/test_bundle.py 2021-12-08 18:46:11 +0000
179+++ breezy/bzr/tests/test_bundle.py 2022-07-02 16:16:10 +0000
180@@ -580,7 +580,7 @@
181 self.b1 = self.tree1.branch
182
183 self.build_tree_contents([('b1/one', b'one\n')])
184- self.tree1.add('one', b'one-id')
185+ self.tree1.add('one', ids=b'one-id')
186 self.tree1.set_root_id(b'root-id')
187 self.tree1.commit('add one', rev_id=b'a@cset-0-1')
188
189@@ -598,7 +598,7 @@
190 tt.apply()
191 # have to fix length of file-id so that we can predictably rewrite
192 # a (length-prefixed) record containing it later.
193- self.tree1.add('with space.txt', b'withspace-id')
194+ self.tree1.add('with space.txt', ids=b'withspace-id')
195 self.tree1.add([
196 'dir', 'dir/filein subdir.c', 'dir/WithCaps.txt', 'dir/ pre space', 'dir/nolastnewline.txt', 'sub', 'sub/sub', 'sub/sub/nonempty.txt', 'sub/sub/emptyfile.txt'
197 ])
198@@ -842,7 +842,7 @@
199 u'William Dod\xe9\n').encode('utf-8'))
200 f.close()
201
202- self.tree1.add([u'with Dod\N{Euro Sign}'], [b'withdod-id'])
203+ self.tree1.add([u'with Dod\N{Euro Sign}'], ids=[b'withdod-id'])
204 self.tree1.commit(u'i18n commit from William Dod\xe9',
205 rev_id=b'i18n-1', committer=u'William Dod\xe9')
206
207@@ -959,7 +959,7 @@
208 tree = self.make_branch_and_memory_tree('tree')
209 tree.lock_write()
210 self.addCleanup(tree.unlock)
211- tree.add([''], [b'TREE_ROOT'])
212+ tree.add([''], ids=[b'TREE_ROOT'])
213 tree.commit('One', revprops={u'one': 'two',
214 u'empty': ''}, rev_id=b'rev1')
215 self.b1 = tree.branch
216@@ -977,7 +977,7 @@
217 tree.lock_write()
218 self.addCleanup(tree.unlock)
219
220- tree.add([''], [b'TREE_ROOT'])
221+ tree.add([''], ids=[b'TREE_ROOT'])
222 tree.commit('One', rev_id=b'rev1',
223 revprops={u'a': '4', u'b': '3', u'c': '2', u'd': '1'})
224 self.b1 = tree.branch
225@@ -995,7 +995,7 @@
226 tree.lock_write()
227 self.addCleanup(tree.unlock)
228
229- tree.add([''], [b'TREE_ROOT'])
230+ tree.add([''], ids=[b'TREE_ROOT'])
231 # Revisions themselves do not require anything about revision property
232 # keys, other than that they are a basestring, and do not contain
233 # whitespace.
234@@ -1126,12 +1126,12 @@
235 self.b1 = self.tree1.branch
236 # rev1 is not present in bundle, done by fetch
237 self.build_tree_contents([('tree/file2', b'contents1')])
238- self.tree1.add('file2', b'file2-id')
239+ self.tree1.add('file2', ids=b'file2-id')
240 self.tree1.commit('rev1', rev_id=b'reva')
241 self.build_tree_contents([('tree/file3', b'contents2')])
242 # rev2 is present in bundle, and done by fetch
243 # having file1 in the bunle causes file1's versionedfile to be opened.
244- self.tree1.add('file3', b'file3-id')
245+ self.tree1.add('file3', ids=b'file3-id')
246 rev2 = self.tree1.commit('rev2')
247 # Updating file2 should not cause an attempt to add to file1's vf
248 target = self.tree1.controldir.sprout('target').open_workingtree()
249@@ -1157,7 +1157,7 @@
250 tree = self.make_branch_and_memory_tree('tree')
251 tree.lock_write()
252 self.addCleanup(tree.unlock)
253- tree.add([''], [b'TREE_ROOT'])
254+ tree.add([''], ids=[b'TREE_ROOT'])
255 tree.commit('One', revprops={u'one': 'two',
256 u'empty': ''}, rev_id=b'rev1')
257 self.b1 = tree.branch
258@@ -1190,7 +1190,7 @@
259 tree = self.make_branch_and_memory_tree('tree')
260 tree.lock_write()
261 self.addCleanup(tree.unlock)
262- tree.add([''], [b'TREE_ROOT'])
263+ tree.add([''], ids=[b'TREE_ROOT'])
264 tree.commit('One', revprops={u'one': 'two',
265 u'empty': ''}, rev_id=b'rev1')
266 self.b1 = tree.branch
267@@ -1219,7 +1219,7 @@
268 tree.lock_write()
269 self.addCleanup(tree.unlock)
270
271- tree.add([''], [b'TREE_ROOT'])
272+ tree.add([''], ids=[b'TREE_ROOT'])
273 tree.commit('One', rev_id=b'rev1',
274 revprops={u'a': '4', u'b': '3', u'c': '2', u'd': '1'})
275 self.b1 = tree.branch
276@@ -1245,7 +1245,7 @@
277 tree.lock_write()
278 self.addCleanup(tree.unlock)
279
280- tree.add([''], [b'TREE_ROOT'])
281+ tree.add([''], ids=[b'TREE_ROOT'])
282 # Revisions themselves do not require anything about revision property
283 # keys, other than that they are a basestring, and do not contain
284 # whitespace.
285@@ -1366,7 +1366,7 @@
286 def test_creation(self):
287 tree = self.make_branch_and_tree('tree')
288 self.build_tree_contents([('tree/file', b'contents1\nstatic\n')])
289- tree.add('file', b'fileid-2')
290+ tree.add('file', ids=b'fileid-2')
291 tree.commit('added file', rev_id=b'rev1')
292 self.build_tree_contents([('tree/file', b'contents2\nstatic\n')])
293 tree.commit('changed file', rev_id=b'rev2')
294
295=== modified file 'breezy/bzr/tests/test_conflicts.py'
296--- breezy/bzr/tests/test_conflicts.py 2020-08-22 16:34:02 +0000
297+++ breezy/bzr/tests/test_conflicts.py 2022-07-02 16:16:10 +0000
298@@ -84,7 +84,7 @@
299 ('hello.BASE', b'hello world1'),
300 ])
301 os.mkdir('hello.OTHER')
302- tree.add('hello', b'q')
303+ tree.add('hello', ids=b'q')
304 l = bzr_conflicts.ConflictList([bzr_conflicts.TextConflict('hello')])
305 l.remove_files(tree)
306
307
308=== modified file 'breezy/bzr/tests/test_dirstate.py'
309--- breezy/bzr/tests/test_dirstate.py 2021-12-08 18:46:11 +0000
310+++ breezy/bzr/tests/test_dirstate.py 2022-07-02 16:16:10 +0000
311@@ -229,7 +229,7 @@
312 b'd-id', b'e-id', b'b-c-id', b'f-id']
313 self.build_tree(['tree/' + p for p in paths])
314 tree.set_root_id(b'TREE_ROOT')
315- tree.add([p.rstrip('/') for p in paths], file_ids)
316+ tree.add([p.rstrip('/') for p in paths], ids=file_ids)
317 tree.commit('initial', rev_id=b'rev-1')
318 revision_id = b'rev-1'
319 # a_packed_stat = dirstate.pack_stat(os.stat('tree/a'))
320@@ -318,7 +318,7 @@
321 # per entry. Unversion in reverse order so we handle subdirs
322 tree.unversion(['f', 'b-c', 'b/d/e', 'b/d', 'b/c', 'b', 'a'])
323 tree.add(['a', 'b', 'b/c', 'b/d', 'b/d/e', 'b-c', 'f'],
324- [b'a-id2', b'b-id2', b'c-id2', b'd-id2', b'e-id2', b'b-c-id2', b'f-id2'])
325+ ids=[b'a-id2', b'b-id2', b'c-id2', b'd-id2', b'e-id2', b'b-c-id2', b'f-id2'])
326
327 # Update the expected dictionary.
328 for path in [b'a', b'b', b'b/c', b'b/d', b'b/d/e', b'b-c', b'f']:
329@@ -455,7 +455,7 @@
330 def get_tree_with_a_file(self):
331 tree = self.make_branch_and_tree('tree')
332 self.build_tree(['tree/a file'])
333- tree.add('a file', b'a-file-id')
334+ tree.add('a file', ids=b'a-file-id')
335 return tree
336
337 def test_non_empty_no_parents_to_dirstate(self):
338@@ -533,7 +533,7 @@
339 for i in range(7):
340 tree = self.make_branch_and_tree('tree%d' % i)
341 self.build_tree(['tree%d/name' % i, ])
342- tree.add(['name'], [b'file-id%d' % i])
343+ tree.add(['name'], ids=[b'file-id%d' % i])
344 revision_id = b'revid-%d' % i
345 tree.commit('message', rev_id=revision_id)
346 parents.append((revision_id,
347@@ -552,7 +552,7 @@
348 def create_updated_dirstate(self):
349 self.build_tree(['a-file'])
350 tree = self.make_branch_and_tree('.')
351- tree.add(['a-file'], [b'a-id'])
352+ tree.add(['a-file'], ids=[b'a-id'])
353 tree.commit('add a-file')
354 # Save and unlock the state, re-open it in readonly mode
355 state = dirstate.DirState.from_tree(tree, 'dirstate')
356@@ -845,7 +845,7 @@
357 # file on disk, but that's not needed for this test
358 foo_contents = b'contents of foo'
359 self.build_tree_contents([('foo', foo_contents)])
360- tree.add('foo', b'foo-id')
361+ tree.add('foo', ids=b'foo-id')
362
363 foo_stat = os.stat('foo')
364 foo_packed = dirstate.pack_stat(foo_stat)
365@@ -897,7 +897,7 @@
366 tree1.lock_write()
367 try:
368 tree1.add(['a', 'a/b', 'a-b', 'a/b/foo', 'a-b/bar'],
369- [b'a-id', b'b-id', b'a-b-id', b'foo-id', b'bar-id'])
370+ ids=[b'a-id', b'b-id', b'a-b-id', b'foo-id', b'bar-id'])
371 tree1.commit('rev1', rev_id=b'rev1')
372 root_id = tree1.path2id('')
373 inv = tree1.root_inventory
374@@ -1105,7 +1105,7 @@
375 tree1.lock_write()
376 try:
377 tree1.add('')
378- tree1.add(['a file'], [b'file-id'], ['file'])
379+ tree1.add(['a file'], ['file'], [b'file-id'])
380 tree1.put_file_bytes_non_atomic('a file', b'file-content')
381 revid1 = tree1.commit('foo')
382 finally:
383@@ -1338,7 +1338,7 @@
384 tree1 = self.make_branch_and_tree('tree1')
385 self.build_tree(['tree1/b'])
386 with tree1.lock_write():
387- tree1.add(['b'], [b'b-id'])
388+ tree1.add(['b'], ids=[b'b-id'])
389 root_id = tree1.path2id('')
390 inv = tree1.root_inventory
391 state = dirstate.DirState.initialize('dirstate')
392@@ -1383,7 +1383,7 @@
393 tree = self.make_branch_and_tree('.')
394 self.build_tree(['c', 'd'])
395 tree.lock_write()
396- tree.add(['c', 'd'], [b'c-id', b'd-id'])
397+ tree.add(['c', 'd'], ids=[b'c-id', b'd-id'])
398 tree.commit('add c and d')
399 state = InstrumentedDirState.on_file(tree.current_dirstate()._filename,
400 worth_saving_limit=2)
401
402=== modified file 'breezy/bzr/tests/test_inv.py'
403--- breezy/bzr/tests/test_inv.py 2020-07-18 23:14:00 +0000
404+++ breezy/bzr/tests/test_inv.py 2022-07-02 16:16:10 +0000
405@@ -174,17 +174,17 @@
406 """Put all entries into tree, but at a unique location."""
407 added_ids = set()
408 added_paths = set()
409- tree.add(['unique-dir'], [b'unique-dir-id'], ['directory'])
410+ tree.add(['unique-dir'], ['directory'], [b'unique-dir-id'])
411 for path, ie in basis.iter_entries_by_dir():
412 if ie.file_id in added_ids:
413 continue
414 # We want a unique path for each of these, we use the file-id
415- tree.add(['unique-dir/' + ie.file_id], [ie.file_id], [ie.kind])
416+ tree.add(['unique-dir/' + ie.file_id], [ie.kind], [ie.file_id])
417 added_ids.add(ie.file_id)
418 for old_path, new_path, file_id, ie in delta:
419 if file_id in added_ids:
420 continue
421- tree.add(['unique-dir/' + file_id], [file_id], [ie.kind])
422+ tree.add(['unique-dir/' + file_id], [ie.kind], [file_id])
423
424
425 def apply_inventory_WT_basis(test, basis, delta, invalid_delta=True):
426@@ -1588,7 +1588,7 @@
427 def test_some_files(self):
428 wt = self.make_branch_and_tree('.')
429 self.build_tree(['a'])
430- wt.add(['a'], [b'thefileid'])
431+ wt.add(['a'], ids=[b'thefileid'])
432 revid = wt.commit("commit")
433 tree = wt.branch.repository.revision_tree(revid)
434 inv = mutable_inventory_from_tree(tree)
435
436=== modified file 'breezy/bzr/tests/test_repository.py'
437--- breezy/bzr/tests/test_repository.py 2022-05-03 20:36:36 +0000
438+++ breezy/bzr/tests/test_repository.py 2022-07-02 16:16:10 +0000
439@@ -259,7 +259,7 @@
440 # Check per-file knits.
441 control.create_branch()
442 tree = control.create_workingtree()
443- tree.add(['foo'], [b'Nasty-IdC:'], ['file'])
444+ tree.add(['foo'], ['file'], [b'Nasty-IdC:'])
445 tree.put_file_bytes_non_atomic('foo', b'')
446 tree.commit('1st post', rev_id=b'foo')
447 self.assertHasKnit(t, 'knits/e8/%254easty-%2549d%2543%253a',
448@@ -640,7 +640,7 @@
449 def test_inventories_use_chk_map_with_parent_base_dict(self):
450 tree = self.make_branch_and_memory_tree('repo', format="2a")
451 tree.lock_write()
452- tree.add([''], [b'TREE_ROOT'])
453+ tree.add([''], ids=[b'TREE_ROOT'])
454 revid = tree.commit("foo")
455 tree.unlock()
456 tree.lock_read()
457@@ -661,7 +661,7 @@
458 tree = self.make_branch_and_memory_tree('tree', format='2a')
459 tree.lock_write()
460 self.addCleanup(tree.unlock)
461- tree.add([''], [b'TREE_ROOT'])
462+ tree.add([''], ids=[b'TREE_ROOT'])
463 for pos in range(20):
464 tree.commit(str(pos))
465
466@@ -669,7 +669,7 @@
467 tree = self.make_branch_and_memory_tree('tree', format='2a')
468 tree.lock_write()
469 self.addCleanup(tree.unlock)
470- tree.add([''], [b'TREE_ROOT'])
471+ tree.add([''], ids=[b'TREE_ROOT'])
472 # 1 commit to leave untouched
473 tree.commit('1')
474 to_keep = tree.branch.repository._pack_collection.names()
475
476=== modified file 'breezy/bzr/tests/test_smart.py'
477--- breezy/bzr/tests/test_smart.py 2021-08-18 22:38:08 +0000
478+++ breezy/bzr/tests/test_smart.py 2022-07-02 16:16:10 +0000
479@@ -1820,7 +1820,7 @@
480 request = smart_repo.SmartServerRepositoryGetRevIdForRevno(backing)
481 parent = self.make_branch_and_memory_tree('parent', format='1.9')
482 parent.lock_write()
483- parent.add([''], [b'TREE_ROOT'])
484+ parent.add([''], ids=[b'TREE_ROOT'])
485 parent.commit(message='first commit')
486 r2 = parent.commit(message='second commit')
487 parent.unlock()
488@@ -1966,7 +1966,7 @@
489 t = self.make_branch_and_tree('.')
490 self.addCleanup(t.lock_write().unlock)
491 self.build_tree_contents([("file", b"somecontents")])
492- t.add(["file"], [b"thefileid"])
493+ t.add(["file"], ids=[b"thefileid"])
494 t.commit(rev_id=b'somerev', message="add file")
495 self.assertIs(None, request.execute(b''))
496 response = request.do_body(b"thefileid\0somerev\n")
497@@ -2743,7 +2743,7 @@
498 t = self.make_branch_and_tree('.', format='2a')
499 self.addCleanup(t.lock_write().unlock)
500 self.build_tree_contents([("file", b"somecontents")])
501- t.add(["file"], [b"thefileid"])
502+ t.add(["file"], ids=[b"thefileid"])
503 t.commit(rev_id=b'somerev', message="add file")
504 self.assertIs(None, request.execute(b'', b'unordered'))
505 response = request.do_body(b"somerev\n")
506@@ -2764,7 +2764,7 @@
507 t = self.make_branch_and_tree('.', format='2a')
508 self.addCleanup(t.lock_write().unlock)
509 self.build_tree_contents([("file", b"somecontents")])
510- t.add(["file"], [b"thefileid"])
511+ t.add(["file"], ids=[b"thefileid"])
512 t.commit(rev_id=b'somerev', message="add file")
513 self.assertIs(None, request.execute(b'', b'unordered'))
514 response = request.do_body(b"")
515@@ -2807,7 +2807,7 @@
516 t = self.make_branch_and_tree('.')
517 self.addCleanup(t.lock_write().unlock)
518 self.build_tree_contents([("file", b"somecontents")])
519- t.add(["file"], [b"thefileid"])
520+ t.add(["file"], ids=[b"thefileid"])
521 t.commit(rev_id=b'somerev', message="add file")
522 response = request.execute(b'', b"somerev", b"tar", b"foo.tar", b"foo")
523 self.assertTrue(response.is_successful())
524@@ -2825,7 +2825,7 @@
525 t = self.make_branch_and_tree('.')
526 self.addCleanup(t.lock_write().unlock)
527 self.build_tree_contents([("file", b"somecontents\nmorecontents\n")])
528- t.add(["file"], [b"thefileid"])
529+ t.add(["file"], ids=[b"thefileid"])
530 t.commit(rev_id=b'somerev', message="add file")
531 response = request.execute(b'', b"somerev", b"file")
532 self.assertTrue(response.is_successful())
533
534=== modified file 'breezy/bzr/tests/test_testament.py'
535--- breezy/bzr/tests/test_testament.py 2021-12-08 18:46:11 +0000
536+++ breezy/bzr/tests/test_testament.py 2022-07-02 16:16:10 +0000
537@@ -49,7 +49,7 @@
538 ('src/', ),
539 ('src/foo.c', b'int main()\n{\n}\n')])
540 self.wt.add(['hello', 'src', 'src/foo.c'],
541- [b'hello-id', b'src-id', b'foo.c-id'])
542+ ids=[b'hello-id', b'src-id', b'foo.c-id'])
543 tt = self.wt.transform()
544 trans_id = tt.trans_id_tree_path('hello')
545 tt.set_executability(True, trans_id)
546@@ -105,7 +105,7 @@
547 """Testament containing symlink (where possible)"""
548 self.requireFeature(SymlinkFeature(self.test_dir))
549 os.symlink('wibble/linktarget', 'link')
550- self.wt.add(['link'], [b'link-id'])
551+ self.wt.add(['link'], ids=[b'link-id'])
552 self.wt.commit(message='add symlink',
553 timestamp=1129025493,
554 timezone=36000,
555
556=== modified file 'breezy/bzr/tests/test_transform.py'
557--- breezy/bzr/tests/test_transform.py 2022-01-09 13:12:27 +0000
558+++ breezy/bzr/tests/test_transform.py 2022-07-02 16:16:10 +0000
559@@ -32,14 +32,14 @@
560 def test_inventory_altered_unchanged(self):
561 tree = self.make_branch_and_tree('tree')
562 self.build_tree(['tree/foo'])
563- tree.add('foo', b'foo-id')
564+ tree.add('foo', ids=b'foo-id')
565 with tree.preview_transform() as tt:
566 self.assertEqual([], tt._inventory_altered())
567
568 def test_inventory_altered_changed_parent_id(self):
569 tree = self.make_branch_and_tree('tree')
570 self.build_tree(['tree/foo'])
571- tree.add('foo', b'foo-id')
572+ tree.add('foo', ids=b'foo-id')
573 with tree.preview_transform() as tt:
574 tt.unversion_file(tt.root)
575 tt.version_file(tt.root, file_id=b'new-id')
576@@ -51,7 +51,7 @@
577 def test_inventory_altered_noop_changed_parent_id(self):
578 tree = self.make_branch_and_tree('tree')
579 self.build_tree(['tree/foo'])
580- tree.add('foo', b'foo-id')
581+ tree.add('foo', ids=b'foo-id')
582 with tree.preview_transform() as tt:
583 tt.unversion_file(tt.root)
584 tt.version_file(tt.root, file_id=tree.path2id(''))
585@@ -97,7 +97,7 @@
586 source = self.make_branch_and_tree('source')
587 target = self.make_branch_and_tree('target')
588 self.build_tree(['source/file', 'target/file'])
589- source.add('file', b'new-file')
590+ source.add('file', ids=b'new-file')
591 source.commit('added file')
592 build_tree(source.basis_tree(), target)
593 self.assertEqual(
594@@ -116,7 +116,7 @@
595 self.requireFeature(features.SymlinkFeature(self.test_dir))
596 source = self.make_branch_and_tree('source')
597 os.symlink('foo', 'source/symlink')
598- source.add('symlink', b'new-symlink')
599+ source.add('symlink', ids=b'new-symlink')
600 source.commit('added file')
601 target = self.make_branch_and_tree('target')
602 os.symlink('bar', 'target/symlink')
603@@ -135,7 +135,7 @@
604 source = self.make_branch_and_tree('source')
605 target = self.make_branch_and_tree('target')
606 self.build_tree(['source/dir1/', 'source/dir1/file', 'target/dir1/'])
607- source.add(['dir1', 'dir1/file'], [b'new-dir1', b'new-file'])
608+ source.add(['dir1', 'dir1/file'], ids=[b'new-dir1', b'new-file'])
609 source.commit('added file')
610 build_tree(source.basis_tree(), target)
611 self.assertEqual([], target.conflicts())
612@@ -179,7 +179,7 @@
613 source = self.make_branch_and_tree('source')
614 target = self.make_branch_and_tree('target')
615 self.build_tree(['source/name', 'target/name/'])
616- source.add('name', b'new-name')
617+ source.add('name', ids=b'new-name')
618 source.commit('added file')
619 build_tree(source.basis_tree(), target)
620 self.assertEqual(
621@@ -220,7 +220,7 @@
622 source = self.make_branch_and_tree('source')
623 self.build_tree_contents([('source/file1', b'A')])
624 self.build_tree_contents([('source/file2', b'B')])
625- source.add(['file1', 'file2'], [b'file1-id', b'file2-id'])
626+ source.add(['file1', 'file2'], ids=[b'file1-id', b'file2-id'])
627 source.commit('commit files')
628 source.lock_write()
629 self.addCleanup(source.unlock)
630@@ -276,7 +276,7 @@
631 source = self.make_branch_and_tree('source')
632 self.build_tree_contents([('source/file1', b'')])
633 self.build_tree_contents([('source/file2', b'')])
634- source.add(['file1', 'file2'], [b'file1-id', b'file2-id'])
635+ source.add(['file1', 'file2'], ids=[b'file1-id', b'file2-id'])
636 source.commit('commit files')
637 os.unlink('source/file2')
638 self.build_tree_contents([('source/file2/', b'C')])
639@@ -327,7 +327,7 @@
640 def test_build_tree_accelerator_tree_moved(self):
641 source = self.make_branch_and_tree('source')
642 self.build_tree_contents([('source/file1', b'A')])
643- source.add(['file1'], [b'file1-id'])
644+ source.add(['file1'], ids=[b'file1-id'])
645 source.commit('commit files')
646 source.rename_one('file1', 'file2')
647 source.lock_read()
648@@ -417,7 +417,7 @@
649 raise tests.UnavailableFeature('Fully case sensitive filesystem')
650 source = self.make_branch_and_tree('source')
651 self.build_tree(['source/file', 'source/FILE'])
652- source.add(['file', 'FILE'], [b'lower-id', b'upper-id'])
653+ source.add(['file', 'FILE'], ids=[b'lower-id', b'upper-id'])
654 source.commit('added files')
655 # Don't try this at home, kids!
656 # Force the tree to report that it is case insensitive
657@@ -431,7 +431,7 @@
658 source = self.make_branch_and_tree('source')
659 self.build_tree(['source/file1', 'source/dir/', 'source/dir/file2'])
660 source.add(['file1', 'dir', 'dir/file2'],
661- [b'file1-id', b'dir-id', b'file2-id'])
662+ ids=[b'file1-id', b'dir-id', b'file2-id'])
663 source.commit('new files')
664 target = self.make_branch_and_tree('target')
665 target.lock_write()
666
667=== modified file 'breezy/bzr/tests/test_workingtree_4.py'
668--- breezy/bzr/tests/test_workingtree_4.py 2022-05-03 20:36:36 +0000
669+++ breezy/bzr/tests/test_workingtree_4.py 2022-07-02 16:16:10 +0000
670@@ -121,12 +121,12 @@
671 subtree.lock_write()
672 self.addCleanup(subtree.unlock)
673 self.build_tree(['subdir/file-a', ])
674- subtree.add(['file-a'], [b'id-a'])
675+ subtree.add(['file-a'], ids=[b'id-a'])
676 rev1 = subtree.commit('commit in subdir')
677
678 subtree2 = subtree.controldir.sprout('subdir2').open_workingtree()
679 self.build_tree(['subdir2/file-b'])
680- subtree2.add(['file-b'], [b'id-b'])
681+ subtree2.add(['file-b'], ids=[b'id-b'])
682 rev2 = subtree2.commit('commit in subdir2')
683
684 subtree.flush()
685@@ -506,11 +506,11 @@
686 def test_id2path(self):
687 tree = self.make_workingtree('tree')
688 self.build_tree(['tree/a', 'tree/b'])
689- tree.add(['a'], [b'a-id'])
690+ tree.add(['a'], ids=[b'a-id'])
691 self.assertEqual(u'a', tree.id2path(b'a-id'))
692 self.assertRaises(errors.NoSuchId, tree.id2path, 'a')
693 tree.commit('a')
694- tree.add(['b'], [b'b-id'])
695+ tree.add(['b'], ids=[b'b-id'])
696
697 try:
698 new_path = u'b\u03bcrry'
699@@ -573,7 +573,7 @@
700 self.build_tree(['dir/'])
701 # for testing easily.
702 tree.set_root_id(b'root')
703- tree.add(['dir'], [b'dir-id'])
704+ tree.add(['dir'], ids=[b'dir-id'])
705 self.make_branch_and_tree('dir')
706 # the most primitive operation: kind
707 self.assertEqual('directory', tree.kind('dir'))
708@@ -673,7 +673,7 @@
709 """
710 tree = self.make_branch_and_tree('tree')
711 self.build_tree_contents([('tree/bar', b'')])
712- tree.add(['bar'], [b'bar-id'])
713+ tree.add(['bar'], ids=[b'bar-id'])
714 tree.lock_read()
715 self.addCleanup(tree.unlock)
716
717@@ -691,7 +691,7 @@
718 self.requireFeature(features.UnicodeFilenameFeature)
719 tree = self.make_branch_and_tree('.')
720 self.build_tree_contents([('f', b'')])
721- tree.add(['f'], [b'f-id'])
722+ tree.add(['f'], ids=[b'f-id'])
723
724 def tree_iter_changes(tree, files):
725 return list(tree.iter_changes(
726@@ -708,7 +708,7 @@
727 tree.lock_write()
728 self.addCleanup(tree.unlock)
729 self.build_tree_contents([('foo', b'a bit of content for foo\n')])
730- tree.add(['foo'], [b'foo-id'])
731+ tree.add(['foo'], ids=[b'foo-id'])
732 tree.current_dirstate()._cutoff_time = time.time() + 60
733 return tree
734
735@@ -743,7 +743,7 @@
736 def test_observed_sha1_new_file(self):
737 tree = self.make_branch_and_tree('.')
738 self.build_tree(['foo'])
739- tree.add(['foo'], [b'foo-id'])
740+ tree.add(['foo'], ids=[b'foo-id'])
741 with tree.lock_read():
742 current_sha1 = tree._get_entry(path="foo")[1][0][1]
743 with tree.lock_write():
744@@ -814,7 +814,7 @@
745 tree = self.create_wt4()
746 tree.lock_write()
747 self.addCleanup(tree.unlock)
748- tree.add(['dir', 'dir/file'], [b'dir-id', b'file-id'])
749+ tree.add(['dir', 'dir/file'], ids=[b'dir-id', b'file-id'])
750 first_revision_id = tree.commit('init')
751
752 root_id = tree.path2id('')
753@@ -867,7 +867,7 @@
754 """Unversioning the root of a subtree unversions the entire subtree."""
755 tree = self.make_branch_and_tree('.')
756 self.build_tree(['a/', 'a/b', 'c/'])
757- tree.add(['a', 'a/b', 'c'], [b'a-id', b'b-id', b'c-id'])
758+ tree.add(['a', 'a/b', 'c'], ids=[b'a-id', b'b-id', b'c-id'])
759 # within a lock unversion should take effect
760 tree.lock_write()
761 self.addCleanup(tree.unlock)
762
763=== modified file 'breezy/bzr/workingtree.py'
764--- breezy/bzr/workingtree.py 2022-01-03 16:41:02 +0000
765+++ breezy/bzr/workingtree.py 2022-07-02 16:16:10 +0000
766@@ -62,6 +62,7 @@
767 )
768 from breezy.bzr import (
769 conflicts as _mod_bzr_conflicts,
770+ generate_ids,
771 inventory,
772 serializer,
773 xml5,
774@@ -793,7 +794,7 @@
775 return self._is_executable_from_path_and_stat_from_stat(
776 path, stat_result)
777
778- def _add(self, files, ids, kinds):
779+ def _add(self, files, kinds, ids):
780 """See MutableTree._add."""
781 with self.lock_tree_write():
782 # TODO: Re-adding a file that is removed in the working copy
783@@ -809,6 +810,19 @@
784 inv.add_path(f, kind=kind, file_id=file_id)
785 self._inventory_is_modified = True
786
787+ def mkdir(self, path, file_id=None):
788+ """See MutableTree.mkdir()."""
789+ if file_id is None:
790+ if self.supports_setting_file_ids():
791+ file_id = generate_ids.gen_file_id(os.path.basename(path))
792+ else:
793+ if not self.supports_setting_file_ids():
794+ raise SettingFileIdUnsupported()
795+ with self.lock_write():
796+ os.mkdir(self.abspath(path))
797+ self.add([path], ['directory'], ids=[file_id])
798+ return file_id
799+
800 def revision_tree(self, revision_id):
801 """See WorkingTree.revision_id."""
802 if revision_id == self.last_revision():
803
804=== modified file 'breezy/bzr/workingtree_4.py'
805--- breezy/bzr/workingtree_4.py 2022-01-04 19:34:32 +0000
806+++ breezy/bzr/workingtree_4.py 2022-07-02 16:16:10 +0000
807@@ -130,7 +130,7 @@
808 self._branch.repository._format, "supports_tree_reference",
809 False)
810
811- def _add(self, files, ids, kinds):
812+ def _add(self, files, kinds, ids):
813 """See MutableTree._add."""
814 with self.lock_tree_write():
815 state = self.current_dirstate()
816@@ -185,7 +185,7 @@
817 else:
818 raise BadReferenceTarget(
819 self, sub_tree, 'Root id already present in tree')
820- self._add([sub_tree_path], [sub_tree_id], ['tree-reference'])
821+ self._add([sub_tree_path], ['tree-reference'], [sub_tree_id])
822
823 def break_lock(self):
824 """Break a lock if one is present from another instance.
825
826=== modified file 'breezy/commands.py'
827--- breezy/commands.py 2022-01-09 13:12:27 +0000
828+++ breezy/commands.py 2022-07-02 16:16:10 +0000
829@@ -46,8 +46,6 @@
830
831 from .hooks import Hooks
832 from .i18n import gettext
833-# Compatibility - Option used to be in commands.
834-from .option import Option
835 from .plugin import disable_plugins, load_plugins, plugin_name
836 from . import errors, registry
837
838@@ -708,7 +706,7 @@
839 """Return dict of valid options for this command.
840
841 Maps from long option name to option object."""
842- r = Option.STD_OPTIONS.copy()
843+ r = option.Option.STD_OPTIONS.copy()
844 std_names = set(r)
845 for o in self.takes_options:
846 if isinstance(o, str):
847@@ -1054,7 +1052,7 @@
848 import breezy.config
849 config = breezy.config.GlobalConfig()
850 alias = config.get_alias(cmd)
851- if (alias):
852+ if alias:
853 return cmdline.split(alias)
854 return None
855
856
857=== modified file 'breezy/config.py'
858--- breezy/config.py 2021-05-02 15:07:21 +0000
859+++ breezy/config.py 2022-07-02 16:16:10 +0000
860@@ -114,6 +114,7 @@
861 lazy_regex,
862 registry,
863 )
864+from .option import Option as CommandOption
865
866
867 CHECK_IF_POSSIBLE = 0
868@@ -3874,14 +3875,14 @@
869 # FIXME: This should be a registry option so that plugins can register
870 # their own config files (or not) and will also address
871 # http://pad.lv/788991 -- vila 20101115
872- commands.Option('scope', help='Reduce the scope to the specified'
873- ' configuration file.',
874- type=str),
875- commands.Option('all',
876- help='Display all the defined values for the matching options.',
877- ),
878- commands.Option('remove', help='Remove the option from'
879- ' the configuration file.'),
880+ CommandOption('scope', help='Reduce the scope to the specified'
881+ ' configuration file.',
882+ type=str),
883+ CommandOption('all',
884+ help='Display all the defined values for the matching options.',
885+ ),
886+ CommandOption('remove', help='Remove the option from'
887+ ' the configuration file.'),
888 ]
889
890 _see_also = ['configuration']
891
892=== modified file 'breezy/filters/__init__.py'
893--- breezy/filters/__init__.py 2020-02-18 01:57:45 +0000
894+++ breezy/filters/__init__.py 2022-07-02 16:16:10 +0000
895@@ -43,18 +43,11 @@
896 BytesIO,
897 )
898
899-from ..lazy_import import lazy_import
900-lazy_import(globals(), """
901-from breezy import (
902- config,
903+from .. import (
904+ errors,
905 osutils,
906 registry,
907 )
908-""")
909-
910-from .. import (
911- errors,
912- )
913
914
915 class ContentFilter(object):
916
917=== modified file 'breezy/git/memorytree.py'
918--- breezy/git/memorytree.py 2020-07-18 23:14:00 +0000
919+++ breezy/git/memorytree.py 2022-07-02 16:16:10 +0000
920@@ -249,7 +249,7 @@
921
922 def mkdir(self, path, file_id=None):
923 """See MutableTree.mkdir()."""
924- self.add(path, None, 'directory')
925+ self.add(path, 'directory')
926 self._file_transport.mkdir(path)
927
928 def _rename_one(self, from_rel, to_rel):
929
930=== modified file 'breezy/git/tests/test_memorytree.py'
931--- breezy/git/tests/test_memorytree.py 2019-09-27 01:38:48 +0000
932+++ breezy/git/tests/test_memorytree.py 2022-07-02 16:16:10 +0000
933@@ -83,8 +83,7 @@
934 branch = self.make_branch('branch')
935 tree = branch.create_memorytree()
936 tree.lock_write()
937- tree.add(['', 'afile', 'adir'], None,
938- ['directory', 'file', 'directory'])
939+ tree.add(['', 'afile', 'adir'], ['directory', 'file', 'directory'])
940 self.assertTrue(tree.is_versioned('afile'))
941 self.assertFalse(tree.is_versioned('adir'))
942 self.assertFalse(tree.has_filename('afile'))
943@@ -112,10 +111,10 @@
944 branch = self.make_branch('branch')
945 tree = branch.create_memorytree()
946 with tree.lock_write():
947- tree.add([''], None, ['directory'])
948+ tree.add([''], ['directory'])
949 tree.mkdir('adir')
950 tree.put_file_bytes_non_atomic('adir/afile', b'barshoom')
951- tree.add(['adir/afile'], None, ['file'])
952+ tree.add(['adir/afile'], ['file'])
953 self.assertTrue(tree.is_versioned('adir/afile'))
954 self.assertTrue(tree.is_versioned('adir'))
955
956@@ -160,7 +159,7 @@
957 tree = self.make_branch_and_memory_tree('branch')
958 tree.lock_write()
959 self.addCleanup(tree.unlock)
960- tree.add(['', 'foo'], [b'root-id', b'foo-id'], ['directory', 'file'])
961+ tree.add(['', 'foo'], ['directory', 'file'], ids=[b'root-id', b'foo-id'])
962 tree.put_file_bytes_non_atomic('foo', b'content\n')
963 tree.commit('one', rev_id=b'rev-one')
964 tree.rename_one('foo', 'bar')
965@@ -183,7 +182,7 @@
966 self.addCleanup(tree.unlock)
967 tree.add('')
968 tree.mkdir('subdir', b'subdir-id')
969- tree.add('foo', b'foo-id', 'file')
970+ tree.add('foo', 'file', b'foo-id')
971 tree.put_file_bytes_non_atomic('foo', b'content\n')
972 tree.commit('one', rev_id=b'rev-one')
973
974
975=== modified file 'breezy/git/tree.py'
976--- breezy/git/tree.py 2022-01-04 23:53:15 +0000
977+++ breezy/git/tree.py 2022-07-02 16:16:10 +0000
978@@ -1164,7 +1164,7 @@
979 def _set_root_id(self, file_id):
980 raise errors.UnsupportedOperation(self._set_root_id, self)
981
982- def _add(self, files, ids, kinds):
983+ def _add(self, files, kinds, ids):
984 for (path, file_id, kind) in zip(files, ids, kinds):
985 if file_id is not None:
986 raise workingtree.SettingFileIdUnsupported()
987
988=== modified file 'breezy/git/workingtree.py'
989--- breezy/git/workingtree.py 2022-01-04 23:53:15 +0000
990+++ breezy/git/workingtree.py 2022-07-02 16:16:10 +0000
991@@ -1295,7 +1295,7 @@
992 raise BadReferenceTarget(
993 self, sub_tree, 'Target not inside tree.')
994
995- self._add([sub_tree_path], [None], ['tree-reference'])
996+ self._add([sub_tree_path], ['tree-reference'], [None])
997
998 def _read_submodule_head(self, path):
999 return read_submodule_head(self.abspath(path))
1000
1001=== modified file 'breezy/memorytree.py'
1002--- breezy/memorytree.py 2020-02-18 01:57:45 +0000
1003+++ breezy/memorytree.py 2022-07-02 16:16:10 +0000
1004@@ -62,7 +62,7 @@
1005 # Memory tree doesn't have any control filenames
1006 return False
1007
1008- def _add(self, files, ids, kinds):
1009+ def _add(self, files, kinds, ids):
1010 """See MutableTree._add."""
1011 with self.lock_tree_write():
1012 for f, file_id, kind in zip(files, ids, kinds):
1013@@ -162,7 +162,7 @@
1014
1015 def mkdir(self, path, file_id=None):
1016 """See MutableTree.mkdir()."""
1017- self.add(path, file_id, 'directory')
1018+ self.add(path, 'directory', file_id)
1019 if file_id is None:
1020 file_id = self.path2id(path)
1021 self._file_transport.mkdir(path)
1022
1023=== modified file 'breezy/merge.py'
1024--- breezy/merge.py 2022-01-21 17:19:24 +0000
1025+++ breezy/merge.py 2022-07-02 16:16:10 +0000
1026@@ -22,33 +22,28 @@
1027
1028 from breezy import (
1029 branch as _mod_branch,
1030- conflicts as _mod_conflicts,
1031 debug,
1032 graph as _mod_graph,
1033- merge3,
1034- osutils,
1035 revision as _mod_revision,
1036 textfile,
1037- trace,
1038 tree as _mod_tree,
1039- tsort,
1040 ui,
1041 workingtree,
1042 )
1043 from breezy.bzr import (
1044- conflicts as _mod_bzr_conflicts,
1045 generate_ids,
1046 versionedfile,
1047 )
1048 from breezy.i18n import gettext
1049 """)
1050-from breezy.bzr.conflicts import Conflict as BzrConflict
1051 from . import (
1052 decorators,
1053 errors,
1054 hooks,
1055+ osutils,
1056 registry,
1057 transform,
1058+ trace,
1059 )
1060 # TODO: Report back as changes are merged in
1061
1062@@ -1411,14 +1406,14 @@
1063
1064 def text_merge(self, trans_id, paths):
1065 """Perform a three-way text merge on a file"""
1066+ from .merge3 import Merge3
1067 # it's possible that we got here with base as a different type.
1068 # if so, we just want two-way text conflicts.
1069 base_path, other_path, this_path = paths
1070 base_lines = self.get_lines(self.base_tree, base_path)
1071 other_lines = self.get_lines(self.other_tree, other_path)
1072 this_lines = self.get_lines(self.this_tree, this_path)
1073- m3 = merge3.Merge3(base_lines, this_lines, other_lines,
1074- is_cherrypick=self.cherrypick)
1075+ m3 = Merge3(base_lines, this_lines, other_lines, is_cherrypick=self.cherrypick)
1076 start_marker = b"!START OF MERGE CONFLICT!" + b"I HOPE THIS IS UNIQUE"
1077 if self.show_base is True:
1078 base_marker = b'|' * 7
1079@@ -2251,6 +2246,7 @@
1080
1081 def _build_weave(self):
1082 from .bzr import weave
1083+ from .tsort import merge_sort
1084 self._weave = weave.Weave(weave_name='in_memory_weave',
1085 allow_reserved=True)
1086 parent_map = self._find_recursive_lcas()
1087@@ -2267,8 +2263,7 @@
1088 tip_key = self._key_prefix + (_mod_revision.CURRENT_REVISION,)
1089 parent_map[tip_key] = (self.a_key, self.b_key)
1090
1091- for seq_num, key, depth, eom in reversed(tsort.merge_sort(parent_map,
1092- tip_key)):
1093+ for seq_num, key, depth, eom in reversed(merge_sort(parent_map, tip_key)):
1094 if key == tip_key:
1095 continue
1096 # for key in tsort.topo_sort(parent_map):
1097
1098=== modified file 'breezy/mergeable.py'
1099--- breezy/mergeable.py 2020-02-18 01:57:45 +0000
1100+++ breezy/mergeable.py 2022-07-02 16:16:10 +0000
1101@@ -18,19 +18,19 @@
1102
1103 from .lazy_import import lazy_import
1104 lazy_import(globals(), """
1105-from breezy import (
1106- transport as _mod_transport,
1107- urlutils,
1108- )
1109-from breezy.bzr.bundle import serializer as _serializer
1110-from breezy.merge_directive import MergeDirective
1111 from breezy.i18n import gettext
1112 """)
1113
1114 from . import (
1115 errors,
1116+ urlutils,
1117 )
1118 from .trace import note
1119+from .transport import (
1120+ do_catching_redirections,
1121+ get_transport,
1122+ get_transport_from_url,
1123+ )
1124
1125
1126 class Mergeable(object):
1127@@ -57,8 +57,7 @@
1128 :return: An object supporting get_target_revision. Raises NotABundle if
1129 the target is not a mergeable type.
1130 """
1131- child_transport = _mod_transport.get_transport(
1132- url, possible_transports=possible_transports)
1133+ child_transport = get_transport(url, possible_transports=possible_transports)
1134 transport = child_transport.clone('..')
1135 filename = transport.relpath(child_transport.base)
1136 mergeable, transport = read_mergeable_from_transport(transport, filename,
1137@@ -76,10 +75,10 @@
1138 exclude_trailing_slash=False)
1139 if not filename:
1140 raise errors.NotABundle(gettext('A directory cannot be a bundle'))
1141- return _mod_transport.get_transport_from_url(url)
1142+ return get_transport_from_url(url)
1143
1144 try:
1145- bytef, transport = _mod_transport.do_catching_redirections(
1146+ bytef, transport = do_catching_redirections(
1147 get_bundle, transport, redirected_transport)
1148 except errors.TooManyRedirections:
1149 raise errors.NotABundle(transport.clone(filename).base)
1150@@ -98,9 +97,11 @@
1151 raise errors.NotABundle(str(e))
1152
1153 if _do_directive:
1154+ from .merge_directive import MergeDirective
1155 try:
1156 return MergeDirective.from_lines(bytef), transport
1157 except errors.NotAMergeDirective:
1158 bytef.seek(0)
1159
1160+ from .bzr.bundle import serializer as _serializer
1161 return _serializer.read_bundle(bytef), transport
1162
1163=== modified file 'breezy/mutabletree.py'
1164--- breezy/mutabletree.py 2020-08-10 15:00:17 +0000
1165+++ breezy/mutabletree.py 2022-07-02 16:16:10 +0000
1166@@ -78,7 +78,7 @@
1167 """
1168 raise NotImplementedError(self.is_control_filename)
1169
1170- def add(self, files, ids=None, kinds=None):
1171+ def add(self, files, kinds=None, ids=None):
1172 """Add paths to the set of versioned paths.
1173
1174 Note that the command line normally calls smart_add instead,
1175@@ -87,12 +87,13 @@
1176 This adds the files to the tree, so that they will be
1177 recorded by the next commit.
1178
1179- :param files: List of paths to add, relative to the base of the tree.
1180- :param ids: If set, use these instead of automatically generated ids.
1181+ Args:
1182+ files: List of paths to add, relative to the base of the tree.
1183+ kinds: Optional parameter to specify the kinds to be used for
1184+ each file.
1185+ ids: If set, use these instead of automatically generated ids.
1186 Must be the same length as the list of files, but may
1187 contain None for ids that are to be autogenerated.
1188- :param kinds: Optional parameter to specify the kinds to be used for
1189- each file.
1190
1191 TODO: Perhaps callback with the ids and paths as they're added.
1192 """
1193@@ -130,7 +131,7 @@
1194 # caring about the instantaneous file kind within a uncommmitted tree
1195 #
1196 self._gather_kinds(files, kinds)
1197- self._add(files, ids, kinds)
1198+ self._add(files, kinds, ids)
1199
1200 def add_reference(self, sub_tree):
1201 """Add a TreeReference to the tree, pointing at sub_tree.
1202@@ -139,13 +140,13 @@
1203 """
1204 raise errors.UnsupportedOperation(self.add_reference, self)
1205
1206- def _add(self, files, ids, kinds):
1207+ def _add(self, files, kinds, ids):
1208 """Helper function for add - updates the inventory.
1209
1210 :param files: sequence of pathnames, relative to the tree root
1211- :param ids: sequence of suggested ids for the files (may be None)
1212 :param kinds: sequence of inventory kinds of the files (i.e. may
1213 contain "tree-reference")
1214+ :param ids: sequence of suggested ids for the files (may be None)
1215 """
1216 raise NotImplementedError(self._add)
1217
1218@@ -260,11 +261,10 @@
1219 """
1220 raise NotImplementedError(self.lock_write)
1221
1222- def mkdir(self, path, file_id=None):
1223- """Create a directory in the tree. if file_id is None, one is assigned.
1224+ def mkdir(self, path):
1225+ """Create a directory in the tree.
1226
1227 :param path: A unicode file path.
1228- :param file_id: An optional file-id.
1229 :return: the file id of the new directory.
1230 """
1231 raise NotImplementedError(self.mkdir)
1232@@ -291,7 +291,7 @@
1233 written to a temporary location and renamed. As a consequence,
1234 readers can potentially see the file half-written.
1235
1236- :param file_id: file-id of the file
1237+ :param path: path of the file
1238 :param bytes: the new file contents
1239 """
1240 raise NotImplementedError(self.put_file_bytes_non_atomic)
1241
1242=== modified file 'breezy/plugins/repodebug/fetch_all_records.py'
1243--- breezy/plugins/repodebug/fetch_all_records.py 2020-02-18 01:57:45 +0000
1244+++ breezy/plugins/repodebug/fetch_all_records.py 2022-07-02 16:16:10 +0000
1245@@ -16,7 +16,8 @@
1246
1247
1248 from ...controldir import ControlDir
1249-from ...commands import Command, Option
1250+from ...commands import Command
1251+from ...option import Option
1252 from ... import errors, urlutils
1253
1254
1255
1256=== modified file 'breezy/plugins/repodebug/missing_keys_for_stacking_fixer.py'
1257--- breezy/plugins/repodebug/missing_keys_for_stacking_fixer.py 2020-06-23 01:02:30 +0000
1258+++ breezy/plugins/repodebug/missing_keys_for_stacking_fixer.py 2022-07-02 16:16:10 +0000
1259@@ -15,7 +15,8 @@
1260 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1261
1262 from ...controldir import ControlDir
1263-from ...commands import Command, Option
1264+from ...commands import Command
1265+from ...option import Option
1266 from ... import errors
1267 from ...bzr.vf_search import PendingAncestryResult
1268 from ...repository import WriteGroup
1269
1270=== modified file 'breezy/plugins/rewrite/tests/test_rebase.py'
1271--- breezy/plugins/rewrite/tests/test_rebase.py 2022-05-03 18:47:58 +0000
1272+++ breezy/plugins/rewrite/tests/test_rebase.py 2022-07-02 16:16:10 +0000
1273@@ -394,14 +394,14 @@
1274 def test_two_revisions(self):
1275 wt = self.make_branch_and_tree("old")
1276 self.build_tree_contents([('old/afile', 'afilecontents'), ('old/notherfile', 'notherfilecontents')])
1277- wt.add(["afile"], [b"somefileid"])
1278+ wt.add(["afile"], ids=[b"somefileid"])
1279 wt.commit("bla", rev_id=b"oldparent")
1280 wt.add(["notherfile"])
1281 wt.commit("bla", rev_id=b"oldcommit")
1282 oldrepos = wt.branch.repository
1283 wt = self.make_branch_and_tree("new")
1284 self.build_tree_contents([('new/afile', 'afilecontents'), ('new/notherfile', 'notherfilecontents')])
1285- wt.add(["afile"], [b"afileid"])
1286+ wt.add(["afile"], ids=[b"afileid"])
1287 wt.commit("bla", rev_id=b"newparent")
1288 wt.branch.repository.fetch(oldrepos)
1289 wt.branch.repository.lock_write()
1290@@ -422,14 +422,14 @@
1291 def test_two_revisions_no_renames(self):
1292 wt = self.make_branch_and_tree("old")
1293 self.build_tree(['old/afile', 'old/notherfile'])
1294- wt.add(["afile"], [b"somefileid"])
1295+ wt.add(["afile"], ids=[b"somefileid"])
1296 wt.commit("bla", rev_id=b"oldparent")
1297 wt.add(["notherfile"])
1298 wt.commit("bla", rev_id=b"oldcommit")
1299 oldrepos = wt.branch.repository
1300 wt = self.make_branch_and_tree("new")
1301 self.build_tree(['new/afile', 'new/notherfile'])
1302- wt.add(["afile"], [b"afileid"])
1303+ wt.add(["afile"], ids=[b"afileid"])
1304 wt.commit("bla", rev_id=b"newparent")
1305 wt.branch.repository.fetch(oldrepos)
1306 wt.branch.repository.lock_write()
1307@@ -442,7 +442,7 @@
1308 self.build_tree_contents(
1309 [('old/afile', 'afilecontent'), ('old/sfile', 'sfilecontent'), ('old/notherfile', 'notherfilecontent')])
1310 wt.add(['sfile'])
1311- wt.add(["afile"], [b"somefileid"])
1312+ wt.add(["afile"], ids=[b"somefileid"])
1313 wt.commit("bla", rev_id=b"oldgrandparent")
1314 with open("old/afile", "w") as f:
1315 f.write("data")
1316@@ -454,7 +454,7 @@
1317 self.build_tree_contents(
1318 [('new/afile', 'afilecontent'), ('new/sfile', 'sfilecontent'), ('new/notherfile', 'notherfilecontent')])
1319 wt.add(['sfile'])
1320- wt.add(["afile"], [b"afileid"])
1321+ wt.add(["afile"], ids=[b"afileid"])
1322 wt.commit("bla", rev_id=b"newgrandparent")
1323 with open("new/afile", "w") as f:
1324 f.write("data")
1325
1326=== modified file 'breezy/plugins/weave_fmt/test_repository.py'
1327--- breezy/plugins/weave_fmt/test_repository.py 2020-02-18 01:57:45 +0000
1328+++ breezy/plugins/weave_fmt/test_repository.py 2022-07-02 16:16:10 +0000
1329@@ -138,7 +138,7 @@
1330 # disk.
1331 control.create_branch()
1332 tree = control.create_workingtree()
1333- tree.add(['foo'], [b'Foo:Bar'], ['file'])
1334+ tree.add(['foo'], ['file'], ids=[b'Foo:Bar'])
1335 tree.put_file_bytes_non_atomic('foo', b'content\n')
1336 try:
1337 tree.commit('first post', rev_id=b'first')
1338
1339=== modified file 'breezy/plugins/weave_fmt/test_workingtree.py'
1340--- breezy/plugins/weave_fmt/test_workingtree.py 2020-08-10 15:00:17 +0000
1341+++ breezy/plugins/weave_fmt/test_workingtree.py 2022-07-02 16:16:10 +0000
1342@@ -52,7 +52,7 @@
1343 self.assertEqual(list(tree.conflicts()), [expected])
1344 with open('lala', 'wb') as f:
1345 f.write(b'la')
1346- tree.add('lala', b'lala-id')
1347+ tree.add('lala', ids=b'lala-id')
1348 expected = ContentsConflict('lala', file_id='lala-id')
1349 self.assertEqual(list(tree.conflicts()), [expected])
1350 with open('lala.THIS', 'wb') as f:
1351
1352=== modified file 'breezy/repository.py'
1353--- breezy/repository.py 2021-01-10 00:25:52 +0000
1354+++ breezy/repository.py 2022-07-02 16:16:10 +0000
1355@@ -20,17 +20,16 @@
1356
1357 from breezy import (
1358 config,
1359- controldir,
1360 debug,
1361 graph,
1362 osutils,
1363 revision as _mod_revision,
1364- gpg,
1365 )
1366 from breezy.i18n import gettext
1367 """)
1368
1369 from . import (
1370+ controldir,
1371 errors,
1372 registry,
1373 ui,
1374
1375=== modified file 'breezy/revisionspec.py'
1376--- breezy/revisionspec.py 2021-11-13 13:01:39 +0000
1377+++ breezy/revisionspec.py 2022-07-02 16:16:10 +0000
1378@@ -15,18 +15,11 @@
1379 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1380
1381
1382-from .lazy_import import lazy_import
1383-lazy_import(globals(), """
1384-import bisect
1385-import datetime
1386-
1387 from breezy import (
1388- branch as _mod_branch,
1389 revision,
1390 workingtree,
1391 )
1392 from breezy.i18n import gettext
1393-""")
1394
1395 from . import (
1396 errors,
1397@@ -421,8 +414,9 @@
1398 dotted = True
1399
1400 if branch_spec:
1401+ from .branch import Branch
1402 # the user has overriden the branch to look in.
1403- branch = _mod_branch.Branch.open(branch_spec)
1404+ branch = Branch.open(branch_spec)
1405
1406 if dotted:
1407 try:
1408@@ -647,6 +641,7 @@
1409
1410 def __getitem__(self, index):
1411 """Get the date of the index'd item"""
1412+ import datetime
1413 r = self.branch.repository.get_revision(self.branch.get_rev_id(index))
1414 # TODO: Handle timezone.
1415 return datetime.datetime.fromtimestamp(r.timestamp)
1416@@ -689,6 +684,8 @@
1417 matches the first entry after a given date (either at midnight or
1418 at a specified time).
1419 """
1420+ import bisect
1421+ import datetime
1422 # XXX: This doesn't actually work
1423 # So the proper way of saying 'give me all entries for today' is:
1424 # -r date:yesterday..date:today
1425@@ -949,7 +946,8 @@
1426 if revspec.get_branch() is None:
1427 spec_branch = context_branch
1428 else:
1429- spec_branch = _mod_branch.Branch.open(revspec.get_branch())
1430+ from .branch import Branch
1431+ spec_branch = Branch.open(revspec.get_branch())
1432 revision_id = revspec.as_revision_id(spec_branch)
1433 graph = context_branch.repository.get_graph()
1434 result = graph.find_lefthand_merger(revision_id,
1435
1436=== modified file 'breezy/tests/blackbox/test_bound_branches.py'
1437--- breezy/tests/blackbox/test_bound_branches.py 2018-11-11 04:08:32 +0000
1438+++ breezy/tests/blackbox/test_bound_branches.py 2022-07-02 16:16:10 +0000
1439@@ -51,7 +51,7 @@
1440 def test_simple_binding(self):
1441 tree = self.make_branch_and_tree('base')
1442 self.build_tree(['base/a', 'base/b'])
1443- tree.add('a', b'b')
1444+ tree.add('a', ids=b'b')
1445 tree.commit(message='init')
1446
1447 tree.controldir.sprout('child')
1448@@ -352,7 +352,7 @@
1449 """Test --directory option"""
1450 tree = self.make_branch_and_tree('base')
1451 self.build_tree(['base/a', 'base/b'])
1452- tree.add('a', b'b')
1453+ tree.add('a', ids=b'b')
1454 tree.commit(message='init')
1455 branch = tree.branch
1456 tree.controldir.sprout('child')
1457
1458=== modified file 'breezy/tests/blackbox/test_init.py'
1459--- breezy/tests/blackbox/test_init.py 2022-05-02 11:39:09 +0000
1460+++ breezy/tests/blackbox/test_init.py 2022-07-02 16:16:10 +0000
1461@@ -162,7 +162,7 @@
1462 def create_simple_tree(self):
1463 tree = self.make_branch_and_tree('tree')
1464 self.build_tree(['tree/a'])
1465- tree.add(['a'], [b'a-id'])
1466+ tree.add(['a'], ids=[b'a-id'])
1467 tree.commit('one', rev_id=b'r1')
1468 return tree
1469
1470
1471=== modified file 'breezy/tests/blackbox/test_inventory.py'
1472--- breezy/tests/blackbox/test_inventory.py 2019-06-29 09:30:39 +0000
1473+++ breezy/tests/blackbox/test_inventory.py 2022-07-02 16:16:10 +0000
1474@@ -29,7 +29,7 @@
1475 tree = self.make_branch_and_tree('.')
1476 self.build_tree(['a', 'b/', 'b/c'])
1477
1478- tree.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
1479+ tree.add(['a', 'b', 'b/c'], ids=[b'a-id', b'b-id', b'c-id'])
1480 tree.commit('init', rev_id=b'one')
1481 self.tree = tree
1482
1483@@ -94,7 +94,7 @@
1484
1485 def test_inventory_revision(self):
1486 self.build_tree(['b/d', 'e'])
1487- self.tree.add(['b/d', 'e'], [b'd-id', b'e-id'])
1488+ self.tree.add(['b/d', 'e'], ids=[b'd-id', b'e-id'])
1489 self.tree.commit('add files')
1490
1491 self.tree.rename_one('b/d', 'd')
1492
1493=== modified file 'breezy/tests/blackbox/test_join.py'
1494--- breezy/tests/blackbox/test_join.py 2020-01-11 02:39:17 +0000
1495+++ breezy/tests/blackbox/test_join.py 2022-07-02 16:16:10 +0000
1496@@ -32,7 +32,7 @@
1497 base_tree.commit('empty commit')
1498 self.build_tree(['tree/subtree/', 'tree/subtree/file1'])
1499 sub_tree = self.make_branch_and_tree('tree/subtree')
1500- sub_tree.add('file1', b'file1-id')
1501+ sub_tree.add('file1', ids=b'file1-id')
1502 sub_tree.commit('added file1')
1503 return base_tree, sub_tree
1504
1505
1506=== modified file 'breezy/tests/blackbox/test_link_tree.py'
1507--- breezy/tests/blackbox/test_link_tree.py 2021-12-09 00:49:01 +0000
1508+++ breezy/tests/blackbox/test_link_tree.py 2022-07-02 16:16:10 +0000
1509@@ -37,7 +37,7 @@
1510 self.parent_tree.lock_write()
1511 self.addCleanup(self.parent_tree.unlock)
1512 self.build_tree_contents([('parent/foo', b'bar')])
1513- self.parent_tree.add('foo', b'foo-id')
1514+ self.parent_tree.add('foo', ids=b'foo-id')
1515 self.parent_tree.commit('added foo')
1516 child_controldir = self.parent_tree.controldir.sprout('child')
1517 self.child_tree = child_controldir.open_workingtree()
1518
1519=== modified file 'breezy/tests/blackbox/test_ls.py'
1520--- breezy/tests/blackbox/test_ls.py 2020-06-17 17:41:09 +0000
1521+++ breezy/tests/blackbox/test_ls.py 2022-07-02 16:16:10 +0000
1522@@ -94,7 +94,7 @@
1523
1524 def test_show_ids(self):
1525 self.build_tree(['subdir/'])
1526- self.wt.add(['a', 'subdir'], [b'a-id', b'subdir-id'])
1527+ self.wt.add(['a', 'subdir'], ids=[b'a-id', b'subdir-id'])
1528 self.ls_equals(
1529 '.bzrignore \n'
1530 'a a-id\n'
1531
1532=== modified file 'breezy/tests/blackbox/test_merge.py'
1533--- breezy/tests/blackbox/test_merge.py 2020-08-09 18:10:01 +0000
1534+++ breezy/tests/blackbox/test_merge.py 2022-07-02 16:16:10 +0000
1535@@ -415,7 +415,7 @@
1536 def test_merge_kind_change(self):
1537 tree_a = self.make_branch_and_tree('tree_a')
1538 self.build_tree_contents([('tree_a/file', b'content_1')])
1539- tree_a.add('file', b'file-id')
1540+ tree_a.add('file', ids=b'file-id')
1541 tree_a.commit('added file')
1542 tree_b = tree_a.controldir.sprout('tree_b').open_workingtree()
1543 os.unlink('tree_a/file')
1544
1545=== modified file 'breezy/tests/blackbox/test_mv.py'
1546--- breezy/tests/blackbox/test_mv.py 2021-12-08 18:46:11 +0000
1547+++ breezy/tests/blackbox/test_mv.py 2022-07-02 16:16:10 +0000
1548@@ -197,7 +197,7 @@
1549 self.build_tree(['a/', 'a/b'])
1550 os.symlink('a', 'c')
1551 os.symlink('.', 'd')
1552- tree.add(['a', 'a/b', 'c'], [b'a-id', b'b-id', b'c-id'])
1553+ tree.add(['a', 'a/b', 'c'], ids=[b'a-id', b'b-id', b'c-id'])
1554 self.run_bzr('mv c/b b')
1555 tree = workingtree.WorkingTree.open('.')
1556 self.assertEqual(b'b-id', tree.path2id('b'))
1557
1558=== modified file 'breezy/tests/blackbox/test_push.py'
1559--- breezy/tests/blackbox/test_push.py 2020-06-13 02:58:24 +0000
1560+++ breezy/tests/blackbox/test_push.py 2022-07-02 16:16:10 +0000
1561@@ -235,7 +235,7 @@
1562 def test_push_funky_id(self):
1563 t = self.make_branch_and_tree('tree')
1564 self.build_tree(['tree/filename'])
1565- t.add('filename', b'funky-chars<>%&;"\'')
1566+ t.add('filename', ids=b'funky-chars<>%&;"\'')
1567 t.commit('commit filename')
1568 self.run_bzr('push -d tree new-tree')
1569
1570@@ -295,7 +295,7 @@
1571 def create_simple_tree(self):
1572 tree = self.make_branch_and_tree('tree')
1573 self.build_tree(['tree/a'])
1574- tree.add(['a'], [b'a-id'])
1575+ tree.add(['a'], ids=[b'a-id'])
1576 tree.commit('one', rev_id=b'r1')
1577 return tree
1578
1579
1580=== modified file 'breezy/tests/blackbox/test_remove.py'
1581--- breezy/tests/blackbox/test_remove.py 2021-12-08 18:46:11 +0000
1582+++ breezy/tests/blackbox/test_remove.py 2022-07-02 16:16:10 +0000
1583@@ -44,7 +44,7 @@
1584 self.build_tree(paths)
1585 for path in paths:
1586 file_id = path.replace('/', '_').encode('utf-8') + _id
1587- tree.add(path, file_id)
1588+ tree.add(path, ids=file_id)
1589 return tree
1590
1591 def assertFilesDeleted(self, files):
1592
1593=== modified file 'breezy/tests/blackbox/test_resolve.py'
1594--- breezy/tests/blackbox/test_resolve.py 2020-08-09 18:10:01 +0000
1595+++ breezy/tests/blackbox/test_resolve.py 2022-07-02 16:16:10 +0000
1596@@ -177,7 +177,7 @@
1597 tree = self.make_branch_and_tree('tree')
1598 self.build_tree_contents([('tree/file',
1599 b'<<<<<<<\na\n=======\n>>>>>>>\n')])
1600- tree.add('file', b'file_id')
1601+ tree.add('file', ids=b'file_id')
1602 self.assertEqual(tree.kind('file'), 'file')
1603 file_conflict = _mod_bzr_conflicts.TextConflict('file', file_id=b'file_id')
1604 tree.set_conflicts([file_conflict])
1605
1606=== modified file 'breezy/tests/blackbox/test_split.py'
1607--- breezy/tests/blackbox/test_split.py 2018-11-11 04:08:32 +0000
1608+++ breezy/tests/blackbox/test_split.py 2022-07-02 16:16:10 +0000
1609@@ -36,7 +36,7 @@
1610 a_branch = repo.controldir.create_branch()
1611 self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d'])
1612 wt = a_branch.create_checkout('a', lightweight=True)
1613- wt.add(['b', 'b/c', 'b/c/d'], [b'b-id', b'c-id', b'd-id'])
1614+ wt.add(['b', 'b/c', 'b/c/d'], ids=[b'b-id', b'c-id', b'd-id'])
1615 wt.commit('added files')
1616 self.run_bzr_error(('must upgrade your branch at .*a',), 'split a/b')
1617
1618
1619=== modified file 'breezy/tests/fixtures.py'
1620--- breezy/tests/fixtures.py 2020-02-07 02:14:30 +0000
1621+++ breezy/tests/fixtures.py 2022-07-02 16:16:10 +0000
1622@@ -136,7 +136,7 @@
1623 # 20110705
1624 tree = testcase.make_branch_and_tree('t')
1625 testcase.build_tree_contents([('t/hello', b'hello world')])
1626- tree.add(['hello'], [b'hello-id'])
1627+ tree.add(['hello'], ids=[b'hello-id'])
1628 return tree
1629
1630
1631
1632=== modified file 'breezy/tests/per_interrepository/test_fetch.py'
1633--- breezy/tests/per_interrepository/test_fetch.py 2021-11-13 21:30:35 +0000
1634+++ breezy/tests/per_interrepository/test_fetch.py 2022-07-02 16:16:10 +0000
1635@@ -495,7 +495,7 @@
1636 # start by adding a file so the data knit for the file exists in
1637 # repositories that have specific files for each fileid.
1638 self.build_tree(['source/id'])
1639- source_tree.add(['id'], [b'id'])
1640+ source_tree.add(['id'], ids=[b'id'])
1641 source_tree.commit('a', rev_id=b'a')
1642 # now we manually insert a revision with an inventory referencing
1643 # file 'id' at revision 'b', but we do not insert revision b.
1644@@ -533,7 +533,7 @@
1645 if not from_tree.supports_setting_file_ids():
1646 raise TestNotApplicable(
1647 'from tree format can not create custom file ids')
1648- from_tree.add('filename', b'funky-chars<>%&;"\'')
1649+ from_tree.add('filename', ids=b'funky-chars<>%&;"\'')
1650 from_tree.commit('commit filename')
1651 to_repo = self.make_to_repository('to')
1652 try:
1653
1654=== modified file 'breezy/tests/per_intertree/test_compare.py'
1655--- breezy/tests/per_intertree/test_compare.py 2021-12-25 12:35:22 +0000
1656+++ breezy/tests/per_intertree/test_compare.py 2022-07-02 16:16:10 +0000
1657@@ -65,7 +65,7 @@
1658 self.build_tree(files, line_endings='binary',
1659 transport=tree.controldir.root_transport)
1660 tree.set_root_id(b'root-id')
1661- tree.add(files, [b'a-id', b'b-id', b'c-id'])
1662+ tree.add(files, ids=[b'a-id', b'b-id', b'c-id'])
1663
1664 def get_tree_no_parents_abc_content(self, tree, converter=None):
1665 """return a test tree with a, b/, b/c contents."""
1666@@ -370,8 +370,8 @@
1667 tree2.set_root_id(tree1.path2id(''))
1668 self.build_tree(['tree1/a', 'tree1/c',
1669 'tree2/a', 'tree2/b', 'tree2/c'])
1670- tree1.add(['a', 'c'], [b'a-id', b'c-id'])
1671- tree2.add(['a', 'c'], [b'a-id', b'c-id'])
1672+ tree1.add(['a', 'c'], ids=[b'a-id', b'c-id'])
1673+ tree2.add(['a', 'c'], ids=[b'a-id', b'c-id'])
1674
1675 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
1676 d = self.intertree_class(tree1, tree2).compare()
1677@@ -421,7 +421,7 @@
1678 self.build_tree(files, line_endings='binary',
1679 transport=tree.controldir.root_transport)
1680 tree.set_root_id(b'root-id')
1681- tree.add(files, [b'a-id', b'b-id', b'c-id'])
1682+ tree.add(files, ids=[b'a-id', b'b-id', b'c-id'])
1683
1684 def get_tree_no_parents_abc_content(self, tree, converter=None):
1685 """return a test tree with a, b/, b/c contents."""
1686@@ -435,7 +435,7 @@
1687 """
1688 self._make_abc_tree(tree)
1689 self.build_tree(['d/'], transport=tree.controldir.root_transport)
1690- tree.add(['d'], [b'd-id'])
1691+ tree.add(['d'], ids=[b'd-id'])
1692 tt = tree.transform()
1693 trans_id = tt.trans_id_tree_path('b')
1694 parent_trans_id = tt.trans_id_tree_path('d')
1695@@ -560,7 +560,7 @@
1696 path_ids.append((d.replace('/', '_') + '-id').encode('ascii'))
1697 path_ids.append((d.replace('/', '_') + '_f-id').encode('ascii'))
1698 self.build_tree(with_slashes)
1699- tree.add(paths, path_ids)
1700+ tree.add(paths, ids=path_ids)
1701 return paths
1702
1703 def test_compare_empty_trees(self):
1704@@ -787,8 +787,8 @@
1705 tree2 = self.get_tree_no_parents_abc_content(tree2)
1706 # the pathname is chosen to fall between 'a' and 'b'.
1707 self.build_tree(['1/a-empty/', '2/a-empty/'])
1708- tree1.add(['a-empty'], [b'a-empty'])
1709- tree2.add(['a-empty'], [b'a-empty'])
1710+ tree1.add(['a-empty'], ids=[b'a-empty'])
1711+ tree2.add(['a-empty'], ids=[b'a-empty'])
1712 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
1713 expected = []
1714 self.assertEqual(expected, self.do_iter_changes(tree1, tree2))
1715@@ -823,14 +823,14 @@
1716 tree1 = self.make_branch_and_tree('1')
1717 tree1.mkdir('changing', b'parent-id')
1718 tree1.mkdir('changing/unchanging', b'mid-id')
1719- tree1.add(['changing/unchanging/file'], [b'file-id'], ['file'])
1720+ tree1.add(['changing/unchanging/file'], ['file'], [b'file-id'])
1721 tree1.put_file_bytes_non_atomic(
1722 'changing/unchanging/file', b'a file')
1723 tree2 = self.make_to_branch_and_tree('2')
1724 tree2.set_root_id(tree1.path2id(''))
1725 tree2.mkdir('changed', b'parent-id')
1726 tree2.mkdir('changed/unchanging', b'mid-id')
1727- tree2.add(['changed/unchanging/file'], [b'file-id'], ['file'])
1728+ tree2.add(['changed/unchanging/file'], ['file'], [b'file-id'])
1729 tree2.put_file_bytes_non_atomic(
1730 'changed/unchanging/file', b'changed content')
1731 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
1732@@ -850,13 +850,13 @@
1733 tree1.set_root_id(b'old')
1734 tree1.mkdir('changed', b'parent-id')
1735 tree1.mkdir('changed/unchanging', b'mid-id')
1736- tree1.add(['changed/unchanging/file'], [b'file-id'], ['file'])
1737+ tree1.add(['changed/unchanging/file'], ['file'], [b'file-id'])
1738 tree1.put_file_bytes_non_atomic('changed/unchanging/file', b'a file')
1739 tree2 = self.make_to_branch_and_tree('2')
1740 tree2.set_root_id(b'new')
1741 tree2.mkdir('changed', b'parent-id')
1742 tree2.mkdir('changed/unchanging', b'mid-id')
1743- tree2.add(['changed/unchanging/file'], [b'file-id'], ['file'])
1744+ tree2.add(['changed/unchanging/file'], ['file'], [b'file-id'])
1745 tree2.put_file_bytes_non_atomic(
1746 'changed/unchanging/file', b'changed content')
1747 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1748@@ -903,12 +903,12 @@
1749 # when a parent is new at its path, if the path was used in the source
1750 # it must be emitted as a change.
1751 tree1 = self.make_branch_and_tree('1')
1752- tree1.add(['a'], [b'a-id'], ['file'])
1753+ tree1.add(['a'], ['file'], [b'a-id'])
1754 tree1.put_file_bytes_non_atomic('a', b'a file')
1755 tree2 = self.make_to_branch_and_tree('2')
1756 tree2.set_root_id(tree1.path2id(''))
1757 tree2.mkdir('a', b'b-id')
1758- tree2.add(['a/c'], [b'c-id'], ['file'])
1759+ tree2.add(['a/c'], ['file'], [b'c-id'])
1760 tree2.put_file_bytes_non_atomic('a/c', b'another file')
1761 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1762 # a-id is gone, b-id and c-id are added.
1763@@ -929,7 +929,7 @@
1764 tree2.set_root_id(tree1.path2id(''))
1765 tree2.mkdir('a', b'a-new-id')
1766 tree2.mkdir('a/reparented', b'reparented-id')
1767- tree2.add(['b'], [b'a-old-id'], ['file'])
1768+ tree2.add(['b'], ['file'], [b'a-old-id'])
1769 tree2.put_file_bytes_non_atomic('b', b'')
1770 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1771 # a-old-id is kind-changed, a-new-id is added, reparented-id is renamed,
1772@@ -1051,10 +1051,10 @@
1773 tree1 = self.make_branch_and_tree('1')
1774 self.build_tree(['1/a'])
1775 tree1.set_root_id(b'root-id')
1776- tree1.add(['a'], [b'a-id'])
1777+ tree1.add(['a'], ids=[b'a-id'])
1778 tree2 = self.make_branch_and_tree('2')
1779 os.mkfifo('2/a')
1780- tree2.add(['a'], [b'a-id'], ['file'])
1781+ tree2.add(['a'], ['file'], [b'a-id'])
1782 try:
1783 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
1784 except (KeyError,):
1785@@ -1089,9 +1089,9 @@
1786 tree2 = self.make_to_branch_and_tree('tree2')
1787 tree2.set_root_id(tree1.path2id(''))
1788 self.build_tree(['tree1/file'])
1789- tree1.add(['file'], [b'file-id'])
1790+ tree1.add(['file'], ids=[b'file-id'])
1791 self.build_tree(['tree2/directory/'])
1792- tree2.add(['directory'], [b'file-id'])
1793+ tree2.add(['directory'], ids=[b'file-id'])
1794 os.rmdir('tree2/directory')
1795 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1796 self.not_applicable_if_missing_in('directory', tree2)
1797@@ -1107,7 +1107,7 @@
1798 tree2 = self.make_to_branch_and_tree('tree2')
1799 tree2.set_root_id(tree1.path2id(''))
1800 self.build_tree(['tree1/file'])
1801- tree1.add(['file'], [b'file-id'])
1802+ tree1.add(['file'], ids=[b'file-id'])
1803 os.unlink('tree1/file')
1804 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1805 self.not_applicable_if_missing_in('file', tree1)
1806@@ -1123,7 +1123,7 @@
1807 tree2 = self.make_to_branch_and_tree('tree2')
1808 tree2.set_root_id(tree1.path2id(''))
1809 self.build_tree(['tree2/file'])
1810- tree2.add(['file'], [b'file-id'])
1811+ tree2.add(['file'], ids=[b'file-id'])
1812 os.unlink('tree2/file')
1813 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1814 self.not_applicable_if_missing_in('file', tree2)
1815@@ -1139,7 +1139,7 @@
1816 tree2 = self.make_to_branch_and_tree('tree2')
1817 tree2.set_root_id(tree1.path2id(''))
1818 self.build_tree(['tree2/a-dir/', 'tree2/a-dir/a-file'])
1819- tree2.add(['a-dir', 'a-dir/a-file'], [b'dir-id', b'file-id'])
1820+ tree2.add(['a-dir', 'a-dir/a-file'], ids=[b'dir-id', b'file-id'])
1821 os.unlink('tree2/a-dir/a-file')
1822 os.rmdir('tree2/a-dir')
1823 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1824@@ -1248,8 +1248,8 @@
1825 tree2.set_root_id(tree1.path2id(''))
1826 self.build_tree(['tree1/a', 'tree1/c',
1827 'tree2/a', 'tree2/b', 'tree2/c'])
1828- tree1.add(['a', 'c'], [b'a-id', b'c-id'])
1829- tree2.add(['a', 'c'], [b'a-id', b'c-id'])
1830+ tree1.add(['a', 'c'], ids=[b'a-id', b'c-id'])
1831+ tree2.add(['a', 'c'], ids=[b'a-id', b'c-id'])
1832
1833 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1834
1835@@ -1329,11 +1329,11 @@
1836 links_supported = True
1837 else:
1838 links_supported = False
1839- tree1.add(['file', 'dir'], [b'file-id', b'dir-id'])
1840- tree2.add(['movedfile', 'moveddir'], [b'file-id', b'dir-id'])
1841+ tree1.add(['file', 'dir'], ids=[b'file-id', b'dir-id'])
1842+ tree2.add(['movedfile', 'moveddir'], ids=[b'file-id', b'dir-id'])
1843 if links_supported:
1844- tree1.add(['link'], [b'link-id'])
1845- tree2.add(['movedlink'], [b'link-id'])
1846+ tree1.add(['link'], ids=[b'link-id'])
1847+ tree2.add(['movedlink'], ids=[b'link-id'])
1848 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1849 self.not_applicable_if_cannot_represent_unversioned(tree2)
1850 root_id = tree1.path2id('')
1851@@ -1380,9 +1380,9 @@
1852 'tree2/a-c/e/',
1853 ])
1854 tree1.add(['a', 'a/b', 'a/b/c', 'a/b/c/d', 'a-c', 'a-c/e'],
1855- [b'a-id', b'b-id', b'c-id', b'd-id', b'a-c-id', b'e-id'])
1856+ ids=[b'a-id', b'b-id', b'c-id', b'd-id', b'a-c-id', b'e-id'])
1857 tree2.add(['a', 'a/b', 'a/b/c', 'a/b/c/d', 'a-c', 'a-c/e'],
1858- [b'a-id', b'b-id', b'c-id', b'd-id', b'a-c-id', b'e-id'])
1859+ ids=[b'a-id', b'b-id', b'c-id', b'd-id', b'a-c-id', b'e-id'])
1860
1861 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1862 self.not_applicable_if_cannot_represent_unversioned(tree2)
1863@@ -1452,9 +1452,9 @@
1864 'tofile',
1865 'unchanged',
1866 ]
1867- tree1.add(from_paths_and_ids, [p.encode('utf-8')
1868+ tree1.add(from_paths_and_ids, ids=[p.encode('utf-8')
1869 for p in from_paths_and_ids])
1870- tree2.add(to_paths_and_ids, [p.encode('utf-8')
1871+ tree2.add(to_paths_and_ids, ids=[p.encode('utf-8')
1872 for p in to_paths_and_ids])
1873 return self.mutable_trees_to_locked_test_trees(tree1, tree2)
1874
1875@@ -1524,8 +1524,8 @@
1876 'tree1/b/d/', 'tree1/b/d/e', 'tree1/f/', 'tree1/f/g',
1877 'tree2/a', 'tree2/f/', 'tree2/f/g'])
1878 tree1.add(['a', 'b', 'b/c', 'b/d/', 'b/d/e', 'f', 'f/g'],
1879- [b'a-id', b'b-id', b'c-id', b'd-id', b'e-id', b'f-id', b'g-id'])
1880- tree2.add(['a', 'f', 'f/g'], [b'a-id', b'f-id', b'g-id'])
1881+ ids=[b'a-id', b'b-id', b'c-id', b'd-id', b'e-id', b'f-id', b'g-id'])
1882+ tree2.add(['a', 'f', 'f/g'], ids=[b'a-id', b'f-id', b'g-id'])
1883
1884 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1885 # We should notice that 'b' and all its children are deleted
1886@@ -1559,8 +1559,8 @@
1887 ])
1888 except UnicodeError:
1889 raise tests.TestSkipped("Could not create Unicode files.")
1890- tree1.add([u'\u03b1'], [a_id])
1891- tree2.add([u'\u03b1', u'\u03b1/\u03c9-added'], [a_id, added_id])
1892+ tree1.add([u'\u03b1'], ids=[a_id])
1893+ tree2.add([u'\u03b1', u'\u03b1/\u03c9-added'], ids=[a_id, added_id])
1894
1895 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1896
1897@@ -1589,8 +1589,8 @@
1898 ])
1899 except UnicodeError:
1900 raise tests.TestSkipped("Could not create Unicode files.")
1901- tree1.add([u'\u03b1', u'\u03b1/\u03c9-deleted'], [a_id, deleted_id])
1902- tree2.add([u'\u03b1'], [a_id])
1903+ tree1.add([u'\u03b1', u'\u03b1/\u03c9-deleted'], ids=[a_id, deleted_id])
1904+ tree2.add([u'\u03b1'], ids=[a_id])
1905
1906 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1907
1908@@ -1620,8 +1620,8 @@
1909 ])
1910 except UnicodeError:
1911 raise tests.TestSkipped("Could not create Unicode files.")
1912- tree1.add([u'\u03b1', mod_path], [a_id, mod_id])
1913- tree2.add([u'\u03b1', mod_path], [a_id, mod_id])
1914+ tree1.add([u'\u03b1', mod_path], ids=[a_id, mod_id])
1915+ tree2.add([u'\u03b1', mod_path], ids=[a_id, mod_id])
1916
1917 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1918
1919@@ -1651,8 +1651,8 @@
1920 self.build_tree_contents([(u'tree1/\u03c9-source', b'contents\n'),
1921 (u'tree2/\u03b1/\u03c9-target', b'contents\n'),
1922 ])
1923- tree1.add([u'\u03b1', u'\u03c9-source'], [a_id, rename_id])
1924- tree2.add([u'\u03b1', u'\u03b1/\u03c9-target'], [a_id, rename_id])
1925+ tree1.add([u'\u03b1', u'\u03c9-source'], ids=[a_id, rename_id])
1926+ tree2.add([u'\u03b1', u'\u03b1/\u03c9-target'], ids=[a_id, rename_id])
1927
1928 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1929
1930@@ -1685,9 +1685,9 @@
1931 (u'tree2/\u03c9-rootfile', b'root contents\n'),
1932 ])
1933 tree1.add([u'\u03b1', u'\u03b1/\u03c9-subfile', u'\u03c9-rootfile'],
1934- [a_id, subfile_id, rootfile_id])
1935+ ids=[a_id, subfile_id, rootfile_id])
1936 tree2.add([u'\u03b1', u'\u03b1/\u03c9-subfile', u'\u03c9-rootfile'],
1937- [a_id, subfile_id, rootfile_id])
1938+ ids=[a_id, subfile_id, rootfile_id])
1939
1940 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1941
1942@@ -1727,8 +1727,8 @@
1943 ])
1944 except UnicodeError:
1945 raise tests.TestSkipped("Could not create Unicode files.")
1946- tree1.add([u'\u03b1'], [a_id])
1947- tree2.add([u'\u03b1'], [a_id])
1948+ tree1.add([u'\u03b1'], ids=[a_id])
1949+ tree2.add([u'\u03b1'], ids=[a_id])
1950
1951 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1952 self.not_applicable_if_cannot_represent_unversioned(tree2)
1953@@ -1774,8 +1774,8 @@
1954 'tree2/a/', 'tree2/b/'])
1955 self.build_tree_contents([('tree1/b/file', b'contents\n'),
1956 ('tree2/b/file', b'contents\n')])
1957- tree1.add(['a', 'b', 'b/file'], [b'a-id', b'b-id', b'b-file-id'])
1958- tree2.add(['a', 'b', 'b/file'], [b'a-id', b'b-id', b'b-file-id'])
1959+ tree1.add(['a', 'b', 'b/file'], ids=[b'a-id', b'b-id', b'b-file-id'])
1960+ tree2.add(['a', 'b', 'b/file'], ids=[b'a-id', b'b-id', b'b-file-id'])
1961
1962 # Now create some unknowns in tree2
1963 # We should find both a/file and a/dir as unknown, but we shouldn't
1964@@ -1826,8 +1826,8 @@
1965 ('tree2/a', b'b contents\n'),
1966 ('tree2/d', b'c contents\n'),
1967 ])
1968- tree1.add(['a', 'b', 'c', 'd'], [b'a-id', b'b-id', b'c-id', b'd-id'])
1969- tree2.add(['a', 'd'], [b'b-id', b'c-id'])
1970+ tree1.add(['a', 'b', 'c', 'd'], ids=[b'a-id', b'b-id', b'c-id', b'd-id'])
1971+ tree2.add(['a', 'd'], ids=[b'b-id', b'c-id'])
1972
1973 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1974
1975@@ -1859,8 +1859,8 @@
1976 ('tree2/b', b'b contents\n'),
1977 ('tree2/c', b'c contents\n'),
1978 ])
1979- tree1.add(['a', 'b', 'c'], [b'a-id', b'b-id', b'c-id'])
1980- tree2.add(['a', 'c'], [b'a-id', b'c-id'])
1981+ tree1.add(['a', 'b', 'c'], ids=[b'a-id', b'b-id', b'c-id'])
1982+ tree2.add(['a', 'c'], ids=[b'a-id', b'c-id'])
1983
1984 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1985 self.not_applicable_if_cannot_represent_unversioned(tree2)
1986@@ -1900,8 +1900,8 @@
1987 ('tree2/c', b'new c contents\n'),
1988 ('tree2/d', b'c contents\n'),
1989 ])
1990- tree1.add(['b', 'c'], [b'b1-id', b'c1-id'])
1991- tree2.add(['a', 'b', 'c', 'd'], [
1992+ tree1.add(['b', 'c'], ids=[b'b1-id', b'c1-id'])
1993+ tree2.add(['a', 'b', 'c', 'd'], ids=[
1994 b'b1-id', b'b2-id', b'c2-id', b'c1-id'])
1995
1996 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
1997@@ -1933,8 +1933,8 @@
1998 ('tree2/a', b'a contents\n'),
1999 ('tree2/b', b'b contents\n'),
2000 ])
2001- tree1.add(['a', 'b'], [b'a-id', b'b-id'])
2002- tree2.add(['a', 'b'], [b'a-id', b'b-id'])
2003+ tree1.add(['a', 'b'], ids=[b'a-id', b'b-id'])
2004+ tree2.add(['a', 'b'], ids=[b'a-id', b'b-id'])
2005 os.rename('tree2/a', 'tree2/a2')
2006
2007 tree1, tree2 = self.mutable_trees_to_locked_test_trees(tree1, tree2)
2008
2009=== modified file 'breezy/tests/per_intertree/test_file_content_matches.py'
2010--- breezy/tests/per_intertree/test_file_content_matches.py 2018-10-29 11:27:33 +0000
2011+++ breezy/tests/per_intertree/test_file_content_matches.py 2022-07-02 16:16:10 +0000
2012@@ -28,8 +28,8 @@
2013 ('1/file', b'apples'),
2014 ('2/file', b'apples'),
2015 ])
2016- tree1.add('file', b'file-id-1')
2017- tree2.add('file', b'file-id-2')
2018+ tree1.add('file', ids=b'file-id-1')
2019+ tree2.add('file', ids=b'file-id-2')
2020 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
2021 inter = self.intertree_class(tree1, tree2)
2022 self.assertTrue(inter.file_content_matches('file', 'file'))
2023@@ -41,8 +41,8 @@
2024 ('1/file', b'apples'),
2025 ('2/file', b'oranges'),
2026 ])
2027- tree1.add('file', b'file-id-1')
2028- tree2.add('file', b'file-id-2')
2029+ tree1.add('file', ids=b'file-id-1')
2030+ tree2.add('file', ids=b'file-id-2')
2031 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
2032 inter = self.intertree_class(tree1, tree2)
2033 self.assertFalse(inter.file_content_matches(
2034
2035=== modified file 'breezy/tests/per_repository/test_repository.py'
2036--- breezy/tests/per_repository/test_repository.py 2021-11-13 21:30:35 +0000
2037+++ breezy/tests/per_repository/test_repository.py 2022-07-02 16:16:10 +0000
2038@@ -963,7 +963,7 @@
2039 self.skip("format does not support setting file ids")
2040 self.build_tree(["repo/foo"], line_endings='binary')
2041 # add file with id containing wierd characters
2042- wt.add(['foo'], [FOO_ID])
2043+ wt.add(['foo'], ids=[FOO_ID])
2044 rev1 = wt.commit('this is my new commit')
2045 # now access over vfat; should be safe
2046 branch = controldir.ControlDir.open(self.get_url('repo')).open_branch()
2047
2048=== modified file 'breezy/tests/per_repository_reference/test_check.py'
2049--- breezy/tests/per_repository_reference/test_check.py 2018-02-18 15:21:06 +0000
2050+++ breezy/tests/per_repository_reference/test_check.py 2022-07-02 16:16:10 +0000
2051@@ -27,7 +27,7 @@
2052 def test_check_file_graph_across_external_boundary_ok(self):
2053 tree = self.make_branch_and_tree('base')
2054 self.build_tree(['base/file'])
2055- tree.add(['file'], [b'file-id'])
2056+ tree.add(['file'], ids=[b'file-id'])
2057 rev1_id = tree.commit('one')
2058 referring = self.make_branch_and_tree('referring')
2059 readonly_base = self.readonly_repository(tree.branch.repository)
2060
2061=== modified file 'breezy/tests/per_repository_reference/test_commit_with_stacking.py'
2062--- breezy/tests/per_repository_reference/test_commit_with_stacking.py 2018-11-11 04:08:32 +0000
2063+++ breezy/tests/per_repository_reference/test_commit_with_stacking.py 2022-07-02 16:16:10 +0000
2064@@ -34,10 +34,10 @@
2065 def make_stacked_target(self):
2066 base_tree = self.make_branch_and_tree('base')
2067 self.build_tree(['base/f1.txt'])
2068- base_tree.add(['f1.txt'], [b'f1.txt-id'])
2069+ base_tree.add(['f1.txt'], ids=[b'f1.txt-id'])
2070 base_tree.commit('initial', rev_id=self.r1_key[0])
2071 self.build_tree(['base/f2.txt'])
2072- base_tree.add(['f2.txt'], [b'f2.txt-id'])
2073+ base_tree.add(['f2.txt'], ids=[b'f2.txt-id'])
2074 base_tree.commit('base adds f2', rev_id=self.r2_key[0])
2075 stacked_url = urlutils.join(base_tree.branch.base, '../stacked')
2076 stacked_bzrdir = base_tree.controldir.sprout(stacked_url,
2077@@ -105,7 +105,7 @@
2078 to_be_merged_tree = base_tree.controldir.sprout('merged'
2079 ).open_workingtree()
2080 self.build_tree(['merged/f2.txt'])
2081- to_be_merged_tree.add(['f2.txt'], [b'f2.txt-id'])
2082+ to_be_merged_tree.add(['f2.txt'], ids=[b'f2.txt-id'])
2083 to_merge_key = (b'to-merge-rev-id',)
2084 to_be_merged_tree.commit('new-to-be-merged', rev_id=to_merge_key[0])
2085 stacked_tree.merge_from_branch(to_be_merged_tree.branch)
2086@@ -145,7 +145,7 @@
2087 """base + stacked + stacked-on-stacked"""
2088 base_tree, stacked_tree = self.make_stacked_target()
2089 self.build_tree(['stacked/f3.txt'])
2090- stacked_tree.add(['f3.txt'], [b'f3.txt-id'])
2091+ stacked_tree.add(['f3.txt'], ids=[b'f3.txt-id'])
2092 stacked_key = (b'stacked-rev-id',)
2093 stacked_tree.commit('add f3', rev_id=stacked_key[0])
2094 stacked_only_repo = self.get_only_repo(stacked_tree)
2095@@ -168,7 +168,7 @@
2096 stacked2_only_repo = self.get_only_repo(stacked2_tree)
2097 self.assertPresent([], stacked2_only_repo.inventories,
2098 [self.r1_key, self.r2_key])
2099- stacked2_tree.add(['f3.txt'], [b'f3.txt-id'])
2100+ stacked2_tree.add(['f3.txt'], ids=[b'f3.txt-id'])
2101 stacked2_tree.commit('add f3', rev_id=b'stacked2-rev-id')
2102 # We added data to this read-locked repo, so refresh it
2103 stacked2_only_repo.refresh_data()
2104@@ -190,7 +190,7 @@
2105 to_be_merged_tree = base_tree.controldir.sprout('merged'
2106 ).open_workingtree()
2107 self.build_tree(['merged/f2.txt'])
2108- to_be_merged_tree.add(['f2.txt'], [b'f2.txt-id'])
2109+ to_be_merged_tree.add(['f2.txt'], ids=[b'f2.txt-id'])
2110 ghost_key = (b'ghost-rev-id',)
2111 to_be_merged_tree.set_parent_ids([r3_key[0], ghost_key[0]])
2112 to_merge_key = (b'to-merge-rev-id',)
2113
2114=== modified file 'breezy/tests/per_tree/test_ids.py'
2115--- breezy/tests/per_tree/test_ids.py 2020-01-19 13:47:29 +0000
2116+++ breezy/tests/per_tree/test_ids.py 2022-07-02 16:16:10 +0000
2117@@ -30,7 +30,7 @@
2118 self.skipTest("working tree does not support setting file ids")
2119 self.build_tree(['wta/bla', 'wta/dir/', 'wta/dir/file'])
2120 work_a.add(['bla', 'dir', 'dir/file'],
2121- [b'bla-id', b'dir-id', b'file-id'])
2122+ ids=[b'bla-id', b'dir-id', b'file-id'])
2123 work_a.commit('add files')
2124 self.tree_a = self.workingtree_to_test_tree(work_a)
2125
2126
2127=== modified file 'breezy/tests/per_tree/test_test_trees.py'
2128--- breezy/tests/per_tree/test_test_trees.py 2021-12-25 12:35:22 +0000
2129+++ breezy/tests/per_tree/test_test_trees.py 2022-07-02 16:16:10 +0000
2130@@ -319,12 +319,12 @@
2131 self.build_tree(paths[1:])
2132 if not tree.is_versioned(''):
2133 # Some trees do not have a root yet.
2134- tree.add(paths, file_ids)
2135+ tree.add(paths, ids=file_ids)
2136 else:
2137 # Some trees will already have a root
2138 if tree.supports_setting_file_ids():
2139 tree.set_root_id(file_ids[0])
2140- tree.add(paths[1:], file_ids[1:])
2141+ tree.add(paths[1:], ids=file_ids[1:])
2142 else:
2143 tree.add(paths[1:])
2144 if tree.branch.repository._format.supports_setting_revision_ids:
2145@@ -392,7 +392,7 @@
2146 self.build_tree([u'tree2/ba\N{Euro Sign}r/qu\N{Euro Sign}x'])
2147 if wt.supports_setting_file_ids():
2148 tree2.add([u'ba\N{Euro Sign}r/qu\N{Euro Sign}x'],
2149- [u'qu\N{Euro Sign}x-id'.encode('utf-8')])
2150+ ids=[u'qu\N{Euro Sign}x-id'.encode('utf-8')])
2151 else:
2152 tree2.add([u'ba\N{Euro Sign}r/qu\N{Euro Sign}x'])
2153 if wt.branch.repository._format.supports_setting_revision_ids:
2154
2155=== modified file 'breezy/tests/per_tree/test_transform.py'
2156--- breezy/tests/per_tree/test_transform.py 2021-12-25 12:35:22 +0000
2157+++ breezy/tests/per_tree/test_transform.py 2022-07-02 16:16:10 +0000
2158@@ -265,7 +265,7 @@
2159 'format does not support setting file ids')
2160 tree = self.make_branch_and_tree('tree')
2161 self.build_tree(['tree/a', 'tree/b', 'tree/c'])
2162- tree.add(['a', 'b', 'c'], [b'a-id', b'b-id', b'c-id'])
2163+ tree.add(['a', 'b', 'c'], ids=[b'a-id', b'b-id', b'c-id'])
2164 preview = tree.preview_transform()
2165 self.addCleanup(preview.finalize)
2166 preview.unversion_file(preview.trans_id_file_id(b'b-id'))
2167
2168=== modified file 'breezy/tests/per_workingtree/test_add.py'
2169--- breezy/tests/per_workingtree/test_add.py 2020-06-25 21:17:44 +0000
2170+++ breezy/tests/per_workingtree/test_add.py 2022-07-02 16:16:10 +0000
2171@@ -51,7 +51,7 @@
2172 self.build_tree(['a', 'b'])
2173 tree.add(['a'])
2174 self.assertRaises(
2175- inventory.DuplicateFileId, tree.add, ['b'], [tree.path2id('a')])
2176+ inventory.DuplicateFileId, tree.add, ['b'], ids=[tree.path2id('a')])
2177 # And the entry should not have been added.
2178 self.assertTreeLayout(['', 'a'], tree)
2179
2180@@ -66,7 +66,7 @@
2181 tree.commit('first')
2182 # And the entry should not have been added.
2183 tree.unversion(['a'])
2184- tree.add(['b'], [file_id])
2185+ tree.add(['b'], ids=[file_id])
2186 self.assertPathRelations(
2187 tree.basis_tree(), tree,
2188 [('', ''), ('b', 'a')])
2189@@ -100,9 +100,9 @@
2190 if not tree.supports_setting_file_ids():
2191 self.skipTest("tree does not support setting file ids")
2192 self.build_tree(['dir/', 'dir/subdir/', 'dir/subdir/foo'])
2193- tree.add(['dir'], [b'dir-id'])
2194- tree.add(['dir/subdir'], [b'subdir-id'])
2195- tree.add(['dir/subdir/foo'], [b'foo-id'])
2196+ tree.add(['dir'], ids=[b'dir-id'])
2197+ tree.add(['dir/subdir'], ids=[b'subdir-id'])
2198+ tree.add(['dir/subdir/foo'], ids=[b'foo-id'])
2199 root_id = tree.path2id('')
2200
2201 self.assertTreeLayout([('', root_id), ('dir/', b'dir-id'),
2202@@ -134,7 +134,7 @@
2203 self.skipTest("tree does not support setting file ids")
2204 self.build_tree(['a', 'b', 'dir/', 'dir/subdir/', 'dir/subdir/foo'])
2205 tree.add(['a', 'b', 'dir', 'dir/subdir', 'dir/subdir/foo'],
2206- [b'a-id', b'b-id', b'dir-id', b'subdir-id', b'foo-id'])
2207+ ids=[b'a-id', b'b-id', b'dir-id', b'subdir-id', b'foo-id'])
2208
2209 self.assertTreeLayout([('', tree.path2id('')), ('a', b'a-id'), ('b', b'b-id'),
2210 ('dir/', b'dir-id'), ('dir/subdir/', b'subdir-id'),
2211@@ -189,9 +189,9 @@
2212 if not tree.supports_setting_file_ids():
2213 self.skipTest("tree does not support setting file ids")
2214 self.build_tree(['foo'])
2215- tree.add(['foo'], [b'foo-id'])
2216+ tree.add(['foo'], ids=[b'foo-id'])
2217 tree.unversion(['foo'])
2218- tree.add(['foo'], [b'foo-id'])
2219+ tree.add(['foo'], ids=[b'foo-id'])
2220 self.assertEqual(b'foo-id', tree.path2id('foo'))
2221
2222 def test_add_present_in_basis(self):
2223@@ -210,8 +210,8 @@
2224 if not tree.supports_setting_file_ids():
2225 self.skipTest("tree does not support setting file ids")
2226 self.build_tree(['foo'])
2227- tree.add(['foo'], [b'foo-id'])
2228+ tree.add(['foo'], ids=[b'foo-id'])
2229 tree.commit('add foo')
2230 tree.unversion(['foo'])
2231- tree.add(['foo'], [b'foo-id'])
2232+ tree.add(['foo'], ids=[b'foo-id'])
2233 self.assertEqual(b'foo-id', tree.path2id('foo'))
2234
2235=== modified file 'breezy/tests/per_workingtree/test_commit.py'
2236--- breezy/tests/per_workingtree/test_commit.py 2021-12-25 14:55:24 +0000
2237+++ breezy/tests/per_workingtree/test_commit.py 2022-07-02 16:16:10 +0000
2238@@ -216,7 +216,7 @@
2239
2240 def test_commit_aborted_does_not_apply_automatic_changes_bug_282402(self):
2241 wt = self.make_branch_and_tree('.')
2242- wt.add(['a'], None, ['file'])
2243+ wt.add(['a'], ['file'])
2244 self.assertTrue(wt.is_versioned('a'))
2245 if wt.supports_setting_file_ids():
2246 a_id = wt.path2id('a')
2247
2248=== modified file 'breezy/tests/per_workingtree/test_inv.py'
2249--- breezy/tests/per_workingtree/test_inv.py 2019-06-29 13:16:26 +0000
2250+++ breezy/tests/per_workingtree/test_inv.py 2022-07-02 16:16:10 +0000
2251@@ -66,7 +66,7 @@
2252 wt.lock_write()
2253 self.addCleanup(wt.unlock)
2254 self.build_tree(['foo/', 'foo/bar'])
2255- wt.add(['foo', 'foo/bar'], [b'foo-id', b'bar-id'])
2256+ wt.add(['foo', 'foo/bar'], ids=[b'foo-id', b'bar-id'])
2257 wt.apply_inventory_delta([('foo', None, b'foo-id', None),
2258 ('foo/bar', None, b'bar-id', None)])
2259 self.assertFalse(wt.is_versioned('foo'))
2260@@ -78,7 +78,7 @@
2261 self.addCleanup(wt.unlock)
2262 self.build_tree(['foo/', 'foo/bar'])
2263 wt.add(['foo', 'foo/bar'],
2264- [b'foo-id', b'bar-id'])
2265+ ids=[b'foo-id', b'bar-id'])
2266 wt.apply_inventory_delta([('foo', 'baz', b'foo-id',
2267 inventory.InventoryDirectory(b'foo-id', 'baz', root_id))])
2268 # foo/bar should have been followed the rename of its parent to baz/bar
2269@@ -92,7 +92,7 @@
2270 self.addCleanup(wt.unlock)
2271 self.build_tree(['foo/', 'foo/bar/', 'foo/bar/baz'])
2272 wt.add(['foo', 'foo/bar', 'foo/bar/baz'],
2273- [b'foo-id', b'bar-id', b'baz-id'])
2274+ ids=[b'foo-id', b'bar-id', b'baz-id'])
2275 wt.apply_inventory_delta([('foo', 'quux', b'foo-id',
2276 inventory.InventoryDirectory(b'foo-id', 'quux', root_id))])
2277 # foo/bar/baz should have been followed the rename of its parent's
2278@@ -105,7 +105,7 @@
2279 self.addCleanup(wt.unlock)
2280 self.build_tree(['foo/', 'foo/bar', 'baz/'])
2281 wt.add(['foo', 'foo/bar', 'baz'],
2282- [b'foo-id', b'bar-id', b'baz-id'])
2283+ ids=[b'foo-id', b'bar-id', b'baz-id'])
2284 wt.apply_inventory_delta([('foo/bar', 'baz/bar', b'bar-id',
2285 inventory.InventoryFile(b'bar-id', 'bar', b'baz-id'))])
2286 self.assertEqual('baz/bar', wt.id2path(b'bar-id'))
2287@@ -122,7 +122,7 @@
2288 self.addCleanup(wt.unlock)
2289 self.build_tree(['foo/', 'foo/bar', 'baz/', 'baz/qux'])
2290 wt.add(['foo', 'foo/bar', 'baz', 'baz/qux'],
2291- [b'foo-id', b'bar-id', b'baz-id', b'qux-id'])
2292+ ids=[b'foo-id', b'bar-id', b'baz-id', b'qux-id'])
2293 wt.apply_inventory_delta([('foo', 'baz', b'foo-id',
2294 inventory.InventoryDirectory(b'foo-id', 'baz', root_id)),
2295 ('baz', 'foo', b'baz-id',
2296@@ -140,7 +140,7 @@
2297 root_id = wt.path2id('')
2298 self.build_tree(['dir/', 'dir/child', 'other/'])
2299 wt.add(['dir', 'dir/child', 'other'],
2300- [b'dir-id', b'child-id', b'other-id'])
2301+ ids=[b'dir-id', b'child-id', b'other-id'])
2302 # this delta moves dir-id to dir2 and reparents
2303 # child-id to a parent of other-id
2304 wt.apply_inventory_delta([('dir', 'dir2', b'dir-id',
2305@@ -172,13 +172,13 @@
2306 raise tests.TestNotApplicable("wt doesn't support nested trees")
2307 if base.has_versioned_directories():
2308 # We add it as a directory, but it becomes a tree-reference
2309- base.add(['subdir'], [None], ['directory'])
2310+ base.add(['subdir'], ['directory'])
2311 subdir = self.make_branch_and_tree('base/subdir')
2312 else:
2313 subdir = self.make_branch_and_tree('base/subdir')
2314 subdir.commit('')
2315 # We add it as a directory, but it becomes a tree-reference
2316- base.add(['subdir'], [None], ['tree-reference'])
2317+ base.add(['subdir'], ['tree-reference'])
2318 self.addCleanup(base.lock_read().unlock)
2319 # Note: we aren't strict about ie.kind being 'directory' here, what we
2320 # are strict about is that wt.inventory should match
2321
2322=== modified file 'breezy/tests/per_workingtree/test_mkdir.py'
2323--- breezy/tests/per_workingtree/test_mkdir.py 2018-10-29 11:27:33 +0000
2324+++ breezy/tests/per_workingtree/test_mkdir.py 2022-07-02 16:16:10 +0000
2325@@ -37,7 +37,7 @@
2326 self.addCleanup(t.unlock)
2327 if not t.supports_setting_file_ids():
2328 self.assertRaises(
2329- SettingFileIdUnsupported,
2330+ (SettingFileIdUnsupported, TypeError),
2331 t.mkdir, 'path', b'my-id')
2332 else:
2333 file_id = t.mkdir('path', b'my-id')
2334
2335=== modified file 'breezy/tests/per_workingtree/test_paths2ids.py'
2336--- breezy/tests/per_workingtree/test_paths2ids.py 2018-11-11 04:08:32 +0000
2337+++ breezy/tests/per_workingtree/test_paths2ids.py 2022-07-02 16:16:10 +0000
2338@@ -159,18 +159,18 @@
2339 ['tree/dir/', 'tree/dir/child-moves', 'tree/dir/child-stays',
2340 'tree/dir/child-goes'])
2341 tree.add(['dir', 'dir/child-moves', 'dir/child-stays', 'dir/child-goes'],
2342- [b'dir', b'child-moves', b'child-stays', b'child-goes'])
2343+ ids=[b'dir', b'child-moves', b'child-stays', b'child-goes'])
2344 tree.commit('create basis')
2345 basis = tree.basis_tree()
2346 tree.unversion(['dir/child-goes'])
2347 tree.rename_one('dir/child-moves', 'child-moves')
2348 self.build_tree(['tree/newdir/'])
2349- tree.add(['newdir'], [b'newdir'])
2350+ tree.add(['newdir'], ids=[b'newdir'])
2351 tree.rename_one('dir/child-stays', 'child-stays')
2352 tree.rename_one('dir', 'newdir/dir')
2353 tree.rename_one('child-stays', 'newdir/dir/child-stays')
2354 self.build_tree(['tree/newdir/dir/new-child'])
2355- tree.add(['newdir/dir/new-child'], [b'new-child'])
2356+ tree.add(['newdir/dir/new-child'], ids=[b'new-child'])
2357 self.assertExpectedIds(
2358 [b'newdir', b'dir', b'child-moves', b'child-stays', b'child-goes',
2359 b'new-child'], tree, ['newdir'], [basis])
2360@@ -206,7 +206,7 @@
2361 tree.commit('make basis')
2362 basis = tree.basis_tree()
2363 self.build_tree(['tree/in-one'])
2364- tree.add(['in-one'], [b'in-one'])
2365+ tree.add(['in-one'], ids=[b'in-one'])
2366 self.assertExpectedIds([b'in-one'], tree, ['in-one'], [basis])
2367
2368 def test_unversioned_all_of_multiple_trees(self):
2369
2370=== modified file 'breezy/tests/per_workingtree/test_workingtree.py'
2371--- breezy/tests/per_workingtree/test_workingtree.py 2021-12-25 15:47:06 +0000
2372+++ breezy/tests/per_workingtree/test_workingtree.py 2022-07-02 16:16:10 +0000
2373@@ -941,7 +941,7 @@
2374 tree = self.make_branch_and_tree('.')
2375 self.build_tree(['foo'])
2376 if tree.supports_setting_file_ids():
2377- tree.add(['foo'], [b'foo-id'])
2378+ tree.add(['foo'], ids=[b'foo-id'])
2379 self.assertEqual(b'foo-id', tree.path2id('foo'))
2380 # the next assertion is for backwards compatibility with
2381 # WorkingTree3, though its probably a bad idea, it makes things
2382
2383=== modified file 'breezy/tests/test_annotate.py'
2384--- breezy/tests/test_annotate.py 2020-02-07 02:14:30 +0000
2385+++ breezy/tests/test_annotate.py 2022-07-02 16:16:10 +0000
2386@@ -399,13 +399,13 @@
2387 tree1 = self.make_branch_and_tree('tree1')
2388
2389 self.build_tree_contents([('tree1/a', b'adi\xc3\xb3s')])
2390- tree1.add(['a'], [b'a-id'])
2391+ tree1.add(['a'], ids=[b'a-id'])
2392 tree1.commit('a', rev_id=b'rev-1',
2393 committer=u'Pepe P\xe9rez <pperez@ejemplo.com>',
2394 timestamp=1166046000.00, timezone=0)
2395
2396 self.build_tree_contents([('tree1/b', b'bye')])
2397- tree1.add(['b'], [b'b-id'])
2398+ tree1.add(['b'], ids=[b'b-id'])
2399 tree1.commit('b', rev_id=b'rev-2',
2400 committer=u'p\xe9rez',
2401 timestamp=1166046000.00, timezone=0)
2402@@ -437,13 +437,13 @@
2403 tree1 = self.make_branch_and_tree('tree1')
2404
2405 self.build_tree_contents([('tree1/a', b'hello')])
2406- tree1.add(['a'], [b'a-id'])
2407+ tree1.add(['a'], ids=[b'a-id'])
2408 tree1.commit('a', rev_id=b'rev-1',
2409 committer='Committer <committer@example.com>',
2410 timestamp=1166046000.00, timezone=0)
2411
2412 self.build_tree_contents([('tree1/b', b'bye')])
2413- tree1.add(['b'], [b'b-id'])
2414+ tree1.add(['b'], ids=[b'b-id'])
2415 tree1.commit('b', rev_id=b'rev-2',
2416 committer='Committer <committer@example.com>',
2417 authors=['Author <author@example.com>'],
2418
2419=== modified file 'breezy/tests/test_bad_files.py'
2420--- breezy/tests/test_bad_files.py 2020-02-07 02:14:30 +0000
2421+++ breezy/tests/test_bad_files.py 2022-07-02 16:16:10 +0000
2422@@ -50,7 +50,7 @@
2423 files = ['one', 'two', 'three']
2424 file_ids = [b'one-id', b'two-id', b'three-id']
2425 self.build_tree(files)
2426- wt.add(files, file_ids)
2427+ wt.add(files, ids=file_ids)
2428 wt.commit("Commit one", rev_id=b"a@u-0-0")
2429
2430 # We should now have a few files, lets try to
2431
2432=== modified file 'breezy/tests/test_commit.py'
2433--- breezy/tests/test_commit.py 2021-12-25 12:35:22 +0000
2434+++ breezy/tests/test_commit.py 2022-07-02 16:16:10 +0000
2435@@ -162,7 +162,7 @@
2436 b = wt.branch
2437 with open('hello', 'w') as f:
2438 f.write('hello world')
2439- wt.add(['hello'], [b'hello-id'])
2440+ wt.add(['hello'], ids=[b'hello-id'])
2441 wt.commit(message='add hello')
2442
2443 os.remove('hello')
2444@@ -231,7 +231,7 @@
2445 with open('buongia', 'w') as f:
2446 f.write('buongia')
2447 wt.add(['hello', 'buongia'],
2448- [b'hello-id', b'buongia-id'])
2449+ ids=[b'hello-id', b'buongia-id'])
2450 wt.commit(message='add files',
2451 rev_id=b'test@rev-1')
2452
2453@@ -269,7 +269,7 @@
2454 tree = self.make_branch_and_tree('.')
2455 b = tree.branch
2456 self.build_tree(['hello'], line_endings='binary')
2457- tree.add(['hello'], [b'hello-id'])
2458+ tree.add(['hello'], ids=[b'hello-id'])
2459 tree.commit(message='one', rev_id=b'test@rev-1', allow_pointless=False)
2460
2461 tree.rename_one('hello', 'fruity')
2462@@ -312,7 +312,7 @@
2463 b = wt.branch
2464 r1 = b'test@rev-1'
2465 self.build_tree(['hello', 'a/', 'b/'])
2466- wt.add(['hello', 'a', 'b'], [b'hello-id', b'a-id', b'b-id'])
2467+ wt.add(['hello', 'a', 'b'], ids=[b'hello-id', b'a-id', b'b-id'])
2468 wt.commit('initial', rev_id=r1, allow_pointless=False)
2469 wt.move(['hello'], 'a')
2470 r2 = b'test@rev-2'
2471@@ -355,7 +355,7 @@
2472 b = wt.branch
2473 with open('hello', 'w') as f:
2474 f.write('hello world')
2475- wt.add(['hello'], [b'hello-id'])
2476+ wt.add(['hello'], ids=[b'hello-id'])
2477 wt.commit(message='add hello')
2478 wt.remove('hello')
2479 wt.commit('removed hello', rev_id=b'rev2')
2480@@ -372,7 +372,7 @@
2481 with open('hello', 'w') as f:
2482 f.write((str(i) * 4) + '\n')
2483 if i == 0:
2484- wt.add(['hello'], [b'hello-id'])
2485+ wt.add(['hello'], ids=[b'hello-id'])
2486 rev_id = b'test@rev-%d' % (i + 1)
2487 rev_ids.append(rev_id)
2488 wt.commit(message='rev %d' % (i + 1),
2489@@ -386,7 +386,7 @@
2490 b = wt.branch
2491 self.build_tree(['dir/', 'dir/file1', 'dir/file2'])
2492 wt.add(['dir', 'dir/file1', 'dir/file2'],
2493- [b'dirid', b'file1id', b'file2id'])
2494+ ids=[b'dirid', b'file1id', b'file2id'])
2495 wt.commit('dir/file1', specific_files=['dir/file1'], rev_id=b'1')
2496 inv = b.repository.get_inventory(b'1')
2497 self.assertEqual(b'1', inv.get_entry(b'dirid').revision)
2498@@ -709,7 +709,7 @@
2499 self.requireFeature(SymlinkFeature(self.test_dir))
2500 tree = self.make_branch_and_tree('.')
2501 os.symlink('target', 'name')
2502- tree.add('name', b'a-file-id')
2503+ tree.add('name', ids=b'a-file-id')
2504 tree.commit('Added a symlink')
2505 self.assertBasisTreeKind('symlink', tree, 'name')
2506
2507
2508=== modified file 'breezy/tests/test_commit_merge.py'
2509--- breezy/tests/test_commit_merge.py 2021-12-08 18:46:11 +0000
2510+++ breezy/tests/test_commit_merge.py 2022-07-02 16:16:10 +0000
2511@@ -81,8 +81,8 @@
2512
2513 self.build_tree(['x/ecks', 'y/why'])
2514
2515- wtx.add(['ecks'], [b'ecks-id'])
2516- wty.add(['why'], [b'why-id'])
2517+ wtx.add(['ecks'], ids=[b'ecks-id'])
2518+ wty.add(['why'], ids=[b'why-id'])
2519
2520 wtx.commit('commit one', rev_id=b'x@u-0-1', allow_pointless=True)
2521 wty.commit('commit two', rev_id=b'y@u-0-1', allow_pointless=True)
2522
2523=== modified file 'breezy/tests/test_conflicts.py'
2524--- breezy/tests/test_conflicts.py 2022-01-09 13:12:27 +0000
2525+++ breezy/tests/test_conflicts.py 2022-07-02 16:16:10 +0000
2526@@ -76,7 +76,7 @@
2527 ('hello.BASE', b'hello world1'),
2528 ])
2529 os.mkdir('hello.OTHER')
2530- tree.add('hello', b'q')
2531+ tree.add('hello', ids=b'q')
2532 l = conflicts.ConflictList([bzr_conflicts.TextConflict('hello')])
2533 l.remove_files(tree)
2534
2535
2536=== modified file 'breezy/tests/test_delta.py'
2537--- breezy/tests/test_delta.py 2020-08-10 15:00:17 +0000
2538+++ breezy/tests/test_delta.py 2022-07-02 16:16:10 +0000
2539@@ -240,7 +240,7 @@
2540 """Doing a status when a file has changed kind should work"""
2541 tree = self.make_branch_and_tree('.')
2542 self.build_tree(['filename'])
2543- tree.add('filename', b'file-id')
2544+ tree.add('filename', ids=b'file-id')
2545 tree.commit('added filename')
2546 os.unlink('filename')
2547 self.build_tree(['filename/'])
2548@@ -303,7 +303,7 @@
2549 ('branch/dir/',),
2550 ])
2551 wt.add(['f1', 'f2', 'f3', 'f4', 'dir'],
2552- [b'f1-id', b'f2-id', b'f3-id', b'f4-id', b'dir-id'])
2553+ ids=[b'f1-id', b'f2-id', b'f3-id', b'f4-id', b'dir-id'])
2554 wt.commit('commit one', rev_id=b'1')
2555
2556 # TODO add rename,removed,etc. here?
2557
2558=== modified file 'breezy/tests/test_diff.py'
2559--- breezy/tests/test_diff.py 2022-01-12 23:43:40 +0000
2560+++ breezy/tests/test_diff.py 2022-07-02 16:16:10 +0000
2561@@ -481,7 +481,7 @@
2562 """Test when a file is modified."""
2563 tree = self.make_branch_and_tree('tree')
2564 self.build_tree_contents([('tree/file', b'contents\n')])
2565- tree.add(['file'], [b'file-id'])
2566+ tree.add(['file'], ids=[b'file-id'])
2567 tree.commit('one', rev_id=b'rev-1')
2568
2569 self.build_tree_contents([('tree/file', b'new contents\n')])
2570@@ -497,7 +497,7 @@
2571 tree = self.make_branch_and_tree('tree')
2572 self.build_tree(['tree/dir/'])
2573 self.build_tree_contents([('tree/dir/file', b'contents\n')])
2574- tree.add(['dir', 'dir/file'], [b'dir-id', b'file-id'])
2575+ tree.add(['dir', 'dir/file'], ids=[b'dir-id', b'file-id'])
2576 tree.commit('one', rev_id=b'rev-1')
2577
2578 tree.rename_one('dir', 'other')
2579@@ -517,7 +517,7 @@
2580 tree = self.make_branch_and_tree('tree')
2581 self.build_tree(['tree/dir/'])
2582 self.build_tree_contents([('tree/dir/file', b'contents\n')])
2583- tree.add(['dir', 'dir/file'], [b'dir-id', b'file-id'])
2584+ tree.add(['dir', 'dir/file'], ids=[b'dir-id', b'file-id'])
2585 tree.commit('one', rev_id=b'rev-1')
2586
2587 tree.rename_one('dir', 'newdir')
2588@@ -530,7 +530,7 @@
2589 """Test when a file is only renamed."""
2590 tree = self.make_branch_and_tree('tree')
2591 self.build_tree_contents([('tree/file', b'contents\n')])
2592- tree.add(['file'], [b'file-id'])
2593+ tree.add(['file'], ids=[b'file-id'])
2594 tree.commit('one', rev_id=b'rev-1')
2595
2596 tree.rename_one('file', 'newname')
2597@@ -544,7 +544,7 @@
2598 """Test when a file is only renamed."""
2599 tree = self.make_branch_and_tree('tree')
2600 self.build_tree_contents([('tree/file', b'contents\n')])
2601- tree.add(['file'], [b'file-id'])
2602+ tree.add(['file'], ids=[b'file-id'])
2603 tree.commit('one', rev_id=b'rev-1')
2604
2605 tree.rename_one('file', 'newname')
2606@@ -627,18 +627,18 @@
2607
2608 tree = self.make_branch_and_tree('tree')
2609 self.build_tree_contents([('tree/ren_' + alpha, b'contents\n')])
2610- tree.add(['ren_' + alpha], [b'file-id-2'])
2611+ tree.add(['ren_' + alpha], ids=[b'file-id-2'])
2612 self.build_tree_contents([('tree/del_' + alpha, b'contents\n')])
2613- tree.add(['del_' + alpha], [b'file-id-3'])
2614+ tree.add(['del_' + alpha], ids=[b'file-id-3'])
2615 self.build_tree_contents([('tree/mod_' + alpha, b'contents\n')])
2616- tree.add(['mod_' + alpha], [b'file-id-4'])
2617+ tree.add(['mod_' + alpha], ids=[b'file-id-4'])
2618
2619 tree.commit('one', rev_id=b'rev-1')
2620
2621 tree.rename_one('ren_' + alpha, 'ren_' + omega)
2622 tree.remove('del_' + alpha)
2623 self.build_tree_contents([('tree/add_' + alpha, b'contents\n')])
2624- tree.add(['add_' + alpha], [b'file-id'])
2625+ tree.add(['add_' + alpha], ids=[b'file-id'])
2626 self.build_tree_contents([('tree/mod_' + alpha, b'contents_mod\n')])
2627
2628 d = get_diff_as_string(tree.basis_tree(), tree)
2629@@ -717,11 +717,11 @@
2630 self.build_tree_contents([('old-tree/olddir/',),
2631 ('old-tree/olddir/oldfile', b'old\n')])
2632 self.old_tree.add('olddir')
2633- self.old_tree.add('olddir/oldfile', b'file-id')
2634+ self.old_tree.add('olddir/oldfile', ids=b'file-id')
2635 self.build_tree_contents([('new-tree/newdir/',),
2636 ('new-tree/newdir/newfile', b'new\n')])
2637 self.new_tree.add('newdir')
2638- self.new_tree.add('newdir/newfile', b'file-id')
2639+ self.new_tree.add('newdir/newfile', ids=b'file-id')
2640 differ = diff.DiffText(self.old_tree, self.new_tree, BytesIO())
2641 differ.diff_text('olddir/oldfile', None, 'old label', 'new label')
2642 self.assertEqual(
2643@@ -743,8 +743,8 @@
2644 def test_diff_deletion(self):
2645 self.build_tree_contents([('old-tree/file', b'contents'),
2646 ('new-tree/file', b'contents')])
2647- self.old_tree.add('file', b'file-id')
2648- self.new_tree.add('file', b'file-id')
2649+ self.old_tree.add('file', ids=b'file-id')
2650+ self.new_tree.add('file', ids=b'file-id')
2651 os.unlink('new-tree/file')
2652 self.differ.show_diff(None)
2653 self.assertContainsRe(self.differ.to_file.getvalue(), b'-contents')
2654@@ -752,8 +752,8 @@
2655 def test_diff_creation(self):
2656 self.build_tree_contents([('old-tree/file', b'contents'),
2657 ('new-tree/file', b'contents')])
2658- self.old_tree.add('file', b'file-id')
2659- self.new_tree.add('file', b'file-id')
2660+ self.old_tree.add('file', ids=b'file-id')
2661+ self.new_tree.add('file', ids=b'file-id')
2662 os.unlink('old-tree/file')
2663 self.differ.show_diff(None)
2664 self.assertContainsRe(self.differ.to_file.getvalue(), br'\+contents')
2665@@ -778,11 +778,11 @@
2666 self.build_tree_contents([('old-tree/olddir/',),
2667 ('old-tree/olddir/oldfile', b'old\n')])
2668 self.old_tree.add('olddir')
2669- self.old_tree.add('olddir/oldfile', b'file-id')
2670+ self.old_tree.add('olddir/oldfile', ids=b'file-id')
2671 self.build_tree_contents([('new-tree/newdir/',),
2672 ('new-tree/newdir/newfile', b'new\n')])
2673 self.new_tree.add('newdir')
2674- self.new_tree.add('newdir/newfile', b'file-id')
2675+ self.new_tree.add('newdir/newfile', ids=b'file-id')
2676 self.differ.diff('olddir/oldfile', 'newdir/newfile')
2677 self.assertContainsRe(
2678 self.differ.to_file.getvalue(),
2679@@ -794,11 +794,11 @@
2680 self.build_tree_contents([('old-tree/olddir/',),
2681 ('old-tree/olddir/oldfile', b'old\n')])
2682 self.old_tree.add('olddir')
2683- self.old_tree.add('olddir/oldfile', b'file-id')
2684+ self.old_tree.add('olddir/oldfile', ids=b'file-id')
2685 self.build_tree(['new-tree/newdir/'])
2686 os.symlink('new', 'new-tree/newdir/newfile')
2687 self.new_tree.add('newdir')
2688- self.new_tree.add('newdir/newfile', b'file-id')
2689+ self.new_tree.add('newdir/newfile', ids=b'file-id')
2690 self.differ.diff('olddir/oldfile', 'newdir/newfile')
2691 self.assertContainsRe(
2692 self.differ.to_file.getvalue(),
2693@@ -812,7 +812,7 @@
2694
2695 def test_diff_directory(self):
2696 self.build_tree(['new-tree/new-dir/'])
2697- self.new_tree.add('new-dir', b'new-dir-id')
2698+ self.new_tree.add('new-dir', ids=b'new-dir-id')
2699 self.differ.diff(None, 'new-dir')
2700 self.assertEqual(self.differ.to_file.getvalue(), b'')
2701
2702@@ -820,11 +820,11 @@
2703 self.build_tree_contents([('old-tree/olddir/',),
2704 ('old-tree/olddir/oldfile', b'old\n')])
2705 self.old_tree.add('olddir')
2706- self.old_tree.add('olddir/oldfile', b'file-id')
2707+ self.old_tree.add('olddir/oldfile', ids=b'file-id')
2708 self.build_tree_contents([('new-tree/newdir/',),
2709 ('new-tree/newdir/newfile', b'new\n')])
2710 self.new_tree.add('newdir')
2711- self.new_tree.add('newdir/newfile', b'file-id')
2712+ self.new_tree.add('newdir/newfile', ids=b'file-id')
2713
2714 def test_register_diff(self):
2715 self.create_old_new()
2716@@ -956,8 +956,8 @@
2717 tree = self.make_branch_and_tree('tree')
2718 self.build_tree_contents([('tree/oldname', b'oldcontent')])
2719 self.build_tree_contents([('tree/oldname2', b'oldcontent2')])
2720- tree.add('oldname', b'file-id')
2721- tree.add('oldname2', b'file2-id')
2722+ tree.add('oldname', ids=b'file-id')
2723+ tree.add('oldname2', ids=b'file2-id')
2724 # Earliest allowable date on FAT32 filesystems is 1980-01-01
2725 tree.commit('old tree', timestamp=315532800)
2726 tree.rename_one('oldname', 'newname')
2727@@ -1055,7 +1055,7 @@
2728 def test_with_rev_specs(self):
2729 tree = self.make_branch_and_tree('tree')
2730 self.build_tree_contents([('tree/file', b'oldcontent')])
2731- tree.add('file', b'file-id')
2732+ tree.add('file', ids=b'file-id')
2733 tree.commit('old tree', timestamp=0, rev_id=b"old-id")
2734 self.build_tree_contents([('tree/file', b'newcontent')])
2735 tree.commit('new tree', timestamp=0, rev_id=b"new-id")
2736
2737=== modified file 'breezy/tests/test_extract.py'
2738--- breezy/tests/test_extract.py 2019-09-22 12:47:23 +0000
2739+++ breezy/tests/test_extract.py 2022-07-02 16:16:10 +0000
2740@@ -26,7 +26,7 @@
2741 def test_extract(self):
2742 self.build_tree(['a/', 'a/b/', 'a/b/c', 'a/d'])
2743 wt = self.make_branch_and_tree('a', format='rich-root-pack')
2744- wt.add(['b', 'b/c', 'd'], [b'b-id', b'c-id', b'd-id'])
2745+ wt.add(['b', 'b/c', 'd'], ids=[b'b-id', b'c-id', b'd-id'])
2746 wt.commit('added files')
2747 b_wt = wt.extract('b')
2748 self.assertTrue(b_wt.is_versioned(''))
2749@@ -43,7 +43,7 @@
2750 def extract_in_checkout(self, a_branch):
2751 self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d'])
2752 wt = a_branch.create_checkout('a', lightweight=True)
2753- wt.add(['b', 'b/c', 'b/c/d'], [b'b-id', b'c-id', b'd-id'])
2754+ wt.add(['b', 'b/c', 'b/c/d'], ids=[b'b-id', b'c-id', b'd-id'])
2755 wt.commit('added files')
2756 return wt.extract('b')
2757
2758@@ -58,8 +58,7 @@
2759 a_branch = self.make_branch('branch', format='rich-root-pack')
2760 self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d/', 'a/b/c/d/e'])
2761 wt = a_branch.create_checkout('a', lightweight=True)
2762- wt.add(['b', 'b/c', 'b/c/d', 'b/c/d/e/'], [b'b-id', b'c-id', b'd-id',
2763- b'e-id'])
2764+ wt.add(['b', 'b/c', 'b/c/d', 'b/c/d/e/'], ids=[b'b-id', b'c-id', b'd-id', b'e-id'])
2765 wt.commit('added files')
2766 b_wt = wt.extract('b/c/d')
2767 b_branch = branch.Branch.open('branch/b/c/d')
2768
2769=== modified file 'breezy/tests/test_fetch.py'
2770--- breezy/tests/test_fetch.py 2019-06-29 13:16:26 +0000
2771+++ breezy/tests/test_fetch.py 2022-07-02 16:16:10 +0000
2772@@ -224,7 +224,7 @@
2773 wt1 = self.make_branch_and_tree('br1')
2774 br1 = wt1.branch
2775 self.build_tree_contents([('br1/file', b'original contents\n')])
2776- wt1.add('file', b'this-file-id')
2777+ wt1.add('file', ids=b'this-file-id')
2778 wt1.commit(message='rev 1-1', rev_id=b'1-1')
2779 dir_2 = br1.controldir.sprout('br2')
2780 br2 = dir_2.open_branch()
2781@@ -276,7 +276,7 @@
2782 target = self.make_repository('target', format='pack-0.92')
2783 self.build_tree(['source/file'])
2784 tree.set_root_id(b'root-id')
2785- tree.add('file', b'file-id')
2786+ tree.add('file', ids=b'file-id')
2787 tree.commit('one', rev_id=b'rev-one')
2788 source = tree.branch.repository
2789 source.texts = versionedfile.RecordingVersionedFilesDecorator(
2790@@ -316,7 +316,7 @@
2791 target = self.make_repository('target', format='pack-0.92')
2792 self.build_tree(['source/file'])
2793 tree.set_root_id(b'root-id')
2794- tree.add('file', b'file-id')
2795+ tree.add('file', ids=b'file-id')
2796 tree.commit('one', rev_id=b'rev-one')
2797 source = tree.branch.repository
2798 source.texts = versionedfile.RecordingVersionedFilesDecorator(
2799@@ -361,7 +361,7 @@
2800 target = self.make_repository('target', format='pack-0.92')
2801 self.build_tree(['source/file'])
2802 tree.set_root_id(b'root-id')
2803- tree.add('file', b'file-id')
2804+ tree.add('file', ids=b'file-id')
2805 tree.commit('one', rev_id=b'rev-one')
2806 # Hack the KVF for revisions so that it "accidentally" allows a delta
2807 tree.branch.repository.revisions._max_delta_chain = 200
2808
2809=== modified file 'breezy/tests/test_matchers.py'
2810--- breezy/tests/test_matchers.py 2020-06-10 23:47:24 +0000
2811+++ breezy/tests/test_matchers.py 2022-07-02 16:16:10 +0000
2812@@ -116,7 +116,7 @@
2813 def test_match(self):
2814 t = self.make_branch_and_tree('.')
2815 self.build_tree(['a', 'b/', 'b/c'])
2816- t.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
2817+ t.add(['a', 'b', 'b/c'], ids=[b'a-id', b'b-id', b'c-id'])
2818 self.assertThat(t, HasLayout(['', 'a', 'b/', 'b/c']))
2819 self.assertThat(t, HasLayout(
2820 [('', t.path2id('')),
2821@@ -127,7 +127,7 @@
2822 def test_mismatch(self):
2823 t = self.make_branch_and_tree('.')
2824 self.build_tree(['a', 'b/', 'b/c'])
2825- t.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
2826+ t.add(['a', 'b', 'b/c'], ids=[b'a-id', b'b-id', b'c-id'])
2827 mismatch = HasLayout(['a']).match(t)
2828 self.assertIsNot(None, mismatch)
2829 self.assertEqual(
2830@@ -139,7 +139,7 @@
2831 t = self.make_branch_and_tree('.')
2832 t.has_versioned_directories = lambda: False
2833 self.build_tree(['a', 'b/', 'b/c'])
2834- t.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
2835+ t.add(['a', 'b', 'b/c'], ids=[b'a-id', b'b-id', b'c-id'])
2836 self.assertIs(None, HasLayout(['', 'a', 'b/', 'b/c']).match(t))
2837 self.assertIs(None, HasLayout(['', 'a', 'b/', 'b/c', 'd/']).match(t))
2838 mismatch = HasLayout([u'', u'a', u'd/']).match(t)
2839
2840=== modified file 'breezy/tests/test_memorytree.py'
2841--- breezy/tests/test_memorytree.py 2019-09-27 02:48:17 +0000
2842+++ breezy/tests/test_memorytree.py 2022-07-02 16:16:10 +0000
2843@@ -90,8 +90,7 @@
2844 branch = self.make_branch('branch')
2845 tree = MemoryTree.create_on_branch(branch)
2846 with tree.lock_write():
2847- tree.add(['', 'afile', 'adir'], None,
2848- ['directory', 'file', 'directory'])
2849+ tree.add(['', 'afile', 'adir'], ['directory', 'file', 'directory'])
2850 self.assertEqual('afile', tree.id2path(tree.path2id('afile')))
2851 self.assertEqual('adir', tree.id2path(tree.path2id('adir')))
2852 self.assertFalse(tree.has_filename('afile'))
2853@@ -121,13 +120,13 @@
2854 branch = self.make_branch('branch')
2855 tree = MemoryTree.create_on_branch(branch)
2856 with tree.lock_write():
2857- tree.add([''], [b'root-id'], ['directory'])
2858+ tree.add([''], ['directory'], [b'root-id'])
2859 # Unfortunately, the only way to 'mkdir' is to call 'tree.mkdir', but
2860 # that *always* adds the directory as well. So if you want to create a
2861 # file in a subdirectory, you have to split out the 'mkdir()' calls
2862 # from the add and put_file_bytes_non_atomic calls. :(
2863 tree.mkdir('adir', b'dir-id')
2864- tree.add(['adir/afile'], [b'file-id'], ['file'])
2865+ tree.add(['adir/afile'], ids=[b'file-id'], kinds=['file'])
2866 self.assertEqual('adir/afile', tree.id2path(b'file-id'))
2867 self.assertEqual('adir', tree.id2path(b'dir-id'))
2868 tree.put_file_bytes_non_atomic('adir/afile', b'barshoom')
2869@@ -184,7 +183,7 @@
2870 tree = self.make_branch_and_memory_tree('branch')
2871 tree.lock_write()
2872 self.addCleanup(tree.unlock)
2873- tree.add(['', 'foo'], [b'root-id', b'foo-id'], ['directory', 'file'])
2874+ tree.add(['', 'foo'], ['directory', 'file'], [b'root-id', b'foo-id'])
2875 tree.put_file_bytes_non_atomic('foo', b'content\n')
2876 tree.commit('one', rev_id=b'rev-one')
2877 tree.rename_one('foo', 'bar')
2878@@ -207,7 +206,7 @@
2879 self.addCleanup(tree.unlock)
2880 tree.add('')
2881 tree.mkdir('subdir', b'subdir-id')
2882- tree.add('foo', b'foo-id', 'file')
2883+ tree.add('foo', 'file', b'foo-id')
2884 tree.put_file_bytes_non_atomic('foo', b'content\n')
2885 tree.commit('one', rev_id=b'rev-one')
2886
2887
2888=== modified file 'breezy/tests/test_merge.py'
2889--- breezy/tests/test_merge.py 2021-12-27 13:39:30 +0000
2890+++ breezy/tests/test_merge.py 2022-07-02 16:16:10 +0000
2891@@ -205,7 +205,7 @@
2892 def test_rmdir_conflict(self):
2893 tree_a = self.make_branch_and_tree('a')
2894 self.build_tree(['a/b/'])
2895- tree_a.add('b', b'b-id')
2896+ tree_a.add('b', ids=b'b-id')
2897 tree_a.commit('added b')
2898 # basis_tree() is only guaranteed to be valid as long as it is actually
2899 # the basis tree. This mutates the tree after grabbing basis, so go to
2900@@ -274,7 +274,7 @@
2901 def test_merge_kind_change(self):
2902 tree_a = self.make_branch_and_tree('tree_a')
2903 self.build_tree_contents([('tree_a/file', b'content_1')])
2904- tree_a.add('file', b'file-id')
2905+ tree_a.add('file', ids=b'file-id')
2906 tree_a.commit('added file')
2907 tree_b = tree_a.controldir.sprout('tree_b').open_workingtree()
2908 os.unlink('tree_a/file')
2909@@ -463,7 +463,7 @@
2910 def test_make_preview_transform(self):
2911 this_tree = self.make_branch_and_tree('this')
2912 self.build_tree_contents([('this/file', b'1\n')])
2913- this_tree.add('file', b'file-id')
2914+ this_tree.add('file', ids=b'file-id')
2915 this_tree.commit('rev1', rev_id=b'rev1')
2916 other_tree = this_tree.controldir.sprout('other').open_workingtree()
2917 self.build_tree_contents([('this/file', b'1\n2a\n')])
2918@@ -486,7 +486,7 @@
2919 def test_do_merge(self):
2920 this_tree = self.make_branch_and_tree('this')
2921 self.build_tree_contents([('this/file', b'1\n')])
2922- this_tree.add('file', b'file-id')
2923+ this_tree.add('file', ids=b'file-id')
2924 this_tree.commit('rev1', rev_id=b'rev1')
2925 other_tree = this_tree.controldir.sprout('other').open_workingtree()
2926 self.build_tree_contents([('this/file', b'1\n2a\n')])
2927@@ -524,13 +524,13 @@
2928 # Yes, people actually do this. And report bugs if it breaks.
2929 source = self.make_branch_and_tree('source', format='rich-root-pack')
2930 self.build_tree(['source/foo/'])
2931- source.add('foo', b'foo-id')
2932+ source.add('foo', ids=b'foo-id')
2933 source.commit('Add foo')
2934 target = source.controldir.sprout('target').open_workingtree()
2935 subtree = target.extract('foo')
2936 subtree.commit('Delete root')
2937 self.build_tree(['source/bar'])
2938- source.add('bar', b'bar-id')
2939+ source.add('bar', ids=b'bar-id')
2940 source.commit('Add bar')
2941 subtree.merge_from_branch(source.branch)
2942
2943@@ -2313,7 +2313,7 @@
2944 # Have to use a real WT, because BranchBuilder doesn't support exec bit
2945 wt = self.get_wt_from_builder(builder)
2946 os.symlink('bar', 'path/foo')
2947- wt.add(['foo'], [b'foo-id'])
2948+ wt.add(['foo'], ids=[b'foo-id'])
2949 self.assertEqual('bar', wt.get_symlink_target('foo'))
2950 wt.commit('add symlink', rev_id=b'F-id')
2951 # Reset to D, so that we can merge F
2952@@ -2381,7 +2381,7 @@
2953 wt.lock_write()
2954 self.addCleanup(wt.unlock)
2955 os.symlink('bar', 'path/foo')
2956- wt.add(['foo'], [b'foo-id'])
2957+ wt.add(['foo'], ids=[b'foo-id'])
2958 wt.commit('add symlink', rev_id=b'A-id')
2959 os.remove('path/foo')
2960 os.symlink('baz', 'path/foo')
2961@@ -2424,7 +2424,7 @@
2962 wt.lock_write()
2963 self.addCleanup(wt.unlock)
2964 os.symlink('bar', 'path/foo')
2965- wt.add(['foo'], [b'foo-id'])
2966+ wt.add(['foo'], ids=[b'foo-id'])
2967 wt.commit('A add symlink', rev_id=b'A-id')
2968 wt.rename_one('foo', 'barry')
2969 wt.commit('B foo => barry', rev_id=b'B-id')
2970@@ -2480,7 +2480,7 @@
2971 wt.lock_write()
2972 self.addCleanup(wt.unlock)
2973 os.symlink('bar', 'path/foo')
2974- wt.add(['foo'], [b'foo-id'])
2975+ wt.add(['foo'], ids=[b'foo-id'])
2976 wt.commit('add symlink', rev_id=b'A-id')
2977 os.remove('path/foo')
2978 os.symlink('baz', 'path/foo')
2979@@ -2529,7 +2529,7 @@
2980 self.addCleanup(wt.unlock)
2981 wt.commit('base', rev_id=b'A-id')
2982 os.symlink('bar', 'path/foo')
2983- wt.add(['foo'], [b'foo-id'])
2984+ wt.add(['foo'], ids=[b'foo-id'])
2985 wt.commit('add symlink foo => bar', rev_id=b'B-id')
2986 wt.set_last_revision(b'A-id')
2987 wt.branch.set_last_revision_info(1, b'A-id')
2988@@ -2584,7 +2584,7 @@
2989 wt.lock_write()
2990 self.addCleanup(wt.unlock)
2991 os.symlink('bar', 'path/foo')
2992- wt.add(['foo'], [b'foo-id'])
2993+ wt.add(['foo'], ids=[b'foo-id'])
2994 wt.commit('add symlink', rev_id=b'A-id')
2995 os.remove('path/foo')
2996 os.symlink('baz', 'path/foo')
2997@@ -3397,7 +3397,7 @@
2998 super(TestMergeHooks, self).setUp()
2999 self.tree_a = self.make_branch_and_tree('tree_a')
3000 self.build_tree_contents([('tree_a/file', b'content_1')])
3001- self.tree_a.add('file', b'file-id')
3002+ self.tree_a.add('file', ids=b'file-id')
3003 self.tree_a.commit('added file')
3004
3005 self.tree_b = self.tree_a.controldir.sprout(
3006
3007=== modified file 'breezy/tests/test_missing.py'
3008--- breezy/tests/test_missing.py 2019-06-30 12:59:05 +0000
3009+++ breezy/tests/test_missing.py 2022-07-02 16:16:10 +0000
3010@@ -65,13 +65,13 @@
3011 def test_iter_log_revisions(self):
3012 base_tree = self.make_branch_and_tree('base')
3013 self.build_tree(['base/a'])
3014- base_tree.add(['a'], [b'a-id'])
3015+ base_tree.add(['a'], ids=[b'a-id'])
3016 base_tree.commit('add a', rev_id=b'b-1')
3017
3018 child_tree = base_tree.controldir.sprout('child').open_workingtree()
3019
3020 self.build_tree(['child/b'])
3021- child_tree.add(['b'], [b'b-id'])
3022+ child_tree.add(['b'], ids=[b'b-id'])
3023 child_tree.commit('adding b', rev_id=b'c-2')
3024
3025 child_tree.remove(['a'])
3026
3027=== modified file 'breezy/tests/test_multiwalker.py'
3028--- breezy/tests/test_multiwalker.py 2019-06-02 18:43:25 +0000
3029+++ breezy/tests/test_multiwalker.py 2022-07-02 16:16:10 +0000
3030@@ -50,7 +50,7 @@
3031 def test__step_one(self):
3032 tree = self.make_branch_and_tree('tree')
3033 self.build_tree(['tree/a', 'tree/b/', 'tree/b/c'])
3034- tree.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
3035+ tree.add(['a', 'b', 'b/c'], ids=[b'a-id', b'b-id', b'c-id'])
3036
3037 iterator = tree.iter_entries_by_dir()
3038 tree.lock_read()
3039@@ -114,7 +114,7 @@
3040 def test_simple_stepping(self):
3041 tree = self.make_branch_and_tree('tree')
3042 self.build_tree(['tree/a', 'tree/b/', 'tree/b/c'])
3043- tree.add(['a', 'b', 'b/c'], [b'a-id', b'b-id', b'c-id'])
3044+ tree.add(['a', 'b', 'b/c'], ids=[b'a-id', b'b-id', b'c-id'])
3045
3046 tree.commit('first', rev_id=b'first-rev-id')
3047
3048@@ -131,11 +131,11 @@
3049 def test_master_has_extra(self):
3050 tree = self.make_branch_and_tree('tree')
3051 self.build_tree(['tree/a', 'tree/b/', 'tree/c', 'tree/d'])
3052- tree.add(['a', 'b', 'd'], [b'a-id', b'b-id', b'd-id'])
3053+ tree.add(['a', 'b', 'd'], ids=[b'a-id', b'b-id', b'd-id'])
3054
3055 tree.commit('first', rev_id=b'first-rev-id')
3056
3057- tree.add(['c'], [b'c-id'])
3058+ tree.add(['c'], ids=[b'c-id'])
3059 basis_tree, root_id = self.lock_and_get_basis_and_root_id(tree)
3060
3061 walker = multiwalker.MultiWalker(tree, [basis_tree])
3062@@ -151,7 +151,7 @@
3063 """The record is still present, it just shows up early."""
3064 tree = self.make_branch_and_tree('tree')
3065 self.build_tree(['tree/a', 'tree/c', 'tree/d'])
3066- tree.add(['a', 'c', 'd'], [b'a-id', b'c-id', b'd-id'])
3067+ tree.add(['a', 'c', 'd'], ids=[b'a-id', b'c-id', b'd-id'])
3068 tree.commit('first', rev_id=b'first-rev-id')
3069 tree.rename_one('d', 'b')
3070
3071@@ -168,7 +168,7 @@
3072 def test_master_renamed_to_later(self):
3073 tree = self.make_branch_and_tree('tree')
3074 self.build_tree(['tree/a', 'tree/b', 'tree/d'])
3075- tree.add(['a', 'b', 'd'], [b'a-id', b'b-id', b'd-id'])
3076+ tree.add(['a', 'b', 'd'], ids=[b'a-id', b'b-id', b'd-id'])
3077 tree.commit('first', rev_id=b'first-rev-id')
3078 tree.rename_one('b', 'e')
3079
3080@@ -185,7 +185,7 @@
3081 def test_other_extra_in_middle(self):
3082 tree = self.make_branch_and_tree('tree')
3083 self.build_tree(['tree/a', 'tree/b', 'tree/d'])
3084- tree.add(['a', 'b', 'd'], [b'a-id', b'b-id', b'd-id'])
3085+ tree.add(['a', 'b', 'd'], ids=[b'a-id', b'b-id', b'd-id'])
3086 tree.commit('first', rev_id=b'first-rev-id')
3087 tree.remove(['b'])
3088
3089@@ -201,7 +201,7 @@
3090 def test_other_extra_at_end(self):
3091 tree = self.make_branch_and_tree('tree')
3092 self.build_tree(['tree/a', 'tree/b', 'tree/d'])
3093- tree.add(['a', 'b', 'd'], [b'a-id', b'b-id', b'd-id'])
3094+ tree.add(['a', 'b', 'd'], ids=[b'a-id', b'b-id', b'd-id'])
3095 tree.commit('first', rev_id=b'first-rev-id')
3096 tree.remove(['d'])
3097
3098@@ -218,7 +218,7 @@
3099 tree = self.make_branch_and_tree('tree')
3100 self.build_tree(['tree/a', 'tree/b', 'tree/c', 'tree/d', 'tree/e'])
3101 tree.add(['a', 'b', 'c', 'd', 'e'],
3102- [b'a-id', b'b-id', b'c-id', b'd-id', b'e-id'])
3103+ ids=[b'a-id', b'b-id', b'c-id', b'd-id', b'e-id'])
3104 tree.commit('first', rev_id=b'first-rev-id')
3105 tree.remove(['e'])
3106 tree.commit('second', rev_id=b'second-rev-id')
3107@@ -248,17 +248,17 @@
3108 def test_different_file_id_in_others(self):
3109 tree = self.make_branch_and_tree('tree')
3110 self.build_tree(['tree/a', 'tree/b', 'tree/c/'])
3111- tree.add(['a', 'b', 'c'], [b'a-id', b'b-id', b'c-id'])
3112+ tree.add(['a', 'b', 'c'], ids=[b'a-id', b'b-id', b'c-id'])
3113 tree.commit('first', rev_id=b'first-rev-id')
3114
3115 tree.rename_one('b', 'c/d')
3116 self.build_tree(['tree/b'])
3117- tree.add(['b'], [b'b2-id'])
3118+ tree.add(['b'], ids=[b'b2-id'])
3119 tree.commit('second', rev_id=b'second-rev-id')
3120
3121 tree.rename_one('a', 'c/e')
3122 self.build_tree(['tree/a'])
3123- tree.add(['a'], [b'a2-id'])
3124+ tree.add(['a'], ids=[b'a2-id'])
3125
3126 basis_tree, root_id = self.lock_and_get_basis_and_root_id(tree)
3127 first_tree = tree.branch.repository.revision_tree(b'first-rev-id')
3128
3129=== modified file 'breezy/tests/test_nonascii.py'
3130--- breezy/tests/test_nonascii.py 2018-11-11 04:08:32 +0000
3131+++ breezy/tests/test_nonascii.py 2022-07-02 16:16:10 +0000
3132@@ -37,7 +37,7 @@
3133 return
3134 with open(pathjoin(br_dir, "a"), "w") as f:
3135 f.write("hello")
3136- wt.add(["a"], [b"a-id"])
3137+ wt.add(["a"], ids=[b"a-id"])
3138
3139
3140 a_circle_c = u'\xe5'
3141
3142=== modified file 'breezy/tests/test_permissions.py'
3143--- breezy/tests/test_permissions.py 2018-11-11 04:08:32 +0000
3144+++ breezy/tests/test_permissions.py 2022-07-02 16:16:10 +0000
3145@@ -86,7 +86,7 @@
3146 with open('a', 'wb') as f:
3147 f.write(b'foo\n')
3148 # ensure check_mode_r works with capital-letter file-ids like TREE_ROOT
3149- t.add('a', b'CAPS-ID')
3150+ t.add('a', ids=b'CAPS-ID')
3151 t.commit('foo')
3152
3153 chmod_r('.bzr', 0o644, 0o755)
3154
3155=== modified file 'breezy/tests/test_rename_map.py'
3156--- breezy/tests/test_rename_map.py 2018-11-11 04:08:32 +0000
3157+++ breezy/tests/test_rename_map.py 2022-07-02 16:16:10 +0000
3158@@ -42,7 +42,7 @@
3159 def test_add_file_edge_hashes(self):
3160 tree = self.make_branch_and_tree('tree')
3161 self.build_tree_contents([('tree/a', b''.join(self.a_lines))])
3162- tree.add('a', b'a')
3163+ tree.add('a', ids=b'a')
3164 rn = RenameMap(tree)
3165 rn.add_file_edge_hashes(tree, [b'a'])
3166 self.assertEqual({b'a'}, rn.edge_hashes[myhash(('a\n', 'b\n'))])
3167@@ -113,7 +113,7 @@
3168 tree.lock_write()
3169 self.addCleanup(tree.unlock)
3170 self.build_tree(['tree/file'])
3171- tree.add('file', b'file-id')
3172+ tree.add('file', ids=b'file-id')
3173 tree.commit('Added file')
3174 os.rename('tree/file', 'tree/file2')
3175 RenameMap.guess_renames(tree.basis_tree(), tree)
3176@@ -124,7 +124,7 @@
3177 tree.lock_write()
3178 self.addCleanup(tree.unlock)
3179 self.build_tree(['tree/dir/', 'tree/dir/file'])
3180- tree.add(['dir', 'dir/file'], [b'dir-id', b'file-id'])
3181+ tree.add(['dir', 'dir/file'], ids=[b'dir-id', b'file-id'])
3182 tree.commit('Added file')
3183 os.rename('tree/dir', 'tree/dir2')
3184 RenameMap.guess_renames(tree.basis_tree(), tree)
3185@@ -139,7 +139,7 @@
3186 'tree/topdir/middledir/',
3187 'tree/topdir/middledir/file'])
3188 tree.add(['topdir', 'topdir/middledir', 'topdir/middledir/file'],
3189- [b'topdir-id', b'middledir-id', b'file-id'])
3190+ ids=[b'topdir-id', b'middledir-id', b'file-id'])
3191 tree.commit('Added files.')
3192 os.rename('tree/topdir', 'tree/topdir2')
3193 RenameMap.guess_renames(tree.basis_tree(), tree)
3194@@ -154,7 +154,7 @@
3195 ('tree/foo/bar', b'bar'),
3196 ('tree/foo/empty', b'')])
3197 tree.add(['foo', 'foo/bar', 'foo/empty'],
3198- [b'foo-id', b'bar-id', b'empty-id'])
3199+ ids=[b'foo-id', b'bar-id', b'empty-id'])
3200 tree.commit('rev1')
3201 os.rename('tree/foo', 'tree/baz')
3202 RenameMap.guess_renames(tree.basis_tree(), tree)
3203@@ -165,7 +165,7 @@
3204 tree.lock_write()
3205 self.addCleanup(tree.unlock)
3206 self.build_tree(['tree/file'])
3207- tree.add('file', b'file-id')
3208+ tree.add('file', ids=b'file-id')
3209 tree.commit('Added file')
3210 os.rename('tree/file', 'tree/file2')
3211 RenameMap.guess_renames(tree.basis_tree(), tree, dry_run=True)
3212@@ -191,7 +191,7 @@
3213 tree.lock_write()
3214 self.addCleanup(tree.unlock)
3215 self.build_tree(['tree/file'])
3216- tree.add('file', b'file-id')
3217+ tree.add('file', ids=b'file-id')
3218 tree.commit('Added file')
3219 os.rename('tree/file', 'tree/file2')
3220 notes = self.captureNotes(
3221@@ -208,7 +208,7 @@
3222 tree.lock_write()
3223 # self.addCleanup(tree.unlock)
3224 self.build_tree(['file'])
3225- tree.add('file', b'file-id')
3226+ tree.add('file', ids=b'file-id')
3227 tree.commit('Added file')
3228 os.mkdir('folder')
3229 os.rename('file', 'folder/file2')
3230
3231=== modified file 'breezy/tests/test_revert.py'
3232--- breezy/tests/test_revert.py 2020-07-04 12:29:00 +0000
3233+++ breezy/tests/test_revert.py 2022-07-02 16:16:10 +0000
3234@@ -29,7 +29,7 @@
3235 target_tree = source_tree.controldir.sprout(
3236 'target').open_workingtree()
3237 self.build_tree(['source/dir/', 'source/dir/contents'])
3238- source_tree.add(['dir', 'dir/contents'], [b'dir-id', b'contents-id'])
3239+ source_tree.add(['dir', 'dir/contents'], ids=[b'dir-id', b'contents-id'])
3240 source_tree.commit('added dir')
3241 target_tree.lock_write()
3242 self.addCleanup(target_tree.unlock)
3243@@ -141,7 +141,7 @@
3244 tree = self.make_branch_and_tree('.')
3245 self.build_tree(['dir/', 'dir/file1', 'dir/file2'])
3246 tree.add(['dir', 'dir/file1', 'dir/file2'],
3247- [b'dir-id', b'file1-id', b'file2-id'])
3248+ ids=[b'dir-id', b'file1-id', b'file2-id'])
3249 tree.commit("Added files")
3250 os.unlink('dir/file1')
3251 os.unlink('dir/file2')
3252
3253=== modified file 'breezy/tests/test_shelf.py'
3254--- breezy/tests/test_shelf.py 2021-12-08 18:46:11 +0000
3255+++ breezy/tests/test_shelf.py 2022-07-02 16:16:10 +0000
3256@@ -59,7 +59,7 @@
3257 def prepare_shelve_rename(self):
3258 tree = self.make_branch_and_tree('.')
3259 self.build_tree(['foo'])
3260- tree.add(['foo'], [b'foo-id'])
3261+ tree.add(['foo'], ids=[b'foo-id'])
3262 tree.commit('foo')
3263 tree.rename_one('foo', 'bar')
3264 tree.lock_tree_write()
3265@@ -91,7 +91,7 @@
3266 def prepare_shelve_move(self):
3267 tree = self.make_branch_and_tree('.')
3268 self.build_tree(['foo/', 'bar/', 'foo/baz'])
3269- tree.add(['foo', 'bar', 'foo/baz'], [b'foo-id', b'bar-id', b'baz-id'])
3270+ tree.add(['foo', 'bar', 'foo/baz'], ids=[b'foo-id', b'bar-id', b'baz-id'])
3271 tree.commit('foo')
3272 tree.rename_one('foo/baz', 'bar/baz')
3273 tree.lock_tree_write()
3274@@ -128,7 +128,7 @@
3275 tree = self.make_branch_and_tree('.')
3276 self.build_tree(['foo'])
3277 tree.set_root_id(b'first-root-id')
3278- tree.add(['foo'], [b'foo-id'])
3279+ tree.add(['foo'], ids=[b'foo-id'])
3280 tree.commit('foo')
3281 tree.set_root_id(b'second-root-id')
3282 tree.lock_tree_write()
3283@@ -158,7 +158,7 @@
3284 tree.lock_write()
3285 self.addCleanup(tree.unlock)
3286 self.build_tree_contents([('foo', b'a\n')])
3287- tree.add('foo', b'foo-id')
3288+ tree.add('foo', ids=b'foo-id')
3289 tree.commit('Committed foo')
3290 self.build_tree_contents([('foo', b'b\na\nc\n')])
3291 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3292@@ -194,7 +194,7 @@
3293 self.addCleanup(tree.unlock)
3294 tree.commit('Empty tree')
3295 self.build_tree_contents([('foo', b'a\n'), ('bar/',)])
3296- tree.add(['foo', 'bar'], [b'foo-id', b'bar-id'])
3297+ tree.add(['foo', 'bar'], ids=[b'foo-id', b'bar-id'])
3298 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3299 self.addCleanup(creator.finalize)
3300 self.assertEqual([('add file', b'bar-id', 'directory', 'bar'),
3301@@ -237,7 +237,7 @@
3302 tree.commit('Empty tree')
3303 self.build_tree_contents(
3304 [('foo', b'a\n'), ('bar/',), ('bar/ignored', b'ign\n')])
3305- tree.add(['foo', 'bar'], [b'foo-id', b'bar-id'])
3306+ tree.add(['foo', 'bar'], ids=[b'foo-id', b'bar-id'])
3307 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3308 self.addCleanup(creator.finalize)
3309 self.assertEqual([('add file', b'bar-id', 'directory', 'bar'),
3310@@ -263,7 +263,7 @@
3311 self.addCleanup(tree.unlock)
3312 tree.commit('Empty tree')
3313 os.symlink(link_target, link_name)
3314- tree.add(link_name, b'foo-id')
3315+ tree.add(link_name, ids=b'foo-id')
3316 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3317 self.addCleanup(creator.finalize)
3318 self.assertEqual([('add file', b'foo-id', 'symlink', link_name)],
3319@@ -302,7 +302,7 @@
3320 tree.lock_write()
3321 self.addCleanup(tree.unlock)
3322 os.symlink(old_target, link_name)
3323- tree.add(link_name, b'foo-id')
3324+ tree.add(link_name, ids=b'foo-id')
3325 tree.commit("commit symlink")
3326 os.unlink(link_name)
3327 os.symlink(new_target, link_name)
3328@@ -343,7 +343,7 @@
3329 self.addCleanup(tree.unlock)
3330 tree.commit('Empty tree')
3331 self.build_tree(['foo'])
3332- tree.add('foo', b'foo-id')
3333+ tree.add('foo', ids=b'foo-id')
3334 os.unlink('foo')
3335 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3336 self.addCleanup(creator.finalize)
3337@@ -365,7 +365,7 @@
3338 tree.lock_write()
3339 self.addCleanup(tree.unlock)
3340 self.build_tree_contents([('tree/foo/',), ('tree/foo/bar', b'baz')])
3341- tree.add(['foo', 'foo/bar'], [b'foo-id', b'bar-id'])
3342+ tree.add(['foo', 'foo/bar'], ids=[b'foo-id', b'bar-id'])
3343 tree.commit('Added file and directory')
3344 tree.unversion(['foo', 'foo/bar'])
3345 os.unlink('tree/foo/bar')
3346@@ -399,7 +399,7 @@
3347 def test_shelve_delete_contents(self):
3348 tree = self.make_branch_and_tree('tree')
3349 self.build_tree(['tree/foo', ])
3350- tree.add('foo', b'foo-id')
3351+ tree.add('foo', ids=b'foo-id')
3352 tree.commit('Added file and directory')
3353 os.unlink('tree/foo')
3354 tree.lock_tree_write()
3355@@ -415,7 +415,7 @@
3356 def prepare_shelve_change_kind(self):
3357 tree = self.make_branch_and_tree('tree')
3358 self.build_tree_contents([('tree/foo', b'bar')])
3359- tree.add('foo', b'foo-id')
3360+ tree.add('foo', ids=b'foo-id')
3361 tree.commit('Added file and directory')
3362 os.unlink('tree/foo')
3363 os.mkdir('tree/foo')
3364@@ -458,7 +458,7 @@
3365 def test_shelve_unversion(self):
3366 tree = self.make_branch_and_tree('tree')
3367 self.build_tree(['tree/foo', ])
3368- tree.add('foo', b'foo-id')
3369+ tree.add('foo', ids=b'foo-id')
3370 tree.commit('Added file and directory')
3371 tree.unversion(['foo'])
3372 tree.lock_tree_write()
3373@@ -488,7 +488,7 @@
3374 def test_write_shelf(self):
3375 tree = self.make_branch_and_tree('tree')
3376 self.build_tree(['tree/foo'])
3377- tree.add('foo', b'foo-id')
3378+ tree.add('foo', ids=b'foo-id')
3379 tree.lock_tree_write()
3380 self.addCleanup(tree.unlock)
3381 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3382@@ -552,7 +552,7 @@
3383 self.build_tree_contents([('tree/foo', b'bar')])
3384 tree.lock_write()
3385 self.addCleanup(tree.unlock)
3386- tree.add('foo', b'foo-id')
3387+ tree.add('foo', ids=b'foo-id')
3388 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3389 self.addCleanup(creator.finalize)
3390 list(creator.iter_shelvable())
3391@@ -571,7 +571,7 @@
3392 tree.lock_write()
3393 self.addCleanup(tree.unlock)
3394 self.build_tree_contents([('tree/foo', b'a\nb\nc\n')])
3395- tree.add('foo', b'foo-id')
3396+ tree.add('foo', ids=b'foo-id')
3397 tree.commit('first commit')
3398 self.build_tree_contents([('tree/foo', b'a\nb\nd\n')])
3399 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3400@@ -594,7 +594,7 @@
3401 tree.lock_write()
3402 self.addCleanup(tree.unlock)
3403 self.build_tree_contents([('tree/foo/',), ('tree/foo/bar', b'baz')])
3404- tree.add(['foo', 'foo/bar'], [b'foo-id', b'bar-id'])
3405+ tree.add(['foo', 'foo/bar'], ids=[b'foo-id', b'bar-id'])
3406 tree.commit('Added file and directory')
3407 tree.unversion(['foo', 'foo/bar'])
3408 os.unlink('tree/foo/bar')
3409@@ -661,9 +661,9 @@
3410 tree = self.make_branch_and_tree('.')
3411 self.addCleanup(tree.lock_write().unlock)
3412 self.build_tree(['dir/', 'dir/subdir/', 'dir/subdir/foo'])
3413- tree.add(['dir'], [b'dir-id'])
3414+ tree.add(['dir'], ids=[b'dir-id'])
3415 tree.commit('versioned dir')
3416- tree.add(['dir/subdir', 'dir/subdir/foo'], [b'subdir-id', b'foo-id'])
3417+ tree.add(['dir/subdir', 'dir/subdir/foo'], ids=[b'subdir-id', b'foo-id'])
3418 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3419 self.addCleanup(creator.finalize)
3420 for change in creator.iter_shelvable():
3421@@ -773,7 +773,7 @@
3422 self.addCleanup(tree.unlock)
3423 self.build_tree_contents([('tree/foo', b'bar')])
3424 self.assertFileEqual(b'bar', 'tree/foo')
3425- tree.add('foo', b'foo-id')
3426+ tree.add('foo', ids=b'foo-id')
3427 creator = shelf.ShelfCreator(tree, tree.basis_tree())
3428 self.addCleanup(creator.finalize)
3429 list(creator.iter_shelvable())
3430
3431=== modified file 'breezy/tests/test_shelf_ui.py'
3432--- breezy/tests/test_shelf_ui.py 2021-12-08 18:46:11 +0000
3433+++ breezy/tests/test_shelf_ui.py 2022-07-02 16:16:10 +0000
3434@@ -74,7 +74,7 @@
3435 def create_shelvable_tree(self):
3436 tree = self.make_branch_and_tree('tree')
3437 self.build_tree_contents([('tree/foo', LINES_AJ)])
3438- tree.add('foo', b'foo-id')
3439+ tree.add('foo', ids=b'foo-id')
3440 tree.commit('added foo')
3441 self.build_tree_contents([('tree/foo', LINES_ZY)])
3442 return tree
3443@@ -217,7 +217,7 @@
3444 self.requireFeature(features.SymlinkFeature(self.test_dir))
3445 tree = self.create_shelvable_tree()
3446 os.symlink('bar', 'tree/baz')
3447- tree.add('baz', b'baz-id')
3448+ tree.add('baz', ids=b'baz-id')
3449 tree.commit("Add symlink")
3450 os.unlink('tree/baz')
3451 os.symlink('vax', 'tree/baz')
3452@@ -446,7 +446,7 @@
3453 self.requireFeature(features.SymlinkFeature(self.test_dir))
3454 tree = self.create_shelvable_tree()
3455 os.symlink('bar', 'tree/baz')
3456- tree.add('baz', b'baz-id')
3457+ tree.add('baz', ids=b'baz-id')
3458 tree.commit("Add symlink")
3459 os.unlink('tree/baz')
3460 os.symlink('vax', 'tree/baz')
3461@@ -469,7 +469,7 @@
3462 tree.lock_write()
3463 try:
3464 self.build_tree_contents([('tree/foo', LINES_AJ)])
3465- tree.add('foo', b'foo-id')
3466+ tree.add('foo', ids=b'foo-id')
3467 tree.commit('added foo')
3468 self.build_tree_contents([('tree/foo', LINES_ZY)])
3469 shelver = shelf_ui.Shelver(tree, tree.basis_tree(),
3470
3471=== modified file 'breezy/tests/test_smart_add.py'
3472--- breezy/tests/test_smart_add.py 2021-11-13 13:01:39 +0000
3473+++ breezy/tests/test_smart_add.py 2022-07-02 16:16:10 +0000
3474@@ -127,7 +127,7 @@
3475 self.build_tree(['new/subby/', 'new/subby/a', 'new/subby/b'])
3476
3477 subdir_file_id = self.base_tree.path2id('dir/subdir')
3478- new_tree.add(['subby'], [subdir_file_id])
3479+ new_tree.add(['subby'], ids=[subdir_file_id])
3480 self.add_helper(self.base_tree, '', new_tree, ['new'])
3481 # Because 'subby' already points to subdir, we should add
3482 # 'b' with the same id
3483
3484=== modified file 'breezy/tests/test_subsume.py'
3485--- breezy/tests/test_subsume.py 2019-09-22 22:54:48 +0000
3486+++ breezy/tests/test_subsume.py 2022-07-02 16:16:10 +0000
3487@@ -31,13 +31,13 @@
3488 'tree/subtree/',
3489 'tree/subtree/file2'])
3490 base_tree = self.make_branch_and_tree('tree', format=format)
3491- base_tree.add('file', b'file-id')
3492+ base_tree.add('file', ids=b'file-id')
3493 base_tree.commit('first commit', rev_id=b'tree-1')
3494 sub_tree = self.make_branch_and_tree('tree/subtree',
3495 format='development-subtree')
3496 if same_root is True:
3497 sub_tree.set_root_id(base_tree.path2id(''))
3498- sub_tree.add('file2', b'file2-id')
3499+ sub_tree.add('file2', ids=b'file2-id')
3500 sub_tree.commit('first commit', rev_id=b'subtree-1')
3501 return base_tree, sub_tree
3502
3503
3504=== modified file 'breezy/tests/test_transform.py'
3505--- breezy/tests/test_transform.py 2021-12-25 15:47:06 +0000
3506+++ breezy/tests/test_transform.py 2022-07-02 16:16:10 +0000
3507@@ -683,7 +683,7 @@
3508 def make_tt_with_versioned_dir(self):
3509 wt = self.make_branch_and_tree('.')
3510 self.build_tree(['dir/', ])
3511- wt.add(['dir'], [b'dir-id'])
3512+ wt.add(['dir'], ids=[b'dir-id'])
3513 wt.commit('Create dir')
3514 tt = wt.transform()
3515 self.addCleanup(tt.finalize)
3516@@ -819,7 +819,7 @@
3517 def make_destruction_preview(self):
3518 tree = self.make_branch_and_tree('.')
3519 self.build_tree([u'foo\u1234', 'bar'])
3520- tree.add([u'foo\u1234', 'bar'], [b'foo-id', b'bar-id'])
3521+ tree.add([u'foo\u1234', 'bar'], ids=[b'foo-id', b'bar-id'])
3522 return self.get_preview(tree)
3523
3524 def destruction_records(self):
3525@@ -876,7 +876,7 @@
3526 LINES_TWO = b'z\nbb\nx\ndd\n'
3527 tree = self.make_branch_and_tree('tree')
3528 self.build_tree_contents([('tree/file', LINES_ONE)])
3529- tree.add('file', b'file-id')
3530+ tree.add('file', ids=b'file-id')
3531 return self.get_preview(tree), [LINES_TWO]
3532
3533 def modification_records(self):
3534@@ -906,7 +906,7 @@
3535 LINES = b'a\nb\nc\nd\n'
3536 tree = self.make_branch_and_tree('tree')
3537 self.build_tree(['tree/foo/'])
3538- tree.add('foo', b'foo-id')
3539+ tree.add('foo', ids=b'foo-id')
3540 return self.get_preview(tree), [LINES]
3541
3542 def kind_change_records(self):
3543@@ -965,7 +965,7 @@
3544 LINES_ONE = b'aa\nbb\ncc\ndd\n'
3545 tree = self.make_branch_and_tree('tree')
3546 self.build_tree_contents([('tree/file', LINES_ONE)])
3547- tree.add('file', b'file-id')
3548+ tree.add('file', ids=b'file-id')
3549 tt = self.get_preview(tree)
3550 trans_id = tt.trans_id_tree_path('file')
3551 self.assertEqual(([b'aa\n', b'bb\n', b'cc\n', b'dd\n'],),
3552@@ -975,7 +975,7 @@
3553 LINES_ONE = b'aa\nbb\ncc\ndd\n'
3554 tree = self.make_branch_and_tree('tree')
3555 self.build_tree_contents([('tree/file', LINES_ONE)])
3556- tree.add('file', b'file-id')
3557+ tree.add('file', ids=b'file-id')
3558 tt = self.get_preview(tree)
3559 trans_id = tt.trans_id_tree_path('file')
3560 self.assertEqual((LINES_ONE,),
3561@@ -996,7 +996,7 @@
3562
3563 def _prepare_orphan(self, wt):
3564 self.build_tree(['dir/', 'dir/file', 'dir/foo'])
3565- wt.add(['dir', 'dir/file'], [b'dir-id', b'file-id'])
3566+ wt.add(['dir', 'dir/file'], ids=[b'dir-id', b'file-id'])
3567 wt.commit('add dir and file ignoring foo')
3568 tt = wt.transform()
3569 self.addCleanup(tt.finalize)
3570
3571=== modified file 'breezy/tests/test_upgrade.py'
3572--- breezy/tests/test_upgrade.py 2018-11-12 01:41:38 +0000
3573+++ breezy/tests/test_upgrade.py 2022-07-02 16:16:10 +0000
3574@@ -91,7 +91,7 @@
3575 # and its there that the core logic is tested.
3576 tree = self.make_branch_and_tree('tree', format='knit')
3577 self.build_tree(['tree/file'])
3578- tree.add(['file'], [b'file-id'])
3579+ tree.add(['file'])
3580 target = controldir.format_registry.make_controldir('dirstate')
3581 converter = tree.controldir._format.get_converter(target)
3582 converter.convert(tree.controldir, None)
3583
3584=== modified file 'breezy/tests/test_workingtree.py'
3585--- breezy/tests/test_workingtree.py 2021-12-08 18:46:11 +0000
3586+++ breezy/tests/test_workingtree.py 2022-07-02 16:16:10 +0000
3587@@ -258,7 +258,7 @@
3588 tree = self.make_branch_and_tree('tree', format='development-subtree')
3589 self.build_tree(['tree/a/', 'tree/a/b/', 'tree/a/b/c'])
3590 tree.set_root_id(b'root-id')
3591- tree.add(['a', 'a/b', 'a/b/c'], [b'a-id', b'b-id', b'c-id'])
3592+ tree.add(['a', 'a/b', 'a/b/c'], ids=[b'a-id', b'b-id', b'c-id'])
3593 tree.commit('initial')
3594 return tree
3595
3596@@ -421,7 +421,7 @@
3597 def test_auto_resolve(self):
3598 base = self.make_branch_and_tree('base')
3599 self.build_tree_contents([('base/hello', b'Hello')])
3600- base.add('hello', b'hello_id')
3601+ base.add('hello', ids=b'hello_id')
3602 base.commit('Hello')
3603 other = base.controldir.sprout('other').open_workingtree()
3604 self.build_tree_contents([('other/hello', b'hELLO')])
3605@@ -460,12 +460,12 @@
3606 self.requireFeature(SymlinkFeature(self.test_dir))
3607 base = self.make_branch_and_tree('base')
3608 self.build_tree_contents([('base/hello', 'Hello')])
3609- base.add('hello', b'hello_id')
3610+ base.add('hello', ids=b'hello_id')
3611 base.commit('commit 0')
3612 other = base.controldir.sprout('other').open_workingtree()
3613 self.build_tree_contents([('other/hello', 'Hello')])
3614 os.symlink('other/hello', 'other/foo')
3615- other.add('foo', b'foo_id')
3616+ other.add('foo', ids=b'foo_id')
3617 other.commit('commit symlink')
3618 this = base.controldir.sprout('this').open_workingtree()
3619 self.assertPathExists('this/hello')
3620@@ -487,7 +487,7 @@
3621 def test_auto_resolve_dir(self):
3622 tree = self.make_branch_and_tree('tree')
3623 self.build_tree(['tree/hello/'])
3624- tree.add('hello', b'hello-id')
3625+ tree.add('hello', ids=b'hello-id')
3626 file_conflict = _mod_bzr_conflicts.TextConflict('hello', b'hello-id')
3627 tree.set_conflicts([file_conflict])
3628 remaining, resolved = self._auto_resolve(tree)
3629@@ -513,7 +513,7 @@
3630 tree = self.make_branch_and_tree('tree')
3631 tree.commit('get root in there')
3632 self.build_tree_contents([('tree/file', b'content')])
3633- tree.add('file', b'file-id')
3634+ tree.add('file', ids=b'file-id')
3635 tree.store_uncommitted()
3636 return tree
3637
3638
3639=== modified file 'breezy/textmerge.py'
3640--- breezy/textmerge.py 2020-02-18 01:57:45 +0000
3641+++ breezy/textmerge.py 2022-07-02 16:16:10 +0000
3642@@ -17,11 +17,6 @@
3643 # Author: Martin Pool <mbp@canonical.com>
3644 # Aaron Bentley <aaron.bentley@utoronto.ca>
3645
3646-from .lazy_import import lazy_import
3647-lazy_import(globals(), """
3648-import patiencediff
3649-""")
3650-
3651
3652 class TextMerge(object):
3653 """Base class for text-mergers
3654@@ -134,6 +129,7 @@
3655 """Return structured merge info.
3656 See TextMerge docstring.
3657 """
3658+ import patiencediff
3659 sm = patiencediff.PatienceSequenceMatcher(
3660 None, self.lines_a, self.lines_b)
3661 pos_a = 0
3662
3663=== modified file 'breezy/trace.py'
3664--- breezy/trace.py 2020-05-24 00:42:36 +0000
3665+++ breezy/trace.py 2022-07-02 16:16:10 +0000
3666@@ -61,15 +61,10 @@
3667 import sys
3668 import time
3669
3670+import breezy
3671+
3672 from .lazy_import import lazy_import
3673 lazy_import(globals(), """
3674-import tempfile
3675-import traceback
3676-""")
3677-
3678-import breezy
3679-
3680-lazy_import(globals(), """
3681 from breezy import (
3682 bedding,
3683 debug,
3684@@ -172,6 +167,7 @@
3685 :param fmt: The format string to pass to mutter.
3686 :param args: A list of substitution variables.
3687 """
3688+ import traceback
3689 outf = StringIO()
3690 if stacklevel is None:
3691 limit = None
3692@@ -362,6 +358,7 @@
3693 interesting to developers but not to users. For example,
3694 errors loading plugins.
3695 """
3696+ import traceback
3697 mutter(traceback.format_exc())
3698
3699
3700@@ -443,6 +440,7 @@
3701
3702
3703 def _dump_memory_usage(err_file):
3704+ import tempfile
3705 try:
3706 try:
3707 fd, name = tempfile.mkstemp(prefix="brz_memdump", suffix=".json")
3708@@ -523,6 +521,7 @@
3709
3710
3711 def print_exception(exc_info, err_file):
3712+ import traceback
3713 exc_type, exc_object, exc_tb = exc_info
3714 err_file.write("brz: ERROR: %s: %s\n" % (
3715 _qualified_exception_name(exc_type), exc_object))
3716
3717=== modified file 'breezy/transform.py'
3718--- breezy/transform.py 2021-12-25 12:35:22 +0000
3719+++ breezy/transform.py 2022-07-02 16:16:10 +0000
3720@@ -32,10 +32,7 @@
3721 )
3722 lazy_import.lazy_import(globals(), """
3723 from breezy import (
3724- multiparent,
3725- revision as _mod_revision,
3726 ui,
3727- urlutils,
3728 )
3729 from breezy.i18n import gettext
3730 """)
3731
3732=== modified file 'breezy/transport/http/urllib.py'
3733--- breezy/transport/http/urllib.py 2022-05-15 18:30:13 +0000
3734+++ breezy/transport/http/urllib.py 2022-07-02 16:16:10 +0000
3735@@ -65,7 +65,6 @@
3736 config,
3737 debug,
3738 errors,
3739- lazy_import,
3740 osutils,
3741 trace,
3742 transport,
3743
3744=== modified file 'breezy/transport/local.py'
3745--- breezy/transport/local.py 2022-05-02 11:39:09 +0000
3746+++ breezy/transport/local.py 2022-07-02 16:16:10 +0000
3747@@ -19,22 +19,15 @@
3748 This is a fairly thin wrapper on regular file IO.
3749 """
3750
3751+import errno
3752 import os
3753 from stat import ST_MODE, S_ISDIR, S_IMODE
3754 import sys
3755
3756-from ..lazy_import import lazy_import
3757-lazy_import(globals(), """
3758-import errno
3759-import shutil
3760-
3761-from breezy import (
3762- atomicfile,
3763+from .. import (
3764 osutils,
3765 urlutils,
3766 )
3767-from breezy.transport import LateReadError
3768-""")
3769
3770 from .. import transport
3771
3772@@ -155,7 +148,7 @@
3773 return open(path, 'rb')
3774 except (IOError, OSError) as e:
3775 if e.errno == errno.EISDIR:
3776- return LateReadError(relpath)
3777+ return transport.LateReadError(relpath)
3778 self._translate_error(e, path)
3779
3780 def put_file(self, relpath, f, mode=None):
3781@@ -166,12 +159,13 @@
3782 :param mode: The mode for the newly created file,
3783 None means just use the default
3784 """
3785+ from ..atomicfile import AtomicFile
3786
3787 path = relpath
3788 try:
3789 path = self._abspath(relpath)
3790 osutils.check_legal_path(path)
3791- fp = atomicfile.AtomicFile(path, 'wb', new_mode=mode)
3792+ fp = AtomicFile(path, 'wb', new_mode=mode)
3793 except (IOError, OSError) as e:
3794 self._translate_error(e, path)
3795 try:
3796@@ -187,6 +181,7 @@
3797 :param relpath: Location to put the contents, relative to base.
3798 :param raw_bytes: String
3799 """
3800+ from ..atomicfile import AtomicFile
3801 if not isinstance(raw_bytes, bytes):
3802 raise TypeError(
3803 'raw_bytes must be bytes, not %s' % type(raw_bytes))
3804@@ -194,7 +189,7 @@
3805 try:
3806 path = self._abspath(relpath)
3807 osutils.check_legal_path(path)
3808- fp = atomicfile.AtomicFile(path, 'wb', new_mode=mode)
3809+ fp = AtomicFile(path, 'wb', new_mode=mode)
3810 except (IOError, OSError) as e:
3811 self._translate_error(e, path)
3812 try:
3813@@ -388,6 +383,7 @@
3814 """Copy the item at rel_from to the location at rel_to"""
3815 path_from = self._abspath(rel_from)
3816 path_to = self._abspath(rel_to)
3817+ import shutil
3818 try:
3819 shutil.copy(path_from, path_to)
3820 except (IOError, OSError) as e:
3821@@ -438,6 +434,7 @@
3822 :param relpaths: A list/generator of entries to be copied.
3823 """
3824 if isinstance(other, LocalTransport):
3825+ import shutil
3826 # Both from & to are on the local filesystem
3827 # Unfortunately, I can't think of anything faster than just
3828 # copying them across, one by one :(
3829
3830=== modified file 'breezy/treebuilder.py'
3831--- breezy/treebuilder.py 2020-02-18 01:57:45 +0000
3832+++ breezy/treebuilder.py 2022-07-02 16:16:10 +0000
3833@@ -52,7 +52,7 @@
3834 """
3835 self._ensure_building()
3836 if not self._root_done:
3837- self._tree.add('', b'root-id', 'directory')
3838+ self._tree.add('', 'directory', ids=b'root-id')
3839 self._root_done = True
3840 for name in recipe:
3841 if name.endswith('/'):
3842@@ -60,7 +60,7 @@
3843 else:
3844 end = b'\n'
3845 content = b"contents of %s%s" % (name.encode('utf-8'), end)
3846- self._tree.add(name, None, 'file')
3847+ self._tree.add(name, 'file')
3848 self._tree.put_file_bytes_non_atomic(name, content)
3849
3850 def _ensure_building(self):
3851
3852=== modified file 'breezy/ui/__init__.py'
3853--- breezy/ui/__init__.py 2020-02-18 01:57:45 +0000
3854+++ breezy/ui/__init__.py 2022-07-02 16:16:10 +0000
3855@@ -43,15 +43,6 @@
3856
3857 import warnings
3858
3859-from ..lazy_import import lazy_import
3860-lazy_import(globals(), """
3861-from breezy import (
3862- config,
3863- osutils,
3864- progress,
3865- )
3866-""")
3867-
3868
3869 _valid_boolean_strings = dict(yes=True, no=False,
3870 y=True, n=False,
3871@@ -265,10 +256,11 @@
3872 When the bar has been finished with, it should be released by calling
3873 bar.finished().
3874 """
3875+ from ..progress import ProgressTask
3876 if self._task_stack:
3877- t = progress.ProgressTask(self._task_stack[-1], self)
3878+ t = ProgressTask(self._task_stack[-1], self)
3879 else:
3880- t = progress.ProgressTask(None, self)
3881+ t = ProgressTask(None, self)
3882 self._task_stack.append(t)
3883 return t
3884
3885
3886=== modified file 'breezy/ui/text.py'
3887--- breezy/ui/text.py 2020-02-18 01:57:45 +0000
3888+++ breezy/ui/text.py 2022-07-02 16:16:10 +0000
3889@@ -24,7 +24,6 @@
3890
3891 from ..lazy_import import lazy_import
3892 lazy_import(globals(), """
3893-import getpass
3894 import time
3895
3896 from breezy import (
3897@@ -239,6 +238,7 @@
3898 def get_non_echoed_password(self):
3899 isatty = getattr(self.stdin, 'isatty', None)
3900 if isatty is not None and isatty():
3901+ import getpass
3902 # getpass() ensure the password is not echoed and other
3903 # cross-platform niceties
3904 password = getpass.getpass('')
3905
3906=== modified file 'breezy/workingtree.py'
3907--- breezy/workingtree.py 2022-05-02 12:09:22 +0000
3908+++ breezy/workingtree.py 2022-07-02 16:16:10 +0000
3909@@ -36,21 +36,12 @@
3910
3911 from .lazy_import import lazy_import
3912 lazy_import(globals(), """
3913-import shutil
3914 import stat
3915
3916 from breezy import (
3917- conflicts as _mod_conflicts,
3918- filters as _mod_filters,
3919- merge,
3920 revision as _mod_revision,
3921- transform,
3922- transport,
3923 views,
3924 )
3925-from breezy.bzr import (
3926- generate_ids,
3927- )
3928 """)
3929
3930 from . import (
3931@@ -367,6 +358,7 @@
3932 if filtered and self.supports_content_filtering():
3933 filters = self._content_filter_stack(path)
3934 if filters:
3935+ from . import filters as _mod_filters
3936 orig_file_obj = file_obj
3937 try:
3938 file_obj, size = _mod_filters.filtered_input_file(
3939@@ -428,10 +420,11 @@
3940
3941 def copy_content_into(self, tree, revision_id=None):
3942 """Copy the current content and user files of this tree into tree."""
3943+ from .merge import transform_tree
3944 with self.lock_read():
3945 tree.set_root_id(self.path2id(''))
3946 if revision_id is None:
3947- merge.transform_tree(tree, self)
3948+ transform_tree(tree, self)
3949 else:
3950 # TODO now merge from tree.last_revision to revision (to
3951 # preserve user local changes)
3952@@ -441,7 +434,7 @@
3953 other_tree = self.branch.repository.revision_tree(
3954 revision_id)
3955
3956- merge.transform_tree(tree, other_tree)
3957+ transform_tree(tree, other_tree)
3958 if revision_id == _mod_revision.NULL_REVISION:
3959 new_parents = []
3960 else:
3961@@ -698,18 +691,11 @@
3962 """
3963 raise NotImplementedError(self.merge_modified)
3964
3965- def mkdir(self, path, file_id=None):
3966+ def mkdir(self, path):
3967 """See MutableTree.mkdir()."""
3968- if file_id is None:
3969- if self.supports_setting_file_ids():
3970- file_id = generate_ids.gen_file_id(os.path.basename(path))
3971- else:
3972- if not self.supports_setting_file_ids():
3973- raise SettingFileIdUnsupported()
3974 with self.lock_write():
3975 os.mkdir(self.abspath(path))
3976- self.add(path, file_id, 'directory')
3977- return file_id
3978+ self.add([path], ['directory'])
3979
3980 def get_symlink_target(self, path):
3981 abspath = self.abspath(path)
3982@@ -799,6 +785,7 @@
3983 :param from_rel: From location (relative to tree root)
3984 :param to_rel: Target location (relative to tree root)
3985 """
3986+ import shutil
3987 shutil.copyfile(self.abspath(from_rel), self.abspath(to_rel))
3988 self.add(to_rel)
3989
3990@@ -828,6 +815,7 @@
3991 def pull(self, source, overwrite=False, stop_revision=None,
3992 change_reporter=None, possible_transports=None, local=False,
3993 show_base=False, tag_selector=None):
3994+ from .merge import merge_inner
3995 with self.lock_write(), source.lock_read():
3996 old_revision_info = self.branch.last_revision_info()
3997 basis_tree = self.basis_tree()
3998@@ -844,7 +832,7 @@
3999 basis_tree = repository.revision_tree(basis_id)
4000 with basis_tree.lock_read():
4001 new_basis_tree = self.branch.basis_tree()
4002- merge.merge_inner(
4003+ merge_inner(
4004 self.branch,
4005 new_basis_tree,
4006 basis_tree,
4007@@ -1008,6 +996,7 @@
4008 def revert(self, filenames=None, old_tree=None, backups=True,
4009 pb=None, report_changes=False):
4010 from .conflicts import resolve
4011+ from .transform import revert
4012 with contextlib.ExitStack() as exit_stack:
4013 exit_stack.enter_context(self.lock_tree_write())
4014 if old_tree is None:
4015@@ -1016,8 +1005,8 @@
4016 old_tree = basis_tree
4017 else:
4018 basis_tree = None
4019- conflicts = transform.revert(self, old_tree, filenames, backups, pb,
4020- report_changes)
4021+ conflicts = revert(self, old_tree, filenames, backups, pb,
4022+ report_changes)
4023 if filenames is None and len(self.get_parent_ids()) > 1:
4024 parent_trees = []
4025 last_revision = self.last_revision()

Subscribers

People subscribed via source and target branches