~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-12 00:02:50 UTC
  • mto: (1185.11.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050712000250-db1abd4352067ec4
Added pb to function that were missing, implemented a basic double-dispatch copy_to function.

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
        """Copy the item at rel_from to the location at rel_to"""
243
243
        raise NotImplementedError
244
244
 
245
 
    def copy_multi(self, relpaths):
 
245
    def copy_multi(self, relpaths, pb=None):
246
246
        """Copy a bunch of entries.
247
247
        
248
248
        :param relpaths: A list of tuples of the form [(from, to), (from, to),...]
251
251
        # implementors don't have to implement everything.
252
252
        return self._iterate_over(relpaths, self.copy, pb, 'copy', expand=True)
253
253
 
 
254
    def copy_to(self, relpaths, other, pb=None):
 
255
        """Copy a set of entries from self into another Transport.
 
256
 
 
257
        :param relpaths: A list/generator of entries to be copied.
 
258
        """
 
259
        # The dummy implementation just does a simple get + put
 
260
        def copy_entry(path):
 
261
            other.put(path, self.get(path, decode=False), encode=False)
 
262
 
 
263
        return self._iterate_over(relpaths, copy_entry, pb, 'copy_to', expand=False)
 
264
 
 
265
 
254
266
    def move(self, rel_from, rel_to):
255
267
        """Move the item at rel_from to the location at rel_to"""
256
268
        raise NotImplementedError
257
269
 
258
 
    def move_multi(self, relpaths):
 
270
    def move_multi(self, relpaths, pb=None):
259
271
        """Move a bunch of entries.
260
272
        
261
273
        :param relpaths: A list of tuples of the form [(from1, to1), (from2, to2),...]
278
290
        """Delete the item at relpath"""
279
291
        raise NotImplementedError
280
292
 
281
 
    def delete_multi(self, relpaths):
 
293
    def delete_multi(self, relpaths, pb=None):
282
294
        """Queue up a bunch of deletes to be done.
283
295
        """
284
296
        return self._iterate_over(relpaths, self.delete, pb, 'delete', expand=False)