~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Aaron Bentley
  • Date: 2007-12-28 20:10:14 UTC
  • mto: (3144.5.2 specific-file)
  • mto: This revision was merged to the branch mainline in revision 3156.
  • Revision ID: abentley@panoramicfeedback.com-20071228201014-hd5g7gsz1ds1mmr4
Implement LCA merge, with problematic conflict markers

Show diffs side-by-side

added added

removed removed

Lines of Context:
291
291
        """
292
292
        raise NotImplementedError(self.annotate_iter)
293
293
 
294
 
    def plan_file_merge(self, file_id, other, base=None):
295
 
        """Generate a merge plan based on annotations.
296
 
 
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.
301
 
        """
 
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
308
301
        else:
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
 
304
 
 
305
    def plan_file_merge(self, file_id, other, base=None):
 
306
        """Generate a merge plan based on annotations.
 
307
 
 
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.
 
312
        """
 
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)
312
317
 
 
318
    def plan_file_lca_merge(self, file_id, other, base=None):
 
319
        """Generate a merge plan based lca-newness.
 
320
 
 
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.
 
325
        """
 
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,
 
329
                                 last_revision_base)
 
330
 
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()