Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | no longer in the source branch. |
Merge reported by: | Vincent Ladeuil |
Merged at revision: | not available |
Proposed branch: | lp:~jelmer/brz/plan-merge |
Merge into: | lp:brz |
Diff against target: |
318 lines (+84/-74) 6 files modified
breezy/builtins.py (+10/-1) breezy/bzr/inventorytree.py (+57/-0) breezy/bzr/versionedfile.py (+1/-1) breezy/merge.py (+14/-15) breezy/tests/per_tree/test_tree.py (+2/-0) breezy/tree.py (+0/-57) |
To merge this branch: | bzr merge lp:~jelmer/brz/plan-merge |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman | Approve | ||
Review via email: mp+339452@code.launchpad.net |
Commit message
Move Tree.plan_
Description of the change
Move Tree.plan_
Also, mark merge types that require a merge plan as such so that 'bzr merge'
can error out when trying to use --weave or --lca merge with git trees.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'breezy/builtins.py' | |||
2 | --- breezy/builtins.py 2018-02-21 13:19:44 +0000 | |||
3 | +++ breezy/builtins.py 2018-02-24 18:57:47 +0000 | |||
4 | @@ -4381,7 +4381,7 @@ | |||
5 | 4381 | committed to record the result of the merge. | 4381 | committed to record the result of the merge. |
6 | 4382 | 4382 | ||
7 | 4383 | merge refuses to run if there are any uncommitted changes, unless | 4383 | merge refuses to run if there are any uncommitted changes, unless |
9 | 4384 | --force is given. If --force is given, then the changes from the source | 4384 | --force is given. If --force is given, then the changes from the source |
10 | 4385 | will be merged with the current working tree, including any uncommitted | 4385 | will be merged with the current working tree, including any uncommitted |
11 | 4386 | changes in the tree. The --force option can also be used to create a | 4386 | changes in the tree. The --force option can also be used to create a |
12 | 4387 | merge revision which has more than two parents. | 4387 | merge revision which has more than two parents. |
13 | @@ -4610,6 +4610,15 @@ | |||
14 | 4610 | raise errors.BzrCommandError(gettext("Cannot do conflict reduction and" | 4610 | raise errors.BzrCommandError(gettext("Cannot do conflict reduction and" |
15 | 4611 | " show base.")) | 4611 | " show base.")) |
16 | 4612 | 4612 | ||
17 | 4613 | if (merger.merge_type.requires_file_merge_plan and | ||
18 | 4614 | (not getattr(merger.this_tree, 'plan_file_merge', None) or | ||
19 | 4615 | not getattr(merger.other_tree, 'plan_file_merge', None) or | ||
20 | 4616 | (merger.base_tree is not None and | ||
21 | 4617 | not getattr(merger.base_tree, 'plan_file_merge', None)))): | ||
22 | 4618 | raise errors.BzrCommandError( | ||
23 | 4619 | gettext('Plan file merge unsupported: ' | ||
24 | 4620 | 'Merge type incompatible with tree formats.')) | ||
25 | 4621 | |||
26 | 4613 | def _get_merger_from_branch(self, tree, location, revision, remember, | 4622 | def _get_merger_from_branch(self, tree, location, revision, remember, |
27 | 4614 | possible_transports, pb): | 4623 | possible_transports, pb): |
28 | 4615 | """Produce a merger from a location, assuming it refers to a branch.""" | 4624 | """Produce a merger from a location, assuming it refers to a branch.""" |
29 | 4616 | 4625 | ||
30 | === modified file 'breezy/bzr/inventorytree.py' | |||
31 | --- breezy/bzr/inventorytree.py 2018-01-12 08:52:43 +0000 | |||
32 | +++ breezy/bzr/inventorytree.py 2018-02-24 18:57:47 +0000 | |||
33 | @@ -258,6 +258,63 @@ | |||
34 | 258 | for child in viewvalues(getattr(entry, 'children', {})): | 258 | for child in viewvalues(getattr(entry, 'children', {})): |
35 | 259 | yield child.file_id | 259 | yield child.file_id |
36 | 260 | 260 | ||
37 | 261 | def _get_plan_merge_data(self, file_id, other, base): | ||
38 | 262 | from . import versionedfile | ||
39 | 263 | vf = versionedfile._PlanMergeVersionedFile(file_id) | ||
40 | 264 | last_revision_a = self._get_file_revision( | ||
41 | 265 | self.id2path(file_id), file_id, vf, 'this:') | ||
42 | 266 | last_revision_b = other._get_file_revision( | ||
43 | 267 | other.id2path(file_id), file_id, vf, 'other:') | ||
44 | 268 | if base is None: | ||
45 | 269 | last_revision_base = None | ||
46 | 270 | else: | ||
47 | 271 | last_revision_base = base._get_file_revision( | ||
48 | 272 | base.id2path(file_id), file_id, vf, 'base:') | ||
49 | 273 | return vf, last_revision_a, last_revision_b, last_revision_base | ||
50 | 274 | |||
51 | 275 | def plan_file_merge(self, file_id, other, base=None): | ||
52 | 276 | """Generate a merge plan based on annotations. | ||
53 | 277 | |||
54 | 278 | If the file contains uncommitted changes in this tree, they will be | ||
55 | 279 | attributed to the 'current:' pseudo-revision. If the file contains | ||
56 | 280 | uncommitted changes in the other tree, they will be assigned to the | ||
57 | 281 | 'other:' pseudo-revision. | ||
58 | 282 | """ | ||
59 | 283 | data = self._get_plan_merge_data(file_id, other, base) | ||
60 | 284 | vf, last_revision_a, last_revision_b, last_revision_base = data | ||
61 | 285 | return vf.plan_merge(last_revision_a, last_revision_b, | ||
62 | 286 | last_revision_base) | ||
63 | 287 | |||
64 | 288 | def plan_file_lca_merge(self, file_id, other, base=None): | ||
65 | 289 | """Generate a merge plan based lca-newness. | ||
66 | 290 | |||
67 | 291 | If the file contains uncommitted changes in this tree, they will be | ||
68 | 292 | attributed to the 'current:' pseudo-revision. If the file contains | ||
69 | 293 | uncommitted changes in the other tree, they will be assigned to the | ||
70 | 294 | 'other:' pseudo-revision. | ||
71 | 295 | """ | ||
72 | 296 | data = self._get_plan_merge_data(file_id, other, base) | ||
73 | 297 | vf, last_revision_a, last_revision_b, last_revision_base = data | ||
74 | 298 | return vf.plan_lca_merge(last_revision_a, last_revision_b, | ||
75 | 299 | last_revision_base) | ||
76 | 300 | |||
77 | 301 | def _get_file_revision(self, path, file_id, vf, tree_revision): | ||
78 | 302 | """Ensure that file_id, tree_revision is in vf to plan the merge.""" | ||
79 | 303 | if getattr(self, '_repository', None) is None: | ||
80 | 304 | last_revision = tree_revision | ||
81 | 305 | parent_keys = [(file_id, t.get_file_revision(path, file_id)) for t in | ||
82 | 306 | self._iter_parent_trees()] | ||
83 | 307 | vf.add_lines((file_id, last_revision), parent_keys, | ||
84 | 308 | self.get_file_lines(path, file_id)) | ||
85 | 309 | repo = self.branch.repository | ||
86 | 310 | base_vf = repo.texts | ||
87 | 311 | else: | ||
88 | 312 | last_revision = self.get_file_revision(path, file_id) | ||
89 | 313 | base_vf = self._repository.texts | ||
90 | 314 | if base_vf not in vf.fallback_versionedfiles: | ||
91 | 315 | vf.fallback_versionedfiles.append(base_vf) | ||
92 | 316 | return last_revision | ||
93 | 317 | |||
94 | 261 | 318 | ||
95 | 262 | class MutableInventoryTree(MutableTree, InventoryTree): | 319 | class MutableInventoryTree(MutableTree, InventoryTree): |
96 | 263 | 320 | ||
97 | 264 | 321 | ||
98 | === modified file 'breezy/bzr/versionedfile.py' | |||
99 | --- breezy/bzr/versionedfile.py 2017-12-04 23:25:45 +0000 | |||
100 | +++ breezy/bzr/versionedfile.py 2018-02-24 18:57:47 +0000 | |||
101 | @@ -669,7 +669,7 @@ | |||
102 | 669 | """ | 669 | """ |
103 | 670 | raise NotImplementedError(self.iter_lines_added_or_present_in_versions) | 670 | raise NotImplementedError(self.iter_lines_added_or_present_in_versions) |
104 | 671 | 671 | ||
106 | 672 | def plan_merge(self, ver_a, ver_b): | 672 | def plan_merge(self, ver_a, ver_b, base=None): |
107 | 673 | """Return pseudo-annotation indicating how the two versions merge. | 673 | """Return pseudo-annotation indicating how the two versions merge. |
108 | 674 | 674 | ||
109 | 675 | This is computed between versions a and b and their common | 675 | This is computed between versions a and b and their common |
110 | 676 | 676 | ||
111 | === modified file 'breezy/merge.py' | |||
112 | --- breezy/merge.py 2017-11-13 22:51:34 +0000 | |||
113 | +++ breezy/merge.py 2018-02-24 18:57:47 +0000 | |||
114 | @@ -94,7 +94,7 @@ | |||
115 | 94 | """PerFileMerger objects are used by plugins extending merge for breezy. | 94 | """PerFileMerger objects are used by plugins extending merge for breezy. |
116 | 95 | 95 | ||
117 | 96 | See ``breezy.plugins.news_merge.news_merge`` for an example concrete class. | 96 | See ``breezy.plugins.news_merge.news_merge`` for an example concrete class. |
119 | 97 | 97 | ||
120 | 98 | :ivar merger: The Merge3Merger performing the merge. | 98 | :ivar merger: The Merge3Merger performing the merge. |
121 | 99 | """ | 99 | """ |
122 | 100 | 100 | ||
123 | @@ -104,7 +104,7 @@ | |||
124 | 104 | 104 | ||
125 | 105 | def merge_contents(self, merge_params): | 105 | def merge_contents(self, merge_params): |
126 | 106 | """Attempt to merge the contents of a single file. | 106 | """Attempt to merge the contents of a single file. |
128 | 107 | 107 | ||
129 | 108 | :param merge_params: A breezy.merge.MergeFileHookParams | 108 | :param merge_params: A breezy.merge.MergeFileHookParams |
130 | 109 | :return: A tuple of (status, chunks), where status is one of | 109 | :return: A tuple of (status, chunks), where status is one of |
131 | 110 | 'not_applicable', 'success', 'conflicted', or 'delete'. If status | 110 | 'not_applicable', 'success', 'conflicted', or 'delete'. If status |
132 | @@ -174,13 +174,13 @@ | |||
133 | 174 | classes should implement ``merge_text``. | 174 | classes should implement ``merge_text``. |
134 | 175 | 175 | ||
135 | 176 | See ``breezy.plugins.news_merge.news_merge`` for an example concrete class. | 176 | See ``breezy.plugins.news_merge.news_merge`` for an example concrete class. |
137 | 177 | 177 | ||
138 | 178 | :ivar affected_files: The configured file paths to merge. | 178 | :ivar affected_files: The configured file paths to merge. |
139 | 179 | 179 | ||
140 | 180 | :cvar name_prefix: The prefix to use when looking up configuration | 180 | :cvar name_prefix: The prefix to use when looking up configuration |
141 | 181 | details. <name_prefix>_merge_files describes the files targeted by the | 181 | details. <name_prefix>_merge_files describes the files targeted by the |
142 | 182 | hook for example. | 182 | hook for example. |
144 | 183 | 183 | ||
145 | 184 | :cvar default_files: The default file paths to merge when no configuration | 184 | :cvar default_files: The default file paths to merge when no configuration |
146 | 185 | is present. | 185 | is present. |
147 | 186 | """ | 186 | """ |
148 | @@ -718,6 +718,7 @@ | |||
149 | 718 | supports_reverse_cherrypick = True | 718 | supports_reverse_cherrypick = True |
150 | 719 | winner_idx = {"this": 2, "other": 1, "conflict": 1} | 719 | winner_idx = {"this": 2, "other": 1, "conflict": 1} |
151 | 720 | supports_lca_trees = True | 720 | supports_lca_trees = True |
152 | 721 | requires_file_merge_plan = False | ||
153 | 721 | 722 | ||
154 | 722 | def __init__(self, working_tree, this_tree, base_tree, other_tree, | 723 | def __init__(self, working_tree, this_tree, base_tree, other_tree, |
155 | 723 | interesting_ids=None, reprocess=False, show_base=False, | 724 | interesting_ids=None, reprocess=False, show_base=False, |
156 | @@ -1408,7 +1409,7 @@ | |||
157 | 1408 | def merge_contents(self, merge_hook_params): | 1409 | def merge_contents(self, merge_hook_params): |
158 | 1409 | """Fallback merge logic after user installed hooks.""" | 1410 | """Fallback merge logic after user installed hooks.""" |
159 | 1410 | # This function is used in merge hooks as the fallback instance. | 1411 | # This function is used in merge hooks as the fallback instance. |
161 | 1411 | # Perhaps making this function and the functions it calls be a | 1412 | # Perhaps making this function and the functions it calls be a |
162 | 1412 | # a separate class would be better. | 1413 | # a separate class would be better. |
163 | 1413 | if merge_hook_params.winner == 'other': | 1414 | if merge_hook_params.winner == 'other': |
164 | 1414 | # OTHER is a straight winner, so replace this contents with other | 1415 | # OTHER is a straight winner, so replace this contents with other |
165 | @@ -1483,7 +1484,6 @@ | |||
166 | 1483 | other_lines) | 1484 | other_lines) |
167 | 1484 | file_group.append(trans_id) | 1485 | file_group.append(trans_id) |
168 | 1485 | 1486 | ||
169 | 1486 | |||
170 | 1487 | def _get_filter_tree_path(self, file_id): | 1487 | def _get_filter_tree_path(self, file_id): |
171 | 1488 | if self.this_tree.supports_content_filtering(): | 1488 | if self.this_tree.supports_content_filtering(): |
172 | 1489 | # We get the path from the working tree if it exists. | 1489 | # We get the path from the working tree if it exists. |
173 | @@ -1667,6 +1667,7 @@ | |||
174 | 1667 | supports_show_base = False | 1667 | supports_show_base = False |
175 | 1668 | supports_reverse_cherrypick = False | 1668 | supports_reverse_cherrypick = False |
176 | 1669 | history_based = True | 1669 | history_based = True |
177 | 1670 | requires_file_merge_plan = True | ||
178 | 1670 | 1671 | ||
179 | 1671 | def _generate_merge_plan(self, file_id, base): | 1672 | def _generate_merge_plan(self, file_id, base): |
180 | 1672 | return self.this_tree.plan_file_merge(file_id, self.other_tree, | 1673 | return self.this_tree.plan_file_merge(file_id, self.other_tree, |
181 | @@ -1721,6 +1722,8 @@ | |||
182 | 1721 | 1722 | ||
183 | 1722 | class LCAMerger(WeaveMerger): | 1723 | class LCAMerger(WeaveMerger): |
184 | 1723 | 1724 | ||
185 | 1725 | requires_file_merge_plan = True | ||
186 | 1726 | |||
187 | 1724 | def _generate_merge_plan(self, file_id, base): | 1727 | def _generate_merge_plan(self, file_id, base): |
188 | 1725 | return self.this_tree.plan_file_lca_merge(file_id, self.other_tree, | 1728 | return self.this_tree.plan_file_lca_merge(file_id, self.other_tree, |
189 | 1726 | base=base) | 1729 | base=base) |
190 | @@ -1728,15 +1731,14 @@ | |||
191 | 1728 | class Diff3Merger(Merge3Merger): | 1731 | class Diff3Merger(Merge3Merger): |
192 | 1729 | """Three-way merger using external diff3 for text merging""" | 1732 | """Three-way merger using external diff3 for text merging""" |
193 | 1730 | 1733 | ||
194 | 1734 | requires_file_merge_plan = False | ||
195 | 1735 | |||
196 | 1731 | def dump_file(self, temp_dir, name, tree, file_id): | 1736 | def dump_file(self, temp_dir, name, tree, file_id): |
197 | 1732 | out_path = osutils.pathjoin(temp_dir, name) | 1737 | out_path = osutils.pathjoin(temp_dir, name) |
200 | 1733 | out_file = open(out_path, "wb") | 1738 | with open(out_path, "wb") as out_file: |
199 | 1734 | try: | ||
201 | 1735 | in_file = tree.get_file(tree.id2path(file_id), file_id) | 1739 | in_file = tree.get_file(tree.id2path(file_id), file_id) |
202 | 1736 | for line in in_file: | 1740 | for line in in_file: |
203 | 1737 | out_file.write(line) | 1741 | out_file.write(line) |
204 | 1738 | finally: | ||
205 | 1739 | out_file.close() | ||
206 | 1740 | return out_path | 1742 | return out_path |
207 | 1741 | 1743 | ||
208 | 1742 | def text_merge(self, file_id, trans_id): | 1744 | def text_merge(self, file_id, trans_id): |
209 | @@ -1754,11 +1756,8 @@ | |||
210 | 1754 | status = breezy.patch.diff3(new_file, this, base, other) | 1756 | status = breezy.patch.diff3(new_file, this, base, other) |
211 | 1755 | if status not in (0, 1): | 1757 | if status not in (0, 1): |
212 | 1756 | raise errors.BzrError("Unhandled diff3 exit code") | 1758 | raise errors.BzrError("Unhandled diff3 exit code") |
215 | 1757 | f = open(new_file, 'rb') | 1759 | with open(new_file, 'rb') as f: |
214 | 1758 | try: | ||
216 | 1759 | self.tt.create_file(f, trans_id) | 1760 | self.tt.create_file(f, trans_id) |
217 | 1760 | finally: | ||
218 | 1761 | f.close() | ||
219 | 1762 | if status == 1: | 1761 | if status == 1: |
220 | 1763 | name = self.tt.final_name(trans_id) | 1762 | name = self.tt.final_name(trans_id) |
221 | 1764 | parent_id = self.tt.final_parent(trans_id) | 1763 | parent_id = self.tt.final_parent(trans_id) |
222 | @@ -1837,7 +1836,7 @@ | |||
223 | 1837 | 1836 | ||
224 | 1838 | class _MergeTypeParameterizer(object): | 1837 | class _MergeTypeParameterizer(object): |
225 | 1839 | """Wrap a merge-type class to provide extra parameters. | 1838 | """Wrap a merge-type class to provide extra parameters. |
227 | 1840 | 1839 | ||
228 | 1841 | This is hack used by MergeIntoMerger to pass some extra parameters to its | 1840 | This is hack used by MergeIntoMerger to pass some extra parameters to its |
229 | 1842 | merge_type. Merger.do_merge() sets up its own set of parameters to pass to | 1841 | merge_type. Merger.do_merge() sets up its own set of parameters to pass to |
230 | 1843 | the 'merge_type' member. It is difficult override do_merge without | 1842 | the 'merge_type' member. It is difficult override do_merge without |
231 | 1844 | 1843 | ||
232 | === modified file 'breezy/tests/per_tree/test_tree.py' | |||
233 | --- breezy/tests/per_tree/test_tree.py 2018-02-16 19:38:39 +0000 | |||
234 | +++ breezy/tests/per_tree/test_tree.py 2018-02-24 18:57:47 +0000 | |||
235 | @@ -56,6 +56,8 @@ | |||
236 | 56 | work_b = work_a.controldir.sprout('wtb').open_workingtree() | 56 | work_b = work_a.controldir.sprout('wtb').open_workingtree() |
237 | 57 | self.build_tree_contents([('wta/file', 'b\nc\nd\ne\n')]) | 57 | self.build_tree_contents([('wta/file', 'b\nc\nd\ne\n')]) |
238 | 58 | tree_a = self.workingtree_to_test_tree(work_a) | 58 | tree_a = self.workingtree_to_test_tree(work_a) |
239 | 59 | if getattr(tree_a, 'plan_file_merge', None) is None: | ||
240 | 60 | raise tests.TestNotApplicable('Tree does not support plan_file_merge') | ||
241 | 59 | tree_a.lock_read() | 61 | tree_a.lock_read() |
242 | 60 | self.addCleanup(tree_a.unlock) | 62 | self.addCleanup(tree_a.unlock) |
243 | 61 | self.build_tree_contents([('wtb/file', 'a\nc\nd\nf\n')]) | 63 | self.build_tree_contents([('wtb/file', 'a\nc\nd\nf\n')]) |
244 | 62 | 64 | ||
245 | === modified file 'breezy/tree.py' | |||
246 | --- breezy/tree.py 2018-02-17 02:57:14 +0000 | |||
247 | +++ breezy/tree.py 2018-02-24 18:57:47 +0000 | |||
248 | @@ -476,46 +476,6 @@ | |||
249 | 476 | """ | 476 | """ |
250 | 477 | raise NotImplementedError(self.annotate_iter) | 477 | raise NotImplementedError(self.annotate_iter) |
251 | 478 | 478 | ||
252 | 479 | def _get_plan_merge_data(self, file_id, other, base): | ||
253 | 480 | from .bzr import versionedfile | ||
254 | 481 | vf = versionedfile._PlanMergeVersionedFile(file_id) | ||
255 | 482 | last_revision_a = self._get_file_revision( | ||
256 | 483 | self.id2path(file_id), file_id, vf, 'this:') | ||
257 | 484 | last_revision_b = other._get_file_revision( | ||
258 | 485 | other.id2path(file_id), file_id, vf, 'other:') | ||
259 | 486 | if base is None: | ||
260 | 487 | last_revision_base = None | ||
261 | 488 | else: | ||
262 | 489 | last_revision_base = base._get_file_revision( | ||
263 | 490 | base.id2path(file_id), file_id, vf, 'base:') | ||
264 | 491 | return vf, last_revision_a, last_revision_b, last_revision_base | ||
265 | 492 | |||
266 | 493 | def plan_file_merge(self, file_id, other, base=None): | ||
267 | 494 | """Generate a merge plan based on annotations. | ||
268 | 495 | |||
269 | 496 | If the file contains uncommitted changes in this tree, they will be | ||
270 | 497 | attributed to the 'current:' pseudo-revision. If the file contains | ||
271 | 498 | uncommitted changes in the other tree, they will be assigned to the | ||
272 | 499 | 'other:' pseudo-revision. | ||
273 | 500 | """ | ||
274 | 501 | data = self._get_plan_merge_data(file_id, other, base) | ||
275 | 502 | vf, last_revision_a, last_revision_b, last_revision_base = data | ||
276 | 503 | return vf.plan_merge(last_revision_a, last_revision_b, | ||
277 | 504 | last_revision_base) | ||
278 | 505 | |||
279 | 506 | def plan_file_lca_merge(self, file_id, other, base=None): | ||
280 | 507 | """Generate a merge plan based lca-newness. | ||
281 | 508 | |||
282 | 509 | If the file contains uncommitted changes in this tree, they will be | ||
283 | 510 | attributed to the 'current:' pseudo-revision. If the file contains | ||
284 | 511 | uncommitted changes in the other tree, they will be assigned to the | ||
285 | 512 | 'other:' pseudo-revision. | ||
286 | 513 | """ | ||
287 | 514 | data = self._get_plan_merge_data(file_id, other, base) | ||
288 | 515 | vf, last_revision_a, last_revision_b, last_revision_base = data | ||
289 | 516 | return vf.plan_lca_merge(last_revision_a, last_revision_b, | ||
290 | 517 | last_revision_base) | ||
291 | 518 | |||
292 | 519 | def _iter_parent_trees(self): | 479 | def _iter_parent_trees(self): |
293 | 520 | """Iterate through parent trees, defaulting to Tree.revision_tree.""" | 480 | """Iterate through parent trees, defaulting to Tree.revision_tree.""" |
294 | 521 | for revision_id in self.get_parent_ids(): | 481 | for revision_id in self.get_parent_ids(): |
295 | @@ -524,23 +484,6 @@ | |||
296 | 524 | except errors.NoSuchRevisionInTree: | 484 | except errors.NoSuchRevisionInTree: |
297 | 525 | yield self.repository.revision_tree(revision_id) | 485 | yield self.repository.revision_tree(revision_id) |
298 | 526 | 486 | ||
299 | 527 | def _get_file_revision(self, path, file_id, vf, tree_revision): | ||
300 | 528 | """Ensure that file_id, tree_revision is in vf to plan the merge.""" | ||
301 | 529 | if getattr(self, '_repository', None) is None: | ||
302 | 530 | last_revision = tree_revision | ||
303 | 531 | parent_keys = [(file_id, t.get_file_revision(path, file_id)) for t in | ||
304 | 532 | self._iter_parent_trees()] | ||
305 | 533 | vf.add_lines((file_id, last_revision), parent_keys, | ||
306 | 534 | self.get_file_lines(path, file_id)) | ||
307 | 535 | repo = self.branch.repository | ||
308 | 536 | base_vf = repo.texts | ||
309 | 537 | else: | ||
310 | 538 | last_revision = self.get_file_revision(path, file_id) | ||
311 | 539 | base_vf = self._repository.texts | ||
312 | 540 | if base_vf not in vf.fallback_versionedfiles: | ||
313 | 541 | vf.fallback_versionedfiles.append(base_vf) | ||
314 | 542 | return last_revision | ||
315 | 543 | |||
316 | 544 | def _check_retrieved(self, ie, f): | 487 | def _check_retrieved(self, ie, f): |
317 | 545 | if not __debug__: | 488 | if not __debug__: |
318 | 546 | return | 489 | return |
Looks good.