~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Aaron Bentley
  • Date: 2005-09-29 21:07:17 UTC
  • mfrom: (1393.1.6)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: abentley@panoramicfeedback.com-20050929210717-cd73981590f17017
Merged the weave changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
                         doc="Inventory of this Tree")
77
77
 
78
78
    def _check_retrieved(self, ie, f):
 
79
        if not __debug__:
 
80
            return  
79
81
        fp = fingerprint_file(f)
80
82
        f.seek(0)
81
83
        
127
129
 
128
130
    def get_weave(self, file_id):
129
131
        return self._weave_store.get_weave(file_id)
 
132
 
 
133
 
 
134
    def get_file_lines(self, file_id):
 
135
        ie = self._inventory[file_id]
 
136
        weave = self.get_weave(file_id)
 
137
        return weave.get(ie.text_version)
130
138
        
131
139
 
132
140
    def get_file_text(self, file_id):
133
 
        ie = self._inventory[file_id]
134
 
        weave = self.get_weave(file_id)
135
 
        idx = weave.lookup(ie.text_version)
136
 
        content = weave.get_text(idx)
137
 
        if len(content) != ie.text_size:
138
 
            raise BzrCheckError('mismatched size on revision %s of file %s: '
139
 
                                '%d vs %d bytes'
140
 
                                % (self._revision_id, file_id, len(content),
141
 
                                   ie.text_size))
142
 
        return content
 
141
        return ''.join(self.get_file_lines(file_id))
 
142
 
143
143
 
144
144
    def get_file(self, file_id):
145
145
        return StringIO(self.get_file_text(file_id))