/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/mutabletree.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-08 22:08:05 UTC
  • Revision ID: jelmer@jelmer.uk-20180208220805-wyns3rih4gparz75
Add MutableTree.copy_one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
        """
356
356
        raise NotImplementedError(self.smart_add)
357
357
 
 
358
    def rename_one(self, from_rel, to_rel, after=False):
 
359
        """Rename one file.
 
360
 
 
361
        This can change the directory or the filename or both.
 
362
 
 
363
        rename_one has several 'modes' to work. First, it can rename a physical
 
364
        file and change the file_id. That is the normal mode. Second, it can
 
365
        only change the file_id without touching any physical file.
 
366
 
 
367
        rename_one uses the second mode if 'after == True' and 'to_rel' is
 
368
        either not versioned or newly added, and present in the working tree.
 
369
 
 
370
        rename_one uses the second mode if 'after == False' and 'from_rel' is
 
371
        versioned but no longer in the working tree, and 'to_rel' is not
 
372
        versioned but present in the working tree.
 
373
 
 
374
        rename_one uses the first mode if 'after == False' and 'from_rel' is
 
375
        versioned and present in the working tree, and 'to_rel' is not
 
376
        versioned and not present in the working tree.
 
377
 
 
378
        Everything else results in an error.
 
379
        """
 
380
        raise NotImplementedError(self.rename_one)
 
381
 
 
382
    def copy_one(self, from_rel, to_rel):
 
383
        """Copy one file or directory.
 
384
 
 
385
        This can change the directory or the filename or both.
 
386
 
 
387
        """
 
388
        raise NotImplementedError(self.copy_one)
 
389
 
358
390
 
359
391
class MutableTreeHooks(hooks.Hooks):
360
392
    """A dictionary mapping a hook name to a list of callables for mutabletree