~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Marius Kruger
  • Date: 2007-04-12 00:47:48 UTC
  • mto: This revision was merged to the branch mainline in revision 2455.
  • Revision ID: amanic@gmail.com-20070412004748-0nsa6sughf0xu744
* merge the unversion command back into the remove command,
  merging the commands and tests.
* make all tests pass again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1810
1810
                        new_status = '?'
1811
1811
                    textui.show_status(new_status, inv[fid].kind, f,
1812
1812
                                       to_file=to_file)
 
1813
                # unversion file
1813
1814
                del inv[fid]
 
1815
                message="removed %s"%f
1814
1816
 
1815
 
                if not keep_files:
1816
 
                    if osutils.lexists(f):
1817
 
                        if force:
1818
 
                            if osutils.isdir(f):
1819
 
                                osutils.rmtree(f)
1820
 
                            else:
1821
 
                                os.unlink(f)
 
1817
            if not keep_files:
 
1818
                if osutils.lexists(f):
 
1819
                    if force:
 
1820
                        # recursively delete f
 
1821
                        if osutils.isdir(f):
 
1822
                            osutils.rmtree(f)
 
1823
                        else:
 
1824
                            os.unlink(f)
 
1825
                        message="deleted %s"%f
 
1826
                    elif fid: 
 
1827
                        # only consider deleting versioned files
 
1828
                        if f in changed_files:
 
1829
                            message="%s has changed and won't be deleted."%f
 
1830
                        elif osutils.isdir(f) and len(os.listdir(f)) > 0:
 
1831
                            message="%s is not empty directory "\
 
1832
                                "and won't be deleted."%f
 
1833
                        else:
 
1834
                            osutils.delete_any(f)
1822
1835
                            message="deleted %s"%f
1823
 
                        else:
1824
 
                            if f in changed_files:
1825
 
                                message="%s has changed and won't be deleted."%f
1826
 
                            elif osutils.isdir(f) and len(os.listdir(f)) > 0:
1827
 
                                message="%s is not empty directory "\
1828
 
                                    "and won't be deleted."%f
1829
 
                            else:
1830
 
                                osutils.delete_any(f)
1831
 
                                message="deleted %s"%f
1832
 
                    else:
1833
 
                        message="%s does not exist."%f
1834
 
                else:
1835
 
                    message="removed %s"%f
1836
 
            # print only one message per file.
 
1836
                elif message is not None:
 
1837
                    # only care if we haven't done anything yet.
 
1838
                    message="%s does not exist."%f
 
1839
                
 
1840
            # print only one message (if any) per file.
1837
1841
            if message is not None:
1838
1842
                note(message)
1839
1843
        self._write_inventory(inv)