/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 bzrlib/workingtree.py

  • Committer: Marius Kruger
  • Date: 2007-04-14 00:58:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2455.
  • Revision ID: amanic@gmail.com-20070414005827-zf4n2y9scrjs2d2x
Implement TODO: Normalize names.
Assume paths relative to the basedir.
(not to the current dir, which I did previously)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1766
1766
        return result
1767
1767
 
1768
1768
    @needs_tree_write_lock
1769
 
    def remove(self, files, verbose=False, to_file=None, keep_files=True, 
 
1769
    def remove(self, files, verbose=False, to_file=None, keep_files=True,
1770
1770
        force=False):
1771
1771
        """Remove nominated files from the working inventor.
1772
1772
 
 
1773
        :files: File paths relative to the basedir.
1773
1774
        :keep_files: If true, the files will also be kept.
1774
1775
        :force: Delete files and directories, even if they are changed and
1775
1776
            even if the directories are not empty.
1776
1777
        """
1777
 
        ## TODO: Normalize names
1778
1778
        if isinstance(files, basestring):
1779
1779
            files = [files]
1780
1780
 
1781
1781
        inv = self.inventory
1782
1782
        changed_files=[]
1783
1783
 
1784
 
        # Sort needed when deleting files:
1785
 
        # first delete directory content before the directory
 
1784
        # Get file names into canonical form.
 
1785
        files = [self.relpath(self.abspath(filename))
 
1786
            for filename in files]
 
1787
 
 
1788
        # Sort needed to first handle directory content before the directory
 
1789
        files.sort(reverse=True)
 
1790
 
1786
1791
        if not keep_files and not force:
1787
 
            files = [self.relpath(osutils.dereference_path(filename))
1788
 
                for filename in files]
1789
 
            files.sort(reverse=True)
1790
1792
            changes = self.changes_from(self.basis_tree(),
1791
1793
                specific_files=files)
1792
 
 
1793
1794
            for f in changes.modified:
1794
1795
                changed_files.append(f[0])
1795
1796
            for f in changes.added: