~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Robert Collins
  • Date: 2005-10-11 02:41:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1438.
  • Revision ID: robertc@robertcollins.net-20051011024125-4e05fd2ffc83c965
cache revision history during read transactions

Show diffs side-by-side

added added

removed removed

Lines of Context:
877
877
        """Return sequence of revision hashes on to this branch."""
878
878
        self.lock_read()
879
879
        try:
880
 
            return [l.rstrip('\r\n') for l in
 
880
            transaction = self.get_transaction()
 
881
            history = transaction.map.find_revision_history()
 
882
            if history is not None:
 
883
                mutter("cache hit for revision-history in %s", self)
 
884
                return list(history)
 
885
            history = [l.rstrip('\r\n') for l in
881
886
                    self.controlfile('revision-history', 'r').readlines()]
 
887
            transaction.map.add_revision_history(history)
 
888
            # this call is disabled because revision_history is 
 
889
            # not really an object yet, and the transaction is for objects.
 
890
            # transaction.register_clean(history, precious=True)
 
891
            return list(history)
882
892
        finally:
883
893
            self.unlock()
884
894