~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-10-06 06:52:09 UTC
  • mfrom: (1415)
  • mto: (1185.13.3)
  • mto: This revision was merged to the branch mainline in revision 1418.
  • Revision ID: mbp@sourcefrog.net-20051006065209-3e4d5db3b006981d
[merge] from robert, get ancestry from inventory weave 
rather than storing separately

The ancestry weave is now strictly redundant and doesn't need 
to be stored.

You should ugprade again after taking this.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
                           DivergedBranches, LockError, UnlistableStore,
35
35
                           UnlistableBranch, NoSuchFile)
36
36
from bzrlib.textui import show_status
37
 
from bzrlib.revision import Revision, is_ancestor
 
37
from bzrlib.revision import Revision
38
38
from bzrlib.delta import compare_trees
39
39
from bzrlib.tree import EmptyTree, RevisionTree
40
40
from bzrlib.inventory import Inventory
780
780
        # But for now, just hash the contents.
781
781
        return bzrlib.osutils.sha_file(self.get_revision_xml_file(revision_id))
782
782
 
783
 
    def _get_ancestry_weave(self):
784
 
        return self.control_weaves.get_weave('ancestry')
785
 
 
786
783
    def get_ancestry(self, revision_id):
787
 
        """Return a list of revision-ids integrated by a revision."""
 
784
        """Return a list of revision-ids integrated by a revision.
 
785
        
 
786
        This currently returns a list, but the ordering is not guaranteed:
 
787
        treat it as a set.
 
788
        """
788
789
        if revision_id is None:
789
790
            return [None]
790
 
        w = self._get_ancestry_weave()
791
 
        return [None] + [l[:-1] for l in w.get_iter(w.lookup(revision_id))]
 
791
        w = self.control_weaves.get_weave('inventory')
 
792
        return [None] + map(w.idx_to_name,
 
793
                            w.inclusions([w.lookup(revision_id)]))
792
794
 
793
795
    def get_inventory_weave(self):
794
796
        return self.control_weaves.get_weave('inventory')