~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/hashcache.py

  • Committer: Robert Collins
  • Date: 2005-10-17 21:57:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1462.
  • Revision ID: robertc@robertcollins.net-20051017215732-08f487800e726748
Allow creation of testaments from uncommitted data, and use that to get signatures before committing revisions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
210
210
        finally:
211
211
            if not outf.closed:
212
212
                outf.abort()
 
213
        
 
214
 
213
215
 
214
216
    def read(self):
215
217
        """Reinstate cache from file.
224
226
        try:
225
227
            inf = file(fn, 'rb', buffering=65000)
226
228
        except IOError, e:
227
 
            mutter("failed to open %s: %s", fn, e)
 
229
            mutter("failed to open %s: %s" % (fn, e))
228
230
            # better write it now so it is valid
229
231
            self.needs_write = True
230
232
            return
232
234
 
233
235
        hdr = inf.readline()
234
236
        if hdr != CACHE_HEADER:
235
 
            mutter('cache header marker not found at top of %s;'
236
 
                   ' discarding cache', fn)
 
237
            mutter('cache header marker not found at top of %s; discarding cache'
 
238
                   % fn)
237
239
            self.needs_write = True
238
240
            return
239
241