Merge lp:~jelmer/brz/delta-copied 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/delta-copied
Merge into: lp:brz
Prerequisite: lp:~jelmer/brz/tree-change-without-file-id
Diff against target: 1018 lines (+146/-67)
19 files modified
breezy/bzr/bundle/serializer/v08.py (+2/-1)
breezy/delta.py (+36/-16)
breezy/info.py (+1/-0)
breezy/log.py (+2/-3)
breezy/plugins/fastimport/exporter.py (+1/-1)
breezy/plugins/fastimport/tests/test_generic_processor.py (+1/-1)
breezy/plugins/fastimport/tests/test_revision_store.py (+3/-3)
breezy/plugins/upload/cmds.py (+1/-1)
breezy/plugins/weave_fmt/test_bzrdir.py (+2/-0)
breezy/tests/blackbox/test_info.py (+21/-0)
breezy/tests/per_intertree/test_compare.py (+22/-5)
breezy/tests/per_repository_vf/test_fileid_involved.py (+2/-1)
breezy/tests/per_workingtree/test_changes_from.py (+2/-0)
breezy/tests/test_delta.py (+15/-12)
breezy/tests/test_missing.py (+4/-0)
breezy/tests/test_transform.py (+18/-16)
breezy/tests/test_workingtree_4.py (+3/-3)
breezy/tree.py (+6/-4)
breezy/version_info_formats/__init__.py (+4/-0)
To merge this branch: bzr merge lp:~jelmer/brz/delta-copied
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+369485@code.launchpad.net

Commit message

Add TreeDelta.copied and TreeChange.copied fields.

Description of the change

Add TreeDelta.copied and TreeChange.copied fields.

This in preparation of copy tracking support in Git and Svn backends.

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

