~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2006-03-02 07:08:36 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060302070836-be71595e05a607b7
remove the weavestore assumptions about the number and nature of files it manages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
260
260
        self._data = _KnitData(transport, relpath + DATA_SUFFIX,
261
261
            mode)
262
262
 
 
263
    def copy_to(self, name, transport):
 
264
        """See VersionedFile.copy_to()."""
 
265
        # copy the current index to a temp index to avoid racing with local
 
266
        # writes
 
267
        transport.put(name + INDEX_SUFFIX + '.tmp', self.transport.get(self._index._filename))
 
268
        # copy the data file
 
269
        transport.put(name + DATA_SUFFIX, self._data._open_file())
 
270
        # rename the copied index into place
 
271
        transport.rename(name + INDEX_SUFFIX + '.tmp', name + INDEX_SUFFIX)
 
272
 
263
273
    def create_empty(self, name, transport, mode=None):
264
274
        return KnitVersionedFile(transport, name, 'w', self.factory, delta=self.delta)
 
275
    
 
276
    @staticmethod
 
277
    def get_suffixes():
 
278
        """See VersionedFile.get_suffixes()."""
 
279
        return [DATA_SUFFIX, INDEX_SUFFIX]
265
280
 
266
281
    def versions(self):
267
282
        """See VersionedFile.versions."""