~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-20 13:31:43 UTC
  • mfrom: (1551.15.54 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070720133143-r74lo566tluurmfp
fix annotate merge to not require Tree.get_weave

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from bzrlib import (
26
26
    delta,
27
27
    osutils,
 
28
    revision as _mod_revision,
28
29
    symbol_versioning,
29
30
    )
30
31
from bzrlib.decorators import needs_read_lock
244
245
        """
245
246
        raise NotImplementedError(self.annotate_iter)
246
247
 
 
248
    def plan_file_merge(self, file_id, other):
 
249
        """Generate a merge plan based on annotations
 
250
 
 
251
        If the file contains uncommitted changes in this tree, they will be
 
252
        attributed to the 'current:' pseudo-revision.  If the file contains
 
253
        uncommitted changes in the other tree, they will be assigned to the
 
254
        'other:' pseudo-revision.
 
255
        """
 
256
        from bzrlib import merge
 
257
        annotated_a = list(self.annotate_iter(file_id,
 
258
                                              _mod_revision.CURRENT_REVISION))
 
259
        annotated_b = list(other.annotate_iter(file_id, 'other:'))
 
260
        ancestors_a = self._get_ancestors(_mod_revision.CURRENT_REVISION)
 
261
        ancestors_b = other._get_ancestors('other:')
 
262
        return merge._plan_annotate_merge(annotated_a, annotated_b,
 
263
                                          ancestors_a, ancestors_b)
 
264
 
247
265
    inventory = property(_get_inventory,
248
266
                         doc="Inventory of this Tree")
249
267