I think this is all reasonable. The pattern of using `+` on lists just to iterate is slightly bogus, but guess there would need to be a lot of changes to really matter then likely other things would be slow.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/bzr/bundle/serializer/v08.py'
--- breezy/bzr/bundle/serializer/v08.py 2019-09-21 15:38:35 +0000
+++ breezy/bzr/bundle/serializer/v08.py 2019-09-21 23:05:30 +0000
@@ -312,7 +312,8 @@
312 for change in delta.removed:312 for change in delta.removed:
313 action = Action('removed', [change.kind[0], change.path[0]]).write(self.to_file)313 action = Action('removed', [change.kind[0], change.path[0]]).write(self.to_file)
314314
315 for change in delta.added:315 # TODO(jelmer): Treat copied specially here?
316 for change in delta.added + delta.copied:
316 action = Action(317 action = Action(
317 'added', [change.kind[1], change.path[1]],318 'added', [change.kind[1], change.path[1]],
318 [('file-id', change.file_id.decode('utf-8'))])319 [('file-id', change.file_id.decode('utf-8'))])
319320
=== modified file 'breezy/delta.py'
--- breezy/delta.py 2019-06-29 19:50:18 +0000
+++ breezy/delta.py 2019-09-21 23:05:30 +0000
@@ -34,6 +34,7 @@
34 added34 added
35 removed35 removed
36 renamed36 renamed
37 copied
37 kind_changed38 kind_changed
38 modified39 modified
39 unchanged40 unchanged
@@ -41,8 +42,8 @@
4142
42 Each id is listed only once.43 Each id is listed only once.
4344
44 Files that are both modified and renamed are listed only in45 Files that are both modified and renamed or copied are listed only in
45 renamed, with the text_modified flag true. The text_modified46 renamed or copied, with the text_modified flag true. The text_modified
46 applies either to the content of the file or the target of the47 applies either to the content of the file or the target of the
47 symbolic link, depending of the kind of file.48 symbolic link, depending of the kind of file.
4849
@@ -57,6 +58,7 @@
57 self.added = []58 self.added = []
58 self.removed = []59 self.removed = []
59 self.renamed = []60 self.renamed = []
61 self.copied = []
60 self.kind_changed = []62 self.kind_changed = []
61 self.modified = []63 self.modified = []
62 self.unchanged = []64 self.unchanged = []
@@ -69,6 +71,7 @@
69 return self.added == other.added \71 return self.added == other.added \
70 and self.removed == other.removed \72 and self.removed == other.removed \
71 and self.renamed == other.renamed \73 and self.renamed == other.renamed \
74 and self.copied == other.copied \
72 and self.modified == other.modified \75 and self.modified == other.modified \
73 and self.unchanged == other.unchanged \76 and self.unchanged == other.unchanged \
74 and self.kind_changed == other.kind_changed \77 and self.kind_changed == other.kind_changed \
@@ -79,16 +82,18 @@
7982
80 def __repr__(self):83 def __repr__(self):
81 return "TreeDelta(added=%r, removed=%r, renamed=%r," \84 return "TreeDelta(added=%r, removed=%r, renamed=%r," \
82 " kind_changed=%r, modified=%r, unchanged=%r," \85 " copied=%r, kind_changed=%r, modified=%r, unchanged=%r," \
83 " unversioned=%r)" % (self.added,86 " unversioned=%r)" % (
84 self.removed, self.renamed, self.kind_changed, self.modified,87 self.added, self.removed, self.renamed, self.copied,
85 self.unchanged, self.unversioned)88 self.kind_changed, self.modified, self.unchanged,
89 self.unversioned)
8690
87 def has_changed(self):91 def has_changed(self):
88 return bool(self.modified92 return bool(self.modified
89 or self.added93 or self.added
90 or self.removed94 or self.removed
91 or self.renamed95 or self.renamed
96 or self.copied
92 or self.kind_changed)97 or self.kind_changed)
9398
94 def get_changes_as_text(self, show_ids=False, show_unchanged=False,99 def get_changes_as_text(self, show_ids=False, show_unchanged=False,
@@ -130,10 +135,13 @@
130 elif fully_present[0] is False:135 elif fully_present[0] is False:
131 delta.missing.append(change)136 delta.missing.append(change)
132 elif change.name[0] != change.name[1] or change.parent_id[0] != change.parent_id[1]:137 elif change.name[0] != change.name[1] or change.parent_id[0] != change.parent_id[1]:
133 # If the name changes, or the parent_id changes, we have a rename138 # If the name changes, or the parent_id changes, we have a rename or copy
134 # (if we move a parent, that doesn't count as a rename for the139 # (if we move a parent, that doesn't count as a rename for the
135 # file)140 # file)
136 delta.renamed.append(change)141 if change.copied:
142 delta.copied.append(change)
143 else:
144 delta.renamed.append(change)
137 elif change.kind[0] != change.kind[1]:145 elif change.kind[0] != change.kind[1]:
138 delta.kind_changed.append(change)146 delta.kind_changed.append(change)
139 elif change.changed_content or change.executable[0] != change.executable[1]:147 elif change.changed_content or change.executable[0] != change.executable[1]:
@@ -151,6 +159,7 @@
151 delta.removed.sort(key=change_key)159 delta.removed.sort(key=change_key)
152 delta.added.sort(key=change_key)160 delta.added.sort(key=change_key)
153 delta.renamed.sort(key=change_key)161 delta.renamed.sort(key=change_key)
162 delta.copied.sort(key=change_key)
154 delta.missing.sort(key=change_key)163 delta.missing.sort(key=change_key)
155 # TODO: jam 20060529 These lists shouldn't need to be sorted164 # TODO: jam 20060529 These lists shouldn't need to be sorted
156 # since we added them in alphabetical order.165 # since we added them in alphabetical order.
@@ -220,7 +229,7 @@
220 self.output("Operating on whole tree but only reporting on "229 self.output("Operating on whole tree but only reporting on "
221 "'%s' view." % (self.view_name,))230 "'%s' view." % (self.view_name,))
222231
223 def report(self, paths, versioned, renamed, modified, exe_change,232 def report(self, paths, versioned, renamed, copied, modified, exe_change,
224 kind):233 kind):
225 """Report one change to a file234 """Report one change to a file
226235
@@ -228,6 +237,7 @@
228 :param versioned: may be 'added', 'removed', 'unchanged', or237 :param versioned: may be 'added', 'removed', 'unchanged', or
229 'unversioned.238 'unversioned.
230 :param renamed: may be True or False239 :param renamed: may be True or False
240 :param copied: may be True or False
231 :param modified: may be 'created', 'deleted', 'kind changed',241 :param modified: may be 'created', 'deleted', 'kind changed',
232 'modified' or 'unchanged'.242 'modified' or 'unchanged'.
233 :param exe_change: True if the execute bit has changed243 :param exe_change: True if the execute bit has changed
@@ -253,13 +263,13 @@
253 # ( the path is different OR263 # ( the path is different OR
254 # the kind is different)264 # the kind is different)
255 if (versioned == 'unchanged' and265 if (versioned == 'unchanged' and
256 (renamed or modified == 'kind changed')):266 (renamed or copied or modified == 'kind changed')):
257 if renamed:267 if renamed or copied:
258 # on a rename, we show old and new268 # on a rename or copy, we show old and new
259 old_path, path = paths269 old_path, path = paths
260 else:270 else:
261 # if it's not renamed, we're showing both for kind changes271 # if it's not renamed or copied, we're showing both for kind
262 # so only show the new path272 # changes so only show the new path
263 old_path, path = paths[1], paths[1]273 old_path, path = paths[1], paths[1]
264 # if the file is not missing in the source, we show its kind274 # if the file is not missing in the source, we show its kind
265 # when we show two paths.275 # when we show two paths.
@@ -275,6 +285,8 @@
275 path = paths[1]285 path = paths[1]
276 if renamed:286 if renamed:
277 rename = "R"287 rename = "R"
288 elif copied:
289 rename = "C"
278 else:290 else:
279 rename = self.versioned_map[versioned]291 rename = self.versioned_map[versioned]
280 # we show the old kind on the new path when the content is deleted.292 # we show the old kind on the new path when the content is deleted.
@@ -320,8 +332,14 @@
320 # as it had a value332 # as it had a value
321 if None not in change.name and None not in change.parent_id and\333 if None not in change.name and None not in change.parent_id and\
322 (change.name[0] != change.name[1] or change.parent_id[0] != change.parent_id[1]):334 (change.name[0] != change.name[1] or change.parent_id[0] != change.parent_id[1]):
323 renamed = True335 if change.copied:
336 copied = True
337 renamed = False
338 else:
339 renamed = True
340 copied = False
324 else:341 else:
342 copied = False
325 renamed = False343 renamed = False
326 if change.kind[0] != change.kind[1]:344 if change.kind[0] != change.kind[1]:
327 if change.kind[0] is None:345 if change.kind[0] is None:
@@ -340,7 +358,7 @@
340 if change.kind[1] == "file":358 if change.kind[1] == "file":
341 exe_change = (change.executable[0] != change.executable[1])359 exe_change = (change.executable[0] != change.executable[1])
342 versioned_change = versioned_change_map[change.versioned]360 versioned_change = versioned_change_map[change.versioned]
343 reporter.report(change.path, versioned_change, renamed, modified,361 reporter.report(change.path, versioned_change, renamed, copied, modified,
344 exe_change, change.kind)362 exe_change, change.kind)
345363
346364
@@ -440,6 +458,8 @@
440 extra_modified = []458 extra_modified = []
441 show_list(delta.renamed, 'renamed', 'R', with_file_id_format='%s',459 show_list(delta.renamed, 'renamed', 'R', with_file_id_format='%s',
442 show_more=show_more_renamed)460 show_more=show_more_renamed)
461 show_list(delta.copied, 'copied', 'C', with_file_id_format='%s',
462 show_more=show_more_renamed)
443 show_list(delta.kind_changed, 'kind changed', 'K',463 show_list(delta.kind_changed, 'kind changed', 'K',
444 with_file_id_format='%s',464 with_file_id_format='%s',
445 show_more=show_more_kind_changed)465 show_more=show_more_kind_changed)
446466
=== modified file 'breezy/info.py'
--- breezy/info.py 2019-09-05 01:42:51 +0000
+++ breezy/info.py 2019-09-21 23:05:30 +0000
@@ -284,6 +284,7 @@
284 outfile.write(' %8d added\n' % len(delta.added))284 outfile.write(' %8d added\n' % len(delta.added))
285 outfile.write(' %8d removed\n' % len(delta.removed))285 outfile.write(' %8d removed\n' % len(delta.removed))
286 outfile.write(' %8d renamed\n' % len(delta.renamed))286 outfile.write(' %8d renamed\n' % len(delta.renamed))
287 outfile.write(' %8d copied\n' % len(delta.copied))
287288
288 ignore_cnt = unknown_cnt = 0289 ignore_cnt = unknown_cnt = 0
289 for path in working.extras():290 for path in working.extras():
290291
=== modified file 'breezy/log.py'
--- breezy/log.py 2019-09-21 17:08:09 +0000
+++ breezy/log.py 2019-09-21 23:05:30 +0000
@@ -1016,7 +1016,7 @@
1016 fileids set once their add or remove entry is detected respectively1016 fileids set once their add or remove entry is detected respectively
1017 """1017 """
1018 if stop_on == 'add':1018 if stop_on == 'add':
1019 for item in delta.added:1019 for item in delta.added + delta.copied:
1020 if item.file_id in fileids:1020 if item.file_id in fileids:
1021 fileids.remove(item.file_id)1021 fileids.remove(item.file_id)
1022 elif stop_on == 'delete':1022 elif stop_on == 'delete':
@@ -1799,8 +1799,7 @@
1799 else:1799 else:
1800 path = c.path[0]1800 path = c.path[0]
1801 to_file.write('\t* %s:\n' % (path,))1801 to_file.write('\t* %s:\n' % (path,))
1802 for c in revision.delta.renamed:1802 for c in revision.delta.renamed + revision.delta.copied:
1803 oldpath, newpath = c[:2]
1804 # For renamed files, show both the old and the new path1803 # For renamed files, show both the old and the new path
1805 to_file.write('\t* %s:\n\t* %s:\n' % (c.path[0], c.path[1]))1804 to_file.write('\t* %s:\n\t* %s:\n' % (c.path[0], c.path[1]))
1806 to_file.write('\n')1805 to_file.write('\n')
18071806
=== modified file 'breezy/plugins/fastimport/exporter.py'
--- breezy/plugins/fastimport/exporter.py 2019-06-29 19:50:18 +0000
+++ breezy/plugins/fastimport/exporter.py 2019-09-21 23:05:30 +0000
@@ -502,7 +502,7 @@
502502
503 # Record modifications503 # Record modifications
504 files_to_get = []504 files_to_get = []
505 for change in changes.added + my_modified + rd_modifies:505 for change in changes.added + changes.copied + my_modified + rd_modifies:
506 if change.kind[1] == 'file':506 if change.kind[1] == 'file':
507 files_to_get.append(507 files_to_get.append(
508 (change.path[1],508 (change.path[1],
509509
=== modified file 'breezy/plugins/fastimport/tests/test_generic_processor.py'
--- breezy/plugins/fastimport/tests/test_generic_processor.py 2019-06-29 19:50:18 +0000
+++ breezy/plugins/fastimport/tests/test_generic_processor.py 2019-09-21 23:05:30 +0000
@@ -125,7 +125,7 @@
125 that must have been changed in the delta.125 that must have been changed in the delta.
126 """126 """
127 renamed = changes.renamed127 renamed = changes.renamed
128 added = changes.added128 added = changes.added + changes.copied
129 removed = changes.removed129 removed = changes.removed
130 modified = changes.modified130 modified = changes.modified
131 kind_changed = changes.kind_changed131 kind_changed = changes.kind_changed
132132
=== modified file 'breezy/plugins/fastimport/tests/test_revision_store.py'
--- breezy/plugins/fastimport/tests/test_revision_store.py 2018-11-16 18:33:17 +0000
+++ breezy/plugins/fastimport/tests/test_revision_store.py 2019-09-21 23:05:30 +0000
@@ -141,13 +141,13 @@
141 changes = list(shim._delta_to_iter_changes())141 changes = list(shim._delta_to_iter_changes())
142 expected = [(b'foo-id', ('foo', 'bar/foo2'), False, (True, True),142 expected = [(b'foo-id', ('foo', 'bar/foo2'), False, (True, True),
143 (b'TREE_ROOT', b'bar-id'), ('foo', 'foo2'),143 (b'TREE_ROOT', b'bar-id'), ('foo', 'foo2'),
144 ('file', 'file'), (False, False)),144 ('file', 'file'), (False, False), False),
145 (b'baz-id', ('bar/baz', None), True, (True, False),145 (b'baz-id', ('bar/baz', None), True, (True, False),
146 (b'bar-id', None), ('baz', None),146 (b'bar-id', None), ('baz', None),
147 ('file', None), (False, None)),147 ('file', None), (False, None), False),
148 (b'link-id', (None, 'link'), True, (False, True),148 (b'link-id', (None, 'link'), True, (False, True),
149 (None, b'TREE_ROOT'), (None, 'link'),149 (None, b'TREE_ROOT'), (None, 'link'),
150 (None, 'symlink'), (None, False)),150 (None, 'symlink'), (None, False), False),
151 ]151 ]
152 # from pprint import pformat152 # from pprint import pformat
153 # self.assertEqualDiff(pformat(expected), pformat(changes))153 # self.assertEqualDiff(pformat(expected), pformat(changes))
154154
=== modified file 'breezy/plugins/upload/cmds.py'
--- breezy/plugins/upload/cmds.py 2019-08-11 13:33:45 +0000
+++ breezy/plugins/upload/cmds.py 2019-09-21 23:05:30 +0000
@@ -414,7 +414,7 @@
414 else:414 else:
415 raise NotImplementedError415 raise NotImplementedError
416416
417 for change in changes.added:417 for change in changes.added + changes.copied:
418 if self.is_ignored(change.path[1]):418 if self.is_ignored(change.path[1]):
419 if not self.quiet:419 if not self.quiet:
420 self.outf.write('Ignoring %s\n' % change.path[1])420 self.outf.write('Ignoring %s\n' % change.path[1])
421421
=== modified file 'breezy/plugins/weave_fmt/test_bzrdir.py'
--- breezy/plugins/weave_fmt/test_bzrdir.py 2018-11-16 18:33:17 +0000
+++ breezy/plugins/weave_fmt/test_bzrdir.py 2019-09-21 23:05:30 +0000
@@ -477,6 +477,7 @@
477 0 added477 0 added
478 0 removed478 0 removed
479 0 renamed479 0 renamed
480 0 copied
480 0 unknown481 0 unknown
481 0 ignored482 0 ignored
482 0 versioned subdirectories483 0 versioned subdirectories
@@ -509,6 +510,7 @@
509 0 added510 0 added
510 0 removed511 0 removed
511 0 renamed512 0 renamed
513 0 copied
512 0 unknown514 0 unknown
513 0 ignored515 0 ignored
514 0 versioned subdirectories516 0 versioned subdirectories
515517
=== modified file 'breezy/tests/blackbox/test_info.py'
--- breezy/tests/blackbox/test_info.py 2019-06-29 19:54:32 +0000
+++ breezy/tests/blackbox/test_info.py 2019-09-21 23:05:30 +0000
@@ -135,6 +135,7 @@
135 1 added135 1 added
136 0 removed136 0 removed
137 0 renamed137 0 renamed
138 0 copied
138 0 unknown139 0 unknown
139 0 ignored140 0 ignored
140 0 versioned subdirectories141 0 versioned subdirectories
@@ -169,6 +170,7 @@
169 1 added170 1 added
170 0 removed171 0 removed
171 0 renamed172 0 renamed
173 0 copied
172 0 unknown174 0 unknown
173 0 ignored175 0 ignored
174 0 versioned subdirectories176 0 versioned subdirectories
@@ -226,6 +228,7 @@
226 0 added228 0 added
227 0 removed229 0 removed
228 0 renamed230 0 renamed
231 0 copied
229 0 unknown232 0 unknown
230 0 ignored233 0 ignored
231 0 versioned subdirectories234 0 versioned subdirectories
@@ -275,6 +278,7 @@
275 0 added278 0 added
276 0 removed279 0 removed
277 0 renamed280 0 renamed
281 0 copied
278 0 unknown282 0 unknown
279 0 ignored283 0 ignored
280 0 versioned subdirectories284 0 versioned subdirectories
@@ -321,6 +325,7 @@
321 0 added325 0 added
322 0 removed326 0 removed
323 0 renamed327 0 renamed
328 0 copied
324 0 unknown329 0 unknown
325 0 ignored330 0 ignored
326 0 versioned subdirectories331 0 versioned subdirectories
@@ -367,6 +372,7 @@
367 0 added372 0 added
368 0 removed373 0 removed
369 0 renamed374 0 renamed
375 0 copied
370 0 unknown376 0 unknown
371 0 ignored377 0 ignored
372 0 versioned subdirectories378 0 versioned subdirectories
@@ -415,6 +421,7 @@
415 0 added421 0 added
416 0 removed422 0 removed
417 0 renamed423 0 renamed
424 0 copied
418 0 unknown425 0 unknown
419 0 ignored426 0 ignored
420 0 versioned subdirectories427 0 versioned subdirectories
@@ -459,6 +466,7 @@
459 0 added466 0 added
460 0 removed467 0 removed
461 0 renamed468 0 renamed
469 0 copied
462 0 unknown470 0 unknown
463 0 ignored471 0 ignored
464 0 versioned subdirectories472 0 versioned subdirectories
@@ -501,6 +509,7 @@
501 0 added509 0 added
502 0 removed510 0 removed
503 0 renamed511 0 renamed
512 0 copied
504 0 unknown513 0 unknown
505 0 ignored514 0 ignored
506 0 versioned subdirectories515 0 versioned subdirectories
@@ -543,6 +552,7 @@
543 0 added552 0 added
544 0 removed553 0 removed
545 0 renamed554 0 renamed
555 0 copied
546 0 unknown556 0 unknown
547 0 ignored557 0 ignored
548 0 versioned subdirectories558 0 versioned subdirectories
@@ -686,6 +696,7 @@
686 0 added696 0 added
687 0 removed697 0 removed
688 0 renamed698 0 renamed
699 0 copied
689 0 unknown700 0 unknown
690 0 ignored701 0 ignored
691 0 versioned subdirectories702 0 versioned subdirectories
@@ -729,6 +740,7 @@
729 0 added740 0 added
730 0 removed741 0 removed
731 0 renamed742 0 renamed
743 0 copied
732 0 unknown744 0 unknown
733 0 ignored745 0 ignored
734 0 versioned subdirectories746 0 versioned subdirectories
@@ -769,6 +781,7 @@
769 1 added781 1 added
770 0 removed782 0 removed
771 0 renamed783 0 renamed
784 0 copied
772 0 unknown785 0 unknown
773 0 ignored786 0 ignored
774 0 versioned subdirectories787 0 versioned subdirectories
@@ -816,6 +829,7 @@
816 0 added829 0 added
817 0 removed830 0 removed
818 0 renamed831 0 renamed
832 0 copied
819 0 unknown833 0 unknown
820 0 ignored834 0 ignored
821 0 versioned subdirectories835 0 versioned subdirectories
@@ -941,6 +955,7 @@
941 0 added955 0 added
942 0 removed956 0 removed
943 0 renamed957 0 renamed
958 0 copied
944 0 unknown959 0 unknown
945 0 ignored960 0 ignored
946 0 versioned subdirectories961 0 versioned subdirectories
@@ -984,6 +999,7 @@
984 0 added999 0 added
985 0 removed1000 0 removed
986 0 renamed1001 0 renamed
1002 0 copied
987 0 unknown1003 0 unknown
988 0 ignored1004 0 ignored
989 0 versioned subdirectories1005 0 versioned subdirectories
@@ -1028,6 +1044,7 @@
1028 0 added1044 0 added
1029 0 removed1045 0 removed
1030 0 renamed1046 0 renamed
1047 0 copied
1031 0 unknown1048 0 unknown
1032 0 ignored1049 0 ignored
1033 0 versioned subdirectories1050 0 versioned subdirectories
@@ -1070,6 +1087,7 @@
1070 0 added1087 0 added
1071 0 removed1088 0 removed
1072 0 renamed1089 0 renamed
1090 0 copied
1073 0 unknown1091 0 unknown
1074 0 ignored1092 0 ignored
1075 0 versioned subdirectories1093 0 versioned subdirectories
@@ -1165,6 +1183,7 @@
1165 0 added1183 0 added
1166 0 removed1184 0 removed
1167 0 renamed1185 0 renamed
1186 0 copied
1168 0 unknown1187 0 unknown
1169 0 ignored1188 0 ignored
1170 0 versioned subdirectories1189 0 versioned subdirectories
@@ -1348,6 +1367,7 @@
1348 0 added1367 0 added
1349 0 removed1368 0 removed
1350 0 renamed1369 0 renamed
1370 0 copied
1351 0 unknown1371 0 unknown
1352 0 ignored1372 0 ignored
1353 0 versioned subdirectories1373 0 versioned subdirectories
@@ -1498,6 +1518,7 @@
1498 0 added1518 0 added
1499 0 removed1519 0 removed
1500 0 renamed1520 0 renamed
1521 0 copied
1501 0 unknown1522 0 unknown
1502 0 ignored1523 0 ignored
1503 0 versioned subdirectories1524 0 versioned subdirectories
15041525
=== modified file 'breezy/tests/per_intertree/test_compare.py'
--- breezy/tests/per_intertree/test_compare.py 2019-08-11 13:33:45 +0000
+++ breezy/tests/per_intertree/test_compare.py 2019-09-21 23:05:30 +0000
@@ -82,6 +82,7 @@
82 self.assertEqual([], d.modified)82 self.assertEqual([], d.modified)
83 self.assertEqual([], d.removed)83 self.assertEqual([], d.removed)
84 self.assertEqual([], d.renamed)84 self.assertEqual([], d.renamed)
85 self.assertEqual([], d.copied)
85 self.assertEqual([], d.unchanged)86 self.assertEqual([], d.unchanged)
8687
87 def test_empty_to_abc_content(self):88 def test_empty_to_abc_content(self):
@@ -98,6 +99,7 @@
98 self.assertEqual([], d.modified)99 self.assertEqual([], d.modified)
99 self.assertEqual([], d.removed)100 self.assertEqual([], d.removed)
100 self.assertEqual([], d.renamed)101 self.assertEqual([], d.renamed)
102 self.assertEqual([], d.copied)
101 self.assertEqual([], d.unchanged)103 self.assertEqual([], d.unchanged)
102104
103 def test_dangling(self):105 def test_dangling(self):
@@ -125,6 +127,7 @@
125 self.assertEqual([], d.modified)127 self.assertEqual([], d.modified)
126 self.assertEqual([], d.removed)128 self.assertEqual([], d.removed)
127 self.assertEqual([], d.renamed)129 self.assertEqual([], d.renamed)
130 self.assertEqual([], d.copied)
128 self.assertEqual([], d.unchanged)131 self.assertEqual([], d.unchanged)
129132
130 def test_abc_content_to_empty(self):133 def test_abc_content_to_empty(self):
@@ -142,6 +145,7 @@
142 ('b/c', 'file'),145 ('b/c', 'file'),
143 ], [(c.path[0], c.kind[0]) for c in d.removed])146 ], [(c.path[0], c.kind[0]) for c in d.removed])
144 self.assertEqual([], d.renamed)147 self.assertEqual([], d.renamed)
148 self.assertEqual([], d.copied)
145 self.assertEqual([], d.unchanged)149 self.assertEqual([], d.unchanged)
146150
147 def test_content_modification(self):151 def test_content_modification(self):
@@ -159,6 +163,7 @@
159 for c in d.modified])163 for c in d.modified])
160 self.assertEqual([], d.removed)164 self.assertEqual([], d.removed)
161 self.assertEqual([], d.renamed)165 self.assertEqual([], d.renamed)
166 self.assertEqual([], d.copied)
162 self.assertEqual([], d.unchanged)167 self.assertEqual([], d.unchanged)
163168
164 def test_meta_modification(self):169 def test_meta_modification(self):
@@ -176,6 +181,7 @@
176 for c in d.modified])181 for c in d.modified])
177 self.assertEqual([], d.removed)182 self.assertEqual([], d.removed)
178 self.assertEqual([], d.renamed)183 self.assertEqual([], d.renamed)
184 self.assertEqual([], d.copied)
179 self.assertEqual([], d.unchanged)185 self.assertEqual([], d.unchanged)
180186
181 def test_file_rename(self):187 def test_file_rename(self):
@@ -189,6 +195,7 @@
189 self.assertEqual([], d.added)195 self.assertEqual([], d.added)
190 self.assertEqual([], d.modified)196 self.assertEqual([], d.modified)
191 self.assertEqual([], d.removed)197 self.assertEqual([], d.removed)
198 self.assertEqual([], d.copied)
192 self.assertEqual(199 self.assertEqual(
193 [('a', 'd', 'file', False, False)],200 [('a', 'd', 'file', False, False)],
194 [(c.path[0], c.path[1], c.kind[1], c.changed_content, c.meta_modified())201 [(c.path[0], c.path[1], c.kind[1], c.changed_content, c.meta_modified())
@@ -206,6 +213,7 @@
206 self.assertEqual([], d.added)213 self.assertEqual([], d.added)
207 self.assertEqual([], d.modified)214 self.assertEqual([], d.modified)
208 self.assertEqual([], d.removed)215 self.assertEqual([], d.removed)
216 self.assertEqual([], d.copied)
209 self.assertEqual(217 self.assertEqual(
210 [('a', 'd', 'file', True, False)],218 [('a', 'd', 'file', True, False)],
211 [(c.path[0], c.path[1], c.kind[1], c.changed_content, c.meta_modified())219 [(c.path[0], c.path[1], c.kind[1], c.changed_content, c.meta_modified())
@@ -227,6 +235,7 @@
227 [('b/c', 'e', 'file', False, True)],235 [('b/c', 'e', 'file', False, True)],
228 [(c.path[0], c.path[1], c.kind[1], c.changed_content, c.meta_modified())236 [(c.path[0], c.path[1], c.kind[1], c.changed_content, c.meta_modified())
229 for c in d.renamed])237 for c in d.renamed])
238 self.assertEqual([], d.copied)
230 self.assertEqual([], d.unchanged)239 self.assertEqual([], d.unchanged)
231240
232 def test_empty_to_abc_content_a_only(self):241 def test_empty_to_abc_content_a_only(self):
@@ -243,6 +252,7 @@
243 self.assertEqual([], d.modified)252 self.assertEqual([], d.modified)
244 self.assertEqual([], d.removed)253 self.assertEqual([], d.removed)
245 self.assertEqual([], d.renamed)254 self.assertEqual([], d.renamed)
255 self.assertEqual([], d.copied)
246 self.assertEqual([], d.unchanged)256 self.assertEqual([], d.unchanged)
247257
248 def test_empty_to_abc_content_a_and_c_only(self):258 def test_empty_to_abc_content_a_and_c_only(self):
@@ -261,6 +271,7 @@
261 self.assertEqual([], d.modified)271 self.assertEqual([], d.modified)
262 self.assertEqual([], d.removed)272 self.assertEqual([], d.removed)
263 self.assertEqual([], d.renamed)273 self.assertEqual([], d.renamed)
274 self.assertEqual([], d.copied)
264 self.assertEqual([], d.unchanged)275 self.assertEqual([], d.unchanged)
265276
266 def test_empty_to_abc_content_c_only(self):277 def test_empty_to_abc_content_c_only(self):
@@ -277,6 +288,7 @@
277 self.assertEqual([], d.modified)288 self.assertEqual([], d.modified)
278 self.assertEqual([], d.removed)289 self.assertEqual([], d.removed)
279 self.assertEqual([], d.renamed)290 self.assertEqual([], d.renamed)
291 self.assertEqual([], d.copied)
280 self.assertEqual([], d.unchanged)292 self.assertEqual([], d.unchanged)
281293
282 def test_empty_to_abc_content_b_only(self):294 def test_empty_to_abc_content_b_only(self):
@@ -293,6 +305,7 @@
293 self.assertEqual([], d.modified)305 self.assertEqual([], d.modified)
294 self.assertEqual([], d.removed)306 self.assertEqual([], d.removed)
295 self.assertEqual([], d.renamed)307 self.assertEqual([], d.renamed)
308 self.assertEqual([], d.copied)
296 self.assertEqual([], d.unchanged)309 self.assertEqual([], d.unchanged)
297310
298 def test_unchanged_with_renames_and_modifications(self):311 def test_unchanged_with_renames_and_modifications(self):
@@ -312,6 +325,7 @@
312 self.assertEqual(325 self.assertEqual(
313 [(u'b', 'directory'), (u'b/c', 'file')],326 [(u'b', 'directory'), (u'b/c', 'file')],
314 [(c.path[0], c.kind[0]) for c in d.unchanged])327 [(c.path[0], c.kind[0]) for c in d.unchanged])
328 self.assertEqual([], d.copied)
315329
316 def test_extra_trees_finds_ids(self):330 def test_extra_trees_finds_ids(self):
317 """Ask for a delta between two trees with a path present in a third."""331 """Ask for a delta between two trees with a path present in a third."""
@@ -345,6 +359,7 @@
345 [(c.path[1], c.kind[1], c.changed_content, c.meta_modified()) for c in d.modified])359 [(c.path[1], c.kind[1], c.changed_content, c.meta_modified()) for c in d.modified])
346 self.assertEqual([], d.removed)360 self.assertEqual([], d.removed)
347 self.assertEqual([], d.renamed)361 self.assertEqual([], d.renamed)
362 self.assertEqual([], d.copied)
348 self.assertEqual([], d.unchanged)363 self.assertEqual([], d.unchanged)
349364
350 def test_require_versioned(self):365 def test_require_versioned(self):
@@ -380,6 +395,7 @@
380 for c in d.modified])395 for c in d.modified])
381 self.assertEqual([], d.removed)396 self.assertEqual([], d.removed)
382 self.assertEqual([], d.renamed)397 self.assertEqual([], d.renamed)
398 self.assertEqual([], d.copied)
383 self.assertEqual([], d.unchanged)399 self.assertEqual([], d.unchanged)
384 self.assertEqual([], d.unversioned)400 self.assertEqual([], d.unversioned)
385401
@@ -400,6 +416,7 @@
400 self.assertEqual([], d.modified)416 self.assertEqual([], d.modified)
401 self.assertEqual([], d.removed)417 self.assertEqual([], d.removed)
402 self.assertEqual([], d.renamed)418 self.assertEqual([], d.renamed)
419 self.assertEqual([], d.copied)
403 self.assertEqual([], d.unchanged)420 self.assertEqual([], d.unchanged)
404 expected_unversioned = [(u'dir', 'directory'),421 expected_unversioned = [(u'dir', 'directory'),
405 (u'file', 'file')]422 (u'file', 'file')]
@@ -765,7 +782,7 @@
765 root_id = tree1.path2id('')782 root_id = tree1.path2id('')
766 self.assertEqual([(b'a-id', ('a', 'a'), True, (True, True),783 self.assertEqual([(b'a-id', ('a', 'a'), True, (True, True),
767 (root_id, root_id), ('a', 'a'),784 (root_id, root_id), ('a', 'a'),
768 ('file', 'file'), (False, False))],785 ('file', 'file'), (False, False), False)],
769 self.do_iter_changes(tree1, tree2))786 self.do_iter_changes(tree1, tree2))
770 self.check_has_changes(True, tree1, tree2)787 self.check_has_changes(True, tree1, tree2)
771788
@@ -777,7 +794,7 @@
777 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)794 tree1, tree2 = self.mutable_trees_to_test_trees(self, tree1, tree2)
778 self.assertEqual([(b'c-id', ('b/c', 'b/c'), False, (True, True),795 self.assertEqual([(b'c-id', ('b/c', 'b/c'), False, (True, True),
779 (b'b-id', b'b-id'), ('c', 'c'), ('file', 'file'),796 (b'b-id', b'b-id'), ('c', 'c'), ('file', 'file'),
780 (False, True))],797 (False, True), False)],
781 self.do_iter_changes(tree1, tree2))798 self.do_iter_changes(tree1, tree2))
782799
783 def test_empty_dir(self):800 def test_empty_dir(self):
@@ -803,7 +820,7 @@
803 root_id = tree1.path2id('')820 root_id = tree1.path2id('')
804 self.assertEqual([(tree1.path2id('a'), ('a', 'd'), False, (True, True),821 self.assertEqual([(tree1.path2id('a'), ('a', 'd'), False, (True, True),
805 (root_id, root_id), ('a', 'd'), ('file', 'file'),822 (root_id, root_id), ('a', 'd'), ('file', 'file'),
806 (False, False))],823 (False, False), False)],
807 self.do_iter_changes(tree1, tree2))824 self.do_iter_changes(tree1, tree2))
808825
809 def test_file_rename_and_modification(self):826 def test_file_rename_and_modification(self):
@@ -815,7 +832,7 @@
815 root_id = tree1.path2id('')832 root_id = tree1.path2id('')
816 self.assertEqual([(b'a-id', ('a', 'd'), True, (True, True),833 self.assertEqual([(b'a-id', ('a', 'd'), True, (True, True),
817 (root_id, root_id), ('a', 'd'), ('file', 'file'),834 (root_id, root_id), ('a', 'd'), ('file', 'file'),
818 (False, False))],835 (False, False), False)],
819 self.do_iter_changes(tree1, tree2))836 self.do_iter_changes(tree1, tree2))
820837
821 def test_specific_content_modification_grabs_parents(self):838 def test_specific_content_modification_grabs_parents(self):
@@ -1030,7 +1047,7 @@
1030 root_id = tree1.path2id('')1047 root_id = tree1.path2id('')
1031 self.assertEqual([(b'c-id', ('b/c', 'e'), False, (True, True),1048 self.assertEqual([(b'c-id', ('b/c', 'e'), False, (True, True),
1032 (b'b-id', root_id), ('c', 'e'), ('file', 'file'),1049 (b'b-id', root_id), ('c', 'e'), ('file', 'file'),
1033 (False, True))],1050 (False, True), False)],
1034 self.do_iter_changes(tree1, tree2))1051 self.do_iter_changes(tree1, tree2))
10351052
1036 def test_file_becomes_unversionable_bug_438569(self):1053 def test_file_becomes_unversionable_bug_438569(self):
10371054
=== modified file 'breezy/tests/per_repository_vf/test_fileid_involved.py'
--- breezy/tests/per_repository_vf/test_fileid_involved.py 2019-08-11 13:33:45 +0000
+++ breezy/tests/per_repository_vf/test_fileid_involved.py 2019-09-21 23:05:30 +0000
@@ -138,7 +138,8 @@
138138
139 l2 = [change.file_id for change in delta.added] + \139 l2 = [change.file_id for change in delta.added] + \
140 [change.file_id for change in delta.renamed] + \140 [change.file_id for change in delta.renamed] + \
141 [change.file_id for change in delta.modified]141 [change.file_id for change in delta.modified] + \
142 [change.file_id for change in delta.copied]
142 return set(l2)143 return set(l2)
143144
144145
145146
=== modified file 'breezy/tests/per_workingtree/test_changes_from.py'
--- breezy/tests/per_workingtree/test_changes_from.py 2018-11-11 04:08:32 +0000
+++ breezy/tests/per_workingtree/test_changes_from.py 2019-09-21 23:05:30 +0000
@@ -37,6 +37,7 @@
37 self.assertEqual([], d.added)37 self.assertEqual([], d.added)
38 self.assertEqual([], d.removed)38 self.assertEqual([], d.removed)
39 self.assertEqual([], d.renamed)39 self.assertEqual([], d.renamed)
40 self.assertEqual([], d.copied)
40 self.assertEqual([], d.modified)41 self.assertEqual([], d.modified)
4142
42 def test_unknown_specific_file(self):43 def test_unknown_specific_file(self):
@@ -51,4 +52,5 @@
51 self.assertEqual([], d.added)52 self.assertEqual([], d.added)
52 self.assertEqual([], d.removed)53 self.assertEqual([], d.removed)
53 self.assertEqual([], d.renamed)54 self.assertEqual([], d.renamed)
55 self.assertEqual([], d.copied)
54 self.assertEqual([], d.modified)56 self.assertEqual([], d.modified)
5557
=== modified file 'breezy/tests/test_delta.py'
--- breezy/tests/test_delta.py 2019-06-29 19:50:18 +0000
+++ breezy/tests/test_delta.py 2019-09-21 23:05:30 +0000
@@ -32,10 +32,10 @@
32 def __init__(self):32 def __init__(self):
33 self.calls = []33 self.calls = []
3434
35 def report(self, path, versioned, renamed, modified, exe_change,35 def report(self, path, versioned, renamed, copied, modified, exe_change,
36 kind):36 kind):
37 self.calls.append(37 self.calls.append(
38 (path, versioned, renamed, modified, exe_change, kind))38 (path, versioned, renamed, copied, modified, exe_change, kind))
3939
4040
41class TestReportChanges(tests.TestCase):41class TestReportChanges(tests.TestCase):
@@ -43,7 +43,7 @@
4343
44 def assertReport(self, expected, file_id=b'fid', path='path',44 def assertReport(self, expected, file_id=b'fid', path='path',
45 versioned_change='unchanged', renamed=False,45 versioned_change='unchanged', renamed=False,
46 modified='unchanged', exe_change=False,46 copied=False, modified='unchanged', exe_change=False,
47 kind=('file', 'file'), old_path=None,47 kind=('file', 'file'), old_path=None,
48 unversioned_filter=None, view_info=None):48 unversioned_filter=None, view_info=None):
49 if expected is None:49 if expected is None:
@@ -52,12 +52,12 @@
52 expected_lines = [expected]52 expected_lines = [expected]
53 self.assertReportLines(expected_lines, file_id, path,53 self.assertReportLines(expected_lines, file_id, path,
54 versioned_change, renamed,54 versioned_change, renamed,
55 modified, exe_change,55 copied, modified, exe_change,
56 kind, old_path,56 kind, old_path,
57 unversioned_filter, view_info)57 unversioned_filter, view_info)
5858
59 def assertReportLines(self, expected_lines, file_id=b'fid', path='path',59 def assertReportLines(self, expected_lines, file_id=b'fid', path='path',
60 versioned_change='unchanged', renamed=False,60 versioned_change='unchanged', renamed=False, copied=False,
61 modified='unchanged', exe_change=False,61 modified='unchanged', exe_change=False,
62 kind=('file', 'file'), old_path=None,62 kind=('file', 'file'), old_path=None,
63 unversioned_filter=None, view_info=None):63 unversioned_filter=None, view_info=None):
@@ -65,9 +65,10 @@
6565
66 def result_line(format, *args):66 def result_line(format, *args):
67 result.append(format % args)67 result.append(format % args)
68 reporter = _mod_delta._ChangeReporter(result_line,68 reporter = _mod_delta._ChangeReporter(
69 unversioned_filter=unversioned_filter, view_info=view_info)69 result_line, unversioned_filter=unversioned_filter,
70 reporter.report((old_path, path), versioned_change, renamed,70 view_info=view_info)
71 reporter.report((old_path, path), versioned_change, renamed, copied,
71 modified, exe_change, kind)72 modified, exe_change, kind)
72 if expected_lines is not None:73 if expected_lines is not None:
73 self.assertEqualDiff('\n'.join(expected_lines), '\n'.join(result))74 self.assertEqualDiff('\n'.join(expected_lines), '\n'.join(result))
@@ -158,20 +159,22 @@
158 executable=(False, False),159 executable=(False, False),
159 versioned_change='unchanged',160 versioned_change='unchanged',
160 renamed=False,161 renamed=False,
162 copied=False,
161 modified='unchanged',163 modified='unchanged',
162 exe_change=False):164 exe_change=False):
163 reporter = InstrumentedReporter()165 reporter = InstrumentedReporter()
164 _mod_delta.report_changes([166 _mod_delta.report_changes([
165 TreeChange(167 TreeChange(
166 file_id, paths, content_change, versioned, parent_id,168 file_id, paths, content_change, versioned, parent_id,
167 name, kind, executable)], reporter)169 name, kind, executable, copied)], reporter)
168 output = reporter.calls[0]170 output = reporter.calls[0]
169 self.assertEqual(paths, output[0])171 self.assertEqual(paths, output[0])
170 self.assertEqual(versioned_change, output[1])172 self.assertEqual(versioned_change, output[1])
171 self.assertEqual(renamed, output[2])173 self.assertEqual(renamed, output[2])
172 self.assertEqual(modified, output[3])174 self.assertEqual(copied, output[3])
173 self.assertEqual(exe_change, output[4])175 self.assertEqual(modified, output[4])
174 self.assertEqual(kind, output[5])176 self.assertEqual(exe_change, output[5])
177 self.assertEqual(kind, output[6])
175178
176 def test_report_changes(self):179 def test_report_changes(self):
177 """Test change detection of report_changes"""180 """Test change detection of report_changes"""
178181
=== modified file 'breezy/tests/test_missing.py'
--- breezy/tests/test_missing.py 2019-06-29 19:50:18 +0000
+++ breezy/tests/test_missing.py 2019-09-21 23:05:30 +0000
@@ -106,6 +106,7 @@
106 self.assertEqual([('b', 'file')], [(c.path[1], c.kind[1]) for c in delta0.added])106 self.assertEqual([('b', 'file')], [(c.path[1], c.kind[1]) for c in delta0.added])
107 self.assertEqual([], delta0.removed)107 self.assertEqual([], delta0.removed)
108 self.assertEqual([], delta0.renamed)108 self.assertEqual([], delta0.renamed)
109 self.assertEqual([], delta0.copied)
109 self.assertEqual([], delta0.modified)110 self.assertEqual([], delta0.modified)
110111
111 delta1 = r1.delta112 delta1 = r1.delta
@@ -113,6 +114,7 @@
113 self.assertEqual([], delta1.added)114 self.assertEqual([], delta1.added)
114 self.assertEqual([('a', 'file')], [(c.path[0], c.kind[0]) for c in delta1.removed])115 self.assertEqual([('a', 'file')], [(c.path[0], c.kind[0]) for c in delta1.removed])
115 self.assertEqual([], delta1.renamed)116 self.assertEqual([], delta1.renamed)
117 self.assertEqual([], delta1.copied)
116 self.assertEqual([], delta1.modified)118 self.assertEqual([], delta1.modified)
117119
118 delta2 = r2.delta120 delta2 = r2.delta
@@ -120,6 +122,7 @@
120 self.assertEqual([], delta2.added)122 self.assertEqual([], delta2.added)
121 self.assertEqual([], delta2.removed)123 self.assertEqual([], delta2.removed)
122 self.assertEqual([], delta2.renamed)124 self.assertEqual([], delta2.renamed)
125 self.assertEqual([], delta2.copied)
123 self.assertEqual(126 self.assertEqual(
124 [('b', 'file', True, False)],127 [('b', 'file', True, False)],
125 [(c.path[1], c.kind[1], c.changed_content, c.meta_modified()) for c in delta2.modified])128 [(c.path[1], c.kind[1], c.changed_content, c.meta_modified()) for c in delta2.modified])
@@ -127,6 +130,7 @@
127 delta3 = r3.delta130 delta3 = r3.delta
128 self.assertNotEqual(None, delta3)131 self.assertNotEqual(None, delta3)
129 self.assertEqual([], delta3.added)132 self.assertEqual([], delta3.added)
133 self.assertEqual([], delta3.copied)
130 self.assertEqual([], delta3.removed)134 self.assertEqual([], delta3.removed)
131 self.assertEqual(135 self.assertEqual(
132 [('b', 'c', 'file', False, False)],136 [('b', 'c', 'file', False, False)],
133137
=== modified file 'breezy/tests/test_transform.py'
--- breezy/tests/test_transform.py 2019-06-29 13:16:26 +0000
+++ breezy/tests/test_transform.py 2019-09-21 23:05:30 +0000
@@ -1147,12 +1147,14 @@
1147 self.assertEqual([(b'id-1', ('old', None), False, (True, False),1147 self.assertEqual([(b'id-1', ('old', None), False, (True, False),
1148 (b'eert_toor', b'eert_toor'),1148 (b'eert_toor', b'eert_toor'),
1149 ('old', 'old'), ('file', 'file'),1149 ('old', 'old'), ('file', 'file'),
1150 (True, True))], list(transform.iter_changes()))1150 (True, True), False)],
1151 list(transform.iter_changes()))
1151 transform.new_directory('new', root, b'id-1')1152 transform.new_directory('new', root, b'id-1')
1152 self.assertEqual([(b'id-1', ('old', 'new'), True, (True, True),1153 self.assertEqual([(b'id-1', ('old', 'new'), True, (True, True),
1153 (b'eert_toor', b'eert_toor'), ('old', 'new'),1154 (b'eert_toor', b'eert_toor'), ('old', 'new'),
1154 ('file', 'directory'),1155 ('file', 'directory'),
1155 (True, False))], list(transform.iter_changes()))1156 (True, False), False)],
1157 list(transform.iter_changes()))
1156 finally:1158 finally:
1157 transform.finalize()1159 transform.finalize()
11581160
@@ -1168,7 +1170,7 @@
1168 self.assertEqual([(b'id-1', (None, 'old'), False, (False, True),1170 self.assertEqual([(b'id-1', (None, 'old'), False, (False, True),
1169 (b'eert_toor', b'eert_toor'),1171 (b'eert_toor', b'eert_toor'),
1170 ('old', 'old'), ('file', 'file'),1172 ('old', 'old'), ('file', 'file'),
1171 (False, False))],1173 (False, False), False)],
1172 list(transform.iter_changes()))1174 list(transform.iter_changes()))
1173 finally:1175 finally:
1174 transform.finalize()1176 transform.finalize()
@@ -1192,7 +1194,7 @@
1192 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),1194 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),
1193 (b'eert_toor', b'eert_toor'),1195 (b'eert_toor', b'eert_toor'),
1194 ('old', 'old'), ('file', None),1196 ('old', 'old'), ('file', None),
1195 (False, False))],1197 (False, False), False)],
1196 list(transform.iter_changes()))1198 list(transform.iter_changes()))
11971199
1198 # content change1200 # content change
@@ -1200,13 +1202,13 @@
1200 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),1202 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),
1201 (b'eert_toor', b'eert_toor'),1203 (b'eert_toor', b'eert_toor'),
1202 ('old', 'old'), ('file', 'file'),1204 ('old', 'old'), ('file', 'file'),
1203 (False, False))],1205 (False, False), False)],
1204 list(transform.iter_changes()))1206 list(transform.iter_changes()))
1205 transform.cancel_deletion(old)1207 transform.cancel_deletion(old)
1206 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),1208 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),
1207 (b'eert_toor', b'eert_toor'),1209 (b'eert_toor', b'eert_toor'),
1208 ('old', 'old'), ('file', 'file'),1210 ('old', 'old'), ('file', 'file'),
1209 (False, False))],1211 (False, False), False)],
1210 list(transform.iter_changes()))1212 list(transform.iter_changes()))
1211 transform.cancel_creation(old)1213 transform.cancel_creation(old)
12121214
@@ -1218,7 +1220,7 @@
1218 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),1220 self.assertEqual([(b'id-1', ('old', 'old'), True, (True, True),
1219 (b'eert_toor', b'eert_toor'),1221 (b'eert_toor', b'eert_toor'),
1220 ('old', 'old'), ('file', 'file'),1222 ('old', 'old'), ('file', 'file'),
1221 (False, False))],1223 (False, False), False)],
1222 list(transform.iter_changes()))1224 list(transform.iter_changes()))
1223 transform.cancel_versioning(new)1225 transform.cancel_versioning(new)
1224 transform._removed_id = set()1226 transform._removed_id = set()
@@ -1229,7 +1231,7 @@
1229 self.assertEqual([(b'id-1', ('old', 'old'), False, (True, True),1231 self.assertEqual([(b'id-1', ('old', 'old'), False, (True, True),
1230 (b'eert_toor', b'eert_toor'),1232 (b'eert_toor', b'eert_toor'),
1231 ('old', 'old'), ('file', 'file'),1233 ('old', 'old'), ('file', 'file'),
1232 (False, True))],1234 (False, True), False)],
1233 list(transform.iter_changes()))1235 list(transform.iter_changes()))
1234 transform.set_executability(None, old)1236 transform.set_executability(None, old)
12351237
@@ -1240,7 +1242,7 @@
1240 self.assertEqual([(b'id-1', ('old', 'new'), False, (True, True),1242 self.assertEqual([(b'id-1', ('old', 'new'), False, (True, True),
1241 (b'eert_toor', b'eert_toor'),1243 (b'eert_toor', b'eert_toor'),
1242 ('old', 'new'), ('file', 'file'),1244 ('old', 'new'), ('file', 'file'),
1243 (False, False))],1245 (False, False), False)],
1244 list(transform.iter_changes()))1246 list(transform.iter_changes()))
1245 transform._new_name = {}1247 transform._new_name = {}
12461248
@@ -1251,7 +1253,7 @@
1251 self.assertEqual([(b'id-1', ('old', 'subdir/old'), False,1253 self.assertEqual([(b'id-1', ('old', 'subdir/old'), False,
1252 (True, True), (b'eert_toor',1254 (True, True), (b'eert_toor',
1253 b'subdir-id'), ('old', 'old'),1255 b'subdir-id'), ('old', 'old'),
1254 ('file', 'file'), (False, False))],1256 ('file', 'file'), (False, False), False)],
1255 list(transform.iter_changes()))1257 list(transform.iter_changes()))
1256 transform._new_path = {}1258 transform._new_path = {}
12571259
@@ -1277,10 +1279,10 @@
1277 self.assertEqual(1279 self.assertEqual(
1278 [(b'id-1', (u'file1', u'file1'), True, (True, True),1280 [(b'id-1', (u'file1', u'file1'), True, (True, True),
1279 (b'eert_toor', b'eert_toor'), ('file1', u'file1'),1281 (b'eert_toor', b'eert_toor'), ('file1', u'file1'),
1280 ('file', None), (False, False)),1282 ('file', None), (False, False), False),
1281 (b'id-2', (u'file2', u'file2'), False, (True, True),1283 (b'id-2', (u'file2', u'file2'), False, (True, True),
1282 (b'eert_toor', b'eert_toor'), ('file2', u'file2'),1284 (b'eert_toor', b'eert_toor'), ('file2', u'file2'),
1283 ('file', 'file'), (False, True))],1285 ('file', 'file'), (False, True), False)],
1284 list(transform.iter_changes()))1286 list(transform.iter_changes()))
1285 finally:1287 finally:
1286 transform.finalize()1288 transform.finalize()
@@ -1303,7 +1305,7 @@
1303 (True, True),1305 (True, True),
1304 (b'toor_eert', b'toor_eert'),1306 (b'toor_eert', b'toor_eert'),
1305 ('floater', 'flitter'),1307 ('floater', 'flitter'),
1306 (None, None), (False, False))],1308 (None, None), (False, False), False)],
1307 list(transform.iter_changes()))1309 list(transform.iter_changes()))
1308 finally:1310 finally:
1309 transform.finalize()1311 transform.finalize()
@@ -2767,9 +2769,9 @@
27672769
2768A_ENTRY = (b'a-id', ('a', 'a'), True, (True, True),2770A_ENTRY = (b'a-id', ('a', 'a'), True, (True, True),
2769 (b'TREE_ROOT', b'TREE_ROOT'), ('a', 'a'), ('file', 'file'),2771 (b'TREE_ROOT', b'TREE_ROOT'), ('a', 'a'), ('file', 'file'),
2770 (False, False))2772 (False, False), False)
2771ROOT_ENTRY = (b'TREE_ROOT', ('', ''), False, (True, True), (None, None),2773ROOT_ENTRY = (b'TREE_ROOT', ('', ''), False, (True, True), (None, None),
2772 ('', ''), ('directory', 'directory'), (False, False))2774 ('', ''), ('directory', 'directory'), (False, False), False)
27732775
27742776
2775class TestTransformPreview(tests.TestCaseWithTransport):2777class TestTransformPreview(tests.TestCaseWithTransport):
@@ -2875,7 +2877,7 @@
2875 root = revision_tree.path2id('')2877 root = revision_tree.path2id('')
2876 self.assertEqual([(b'a-id', ('a', 'a'), True, (True, True),2878 self.assertEqual([(b'a-id', ('a', 'a'), True, (True, True),
2877 (root, root), ('a', 'a'), ('file', 'file'),2879 (root, root), ('a', 'a'), ('file', 'file'),
2878 (False, False))],2880 (False, False), False)],
2879 list(preview_tree.iter_changes(revision_tree)))2881 list(preview_tree.iter_changes(revision_tree)))
28802882
2881 def test_include_unchanged_succeeds(self):2883 def test_include_unchanged_succeeds(self):
28822884
=== modified file 'breezy/tests/test_workingtree_4.py'
--- breezy/tests/test_workingtree_4.py 2019-09-21 17:08:09 +0000
+++ breezy/tests/test_workingtree_4.py 2019-09-21 23:05:30 +0000
@@ -592,9 +592,9 @@
592 (None, b'root'),592 (None, b'root'),
593 (None, u'dir'),593 (None, u'dir'),
594 (None, 'directory'),594 (None, 'directory'),
595 (None, False)),595 (None, False), False),
596 (b'root', (None, u''), True, (False, True), (None, None),596 (b'root', (None, u''), True, (False, True), (None, None),
597 (None, u''), (None, 'directory'), (None, 0))]597 (None, u''), (None, 'directory'), (None, False), False)]
598 self.assertEqual(598 self.assertEqual(
599 expected,599 expected,
600 list(tree.iter_changes(tree.basis_tree(), specific_files=['dir'])))600 list(tree.iter_changes(tree.basis_tree(), specific_files=['dir'])))
@@ -613,7 +613,7 @@
613 (b'root', b'root'),613 (b'root', b'root'),
614 ('dir', 'dir'),614 ('dir', 'dir'),
615 ('directory', None),615 ('directory', None),
616 (False, False))]616 (False, False), False)]
617 self.assertEqual(expected, list(tree.iter_changes(tree.basis_tree())))617 self.assertEqual(expected, list(tree.iter_changes(tree.basis_tree())))
618 tree.unlock()618 tree.unlock()
619619
620620
=== modified file 'breezy/tree.py'
--- breezy/tree.py 2019-09-21 17:08:09 +0000
+++ breezy/tree.py 2019-09-21 23:05:30 +0000
@@ -134,10 +134,10 @@
134 """Describes the changes between the same item in two different trees."""134 """Describes the changes between the same item in two different trees."""
135135
136 __slots__ = ['file_id', 'path', 'changed_content', 'versioned', 'parent_id',136 __slots__ = ['file_id', 'path', 'changed_content', 'versioned', 'parent_id',
137 'name', 'kind', 'executable']137 'name', 'kind', 'executable', 'copied']
138138
139 def __init__(self, file_id, path, changed_content, versioned, parent_id,139 def __init__(self, file_id, path, changed_content, versioned, parent_id,
140 name, kind, executable):140 name, kind, executable, copied=False):
141 self.file_id = file_id141 self.file_id = file_id
142 self.path = path142 self.path = path
143 self.changed_content = changed_content143 self.changed_content = changed_content
@@ -146,6 +146,7 @@
146 self.name = name146 self.name = name
147 self.kind = kind147 self.kind = kind
148 self.executable = executable148 self.executable = executable
149 self.copied = copied
149150
150 def __repr__(self):151 def __repr__(self):
151 return "%s%r" % (self.__class__.__name__, self._as_tuple())152 return "%s%r" % (self.__class__.__name__, self._as_tuple())
@@ -155,7 +156,7 @@
155156
156 def _as_tuple(self):157 def _as_tuple(self):
157 return (self.file_id, self.path, self.changed_content, self.versioned,158 return (self.file_id, self.path, self.changed_content, self.versioned,
158 self.parent_id, self.name, self.kind, self.executable)159 self.parent_id, self.name, self.kind, self.executable, self.copied)
159160
160 def __eq__(self, other):161 def __eq__(self, other):
161 if isinstance(other, TreeChange):162 if isinstance(other, TreeChange):
@@ -180,7 +181,8 @@
180 self.file_id, (self.path[0], None), self.changed_content,181 self.file_id, (self.path[0], None), self.changed_content,
181 (self.versioned[0], None), (self.parent_id[0], None),182 (self.versioned[0], None), (self.parent_id[0], None),
182 (self.name[0], None), (self.kind[0], None),183 (self.name[0], None), (self.kind[0], None),
183 (self.executable[0], None))184 (self.executable[0], None),
185 copied=False)
184186
185187
186class Tree(object):188class Tree(object):
187189
=== modified file 'breezy/version_info_formats/__init__.py'
--- breezy/version_info_formats/__init__.py 2019-06-29 19:50:18 +0000
+++ breezy/version_info_formats/__init__.py 2019-09-21 23:05:30 +0000
@@ -134,6 +134,10 @@
134 self._clean = False134 self._clean = False
135 self._file_revisions[change.path[1]] = u'renamed from %s' % (135 self._file_revisions[change.path[1]] = u'renamed from %s' % (
136 change.path[0],)136 change.path[0],)
137 for change in delta.copied:
138 self._clean = False
139 self._file_revisions[change.path[1]] = u'copied from %s' % (
140 change.path[0],)
137 for change in delta.modified:141 for change in delta.modified:
138 self._clean = False142 self._clean = False
139 self._file_revisions[change.path[1]] = 'modified'143 self._file_revisions[change.path[1]] = 'modified'

Subscribers

People subscribed via source and target branches