~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revfile.py

  • Committer: mbp at sourcefrog
  • Date: 2005-04-09 05:17:31 UTC
  • Revision ID: mbp@sourcefrog.net-20050409051731-24ae97433d2eac18deb49dc3
remove dead code

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
                                   % (h, self.basename))
133
133
 
134
134
 
135
 
 
136
 
    def revision(self, rev):
137
 
        base = self.index[rev][0]
138
 
        start = self.index[base][1]
139
 
        end = self.index[rev][1] + self.index[rev][2]
140
 
        f = open(self.datafile())
141
 
 
142
 
        f.seek(start)
143
 
        data = f.read(end - start)
144
 
 
145
 
        last = self.index[base][2]
146
 
        text = zlib.decompress(data[:last])
147
 
 
148
 
        for r in range(base + 1, rev + 1):
149
 
            s = self.index[r][2]
150
 
            b = zlib.decompress(data[last:last + s])
151
 
            text = mdiff.bpatch(text, b)
152
 
            last = last + s
153
 
 
154
 
        return text    
155
 
 
156
 
 
157
135
    def _check_index(self, idx):
158
136
        if idx < 0 or idx > len(self):
159
137
            raise RevfileError("invalid index %r" % idx)