~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/__init__.py

  • Committer: Robert Collins
  • Date: 2005-10-16 07:11:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1459.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051016071129-d0cd8a663a42cea0
teach TransportStore.add to accept an optional file suffix, which does not alter the fileid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
 
195
195
    _max_buffered_requests = 10
196
196
 
197
 
    def add(self, f, fileid):
 
197
    def add(self, f, fileid, suffix=None):
198
198
        """Add contents of a file into the store.
199
199
 
200
200
        f -- A file-like object, or string
201
201
        """
202
202
        mutter("add store entry %r" % (fileid))
203
 
            
204
 
        fn = self._relpath(fileid)
 
203
        
 
204
        if suffix is not None:
 
205
            fn = self._relpath(fileid, [suffix])
 
206
        else:
 
207
            fn = self._relpath(fileid)
205
208
        if self._transport.has(fn):
206
209
            raise BzrError("store %r already contains id %r" % (self._transport.base, fileid))
207
210