~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-09-06 16:12:10 UTC
  • mto: (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050906161210-b5fcce201b427288
whitespace

Show diffs side-by-side

added added

removed removed

Lines of Context:
630
630
 
631
631
        return compare_trees(old_tree, new_tree)
632
632
 
633
 
        
634
 
 
635
633
    def get_revision_sha1(self, revision_id):
636
634
        """Hash the stored value of a revision, and return it."""
637
635
        # In the future, revision entries will be signed. At that
642
640
        # But for now, just hash the contents.
643
641
        return bzrlib.osutils.sha_file(self.get_revision_xml(revision_id))
644
642
 
645
 
 
646
643
    def get_inventory(self, inventory_id):
647
644
        """Get Inventory object by hash.
648
645
 
654
651
 
655
652
        return unpack_xml(Inventory, self.get_inventory_xml(inventory_id))
656
653
 
657
 
 
658
654
    def get_inventory_xml(self, inventory_id):
659
655
        """Get inventory XML as a file object."""
660
656
        return self.inventory_store[inventory_id]
661
657
            
662
 
 
663
658
    def get_inventory_sha1(self, inventory_id):
664
659
        """Return the sha1 hash of the inventory entry
665
660
        """
666
661
        return sha_file(self.get_inventory_xml(inventory_id))
667
662
 
668
 
 
669
663
    def get_revision_inventory(self, revision_id):
670
664
        """Return inventory of a past revision."""
671
665
        # bzr 0.0.6 imposes the constraint that the inventory_id
676
670
        else:
677
671
            return self.get_inventory(revision_id)
678
672
 
679
 
 
680
673
    def revision_history(self):
681
674
        """Return sequence of revision hashes on to this branch.
682
675
 
690
683
        finally:
691
684
            self.unlock()
692
685
 
693
 
 
694
686
    def common_ancestor(self, other, self_revno=None, other_revno=None):
695
687
        """
696
688
        >>> import commit