~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-16 19:55:10 UTC
  • mfrom: (1770.3.3 bzr.jelmer.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060616195510-99f53d52da967571
(jrydberg, jelmer) Change Branch.get_revision_delta() to use Repository.get_revision_delta()

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
from bzrlib.store.text import TextStore
40
40
from bzrlib.symbol_versioning import *
41
41
from bzrlib.trace import mutter, note
42
 
from bzrlib.tree import RevisionTree
 
42
from bzrlib.tree import RevisionTree, EmptyTree
43
43
from bzrlib.tsort import topo_sort
44
44
from bzrlib.testament import Testament
45
45
from bzrlib.tree import EmptyTree
 
46
from bzrlib.delta import compare_trees
46
47
import bzrlib.ui
47
48
from bzrlib.weave import WeaveFile
48
49
import bzrlib.xml5
334
335
        self._check_revision_parents(r, inv)
335
336
        return r
336
337
 
 
338
    def get_revision_delta(self, revision_id):
 
339
        """Return the delta for one revision.
 
340
 
 
341
        The delta is relative to the left-hand predecessor of the
 
342
        revision.
 
343
        """
 
344
        revision = self.get_revision(revision_id)
 
345
        new_tree = self.revision_tree(revision_id)
 
346
        if not revision.parent_ids:
 
347
            old_tree = EmptyTree()
 
348
        else:
 
349
            old_tree = self.revision_tree(revision.parent_ids[0])
 
350
        return compare_trees(old_tree, new_tree)
 
351
 
337
352
    def _check_revision_parents(self, revision, inventory):
338
353
        """Private to Repository and Fetch.
339
354