292
292
raise NotImplementedError(self.annotate_iter)
294
def plan_file_merge(self, file_id, other, base=None):
295
"""Generate a merge plan based on annotations.
297
If the file contains uncommitted changes in this tree, they will be
298
attributed to the 'current:' pseudo-revision. If the file contains
299
uncommitted changes in the other tree, they will be assigned to the
300
'other:' pseudo-revision.
294
def _get_plan_merge_data(self, file_id, other, base):
302
295
from bzrlib import merge, versionedfile
303
296
vf = versionedfile._PlanMergeVersionedFile(file_id)
304
297
last_revision_a = self._get_file_revision(file_id, vf, 'this:')
307
300
last_revision_base = None
309
302
last_revision_base = base._get_file_revision(file_id, vf, 'base:')
303
return vf, last_revision_a, last_revision_b, last_revision_base
305
def plan_file_merge(self, file_id, other, base=None):
306
"""Generate a merge plan based on annotations.
308
If the file contains uncommitted changes in this tree, they will be
309
attributed to the 'current:' pseudo-revision. If the file contains
310
uncommitted changes in the other tree, they will be assigned to the
311
'other:' pseudo-revision.
313
data = self._get_plan_merge_data(file_id, other, base)
314
vf, last_revision_a, last_revision_b, last_revision_base = data
310
315
return vf.plan_merge(last_revision_a, last_revision_b,
311
316
last_revision_base)
318
def plan_file_lca_merge(self, file_id, other, base=None):
319
"""Generate a merge plan based lca-newness.
321
If the file contains uncommitted changes in this tree, they will be
322
attributed to the 'current:' pseudo-revision. If the file contains
323
uncommitted changes in the other tree, they will be assigned to the
324
'other:' pseudo-revision.
326
data = self._get_plan_merge_data(file_id, other, base)
327
vf, last_revision_a, last_revision_b, last_revision_base = data
328
return vf.plan_lca_merge(last_revision_a, last_revision_b,
313
331
def _get_file_revision(self, file_id, vf, tree_revision):
314
332
def file_revision(revision_tree):
315
333
revision_tree.lock_read()