/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: Martin Pool
  • Date: 2009-11-14 11:19:39 UTC
  • mto: This revision was merged to the branch mainline in revision 4828.
  • Revision ID: mbp@sourcefrog.net-20091114111939-8pghrh3fg2prgdlv
Move stubby show_status from bzrlib.textui into remove(), its only user

Show diffs side-by-side

added added

removed removed

Lines of Context:
1927
1927
        self._set_inventory(result, dirty=False)
1928
1928
        return result
1929
1929
 
 
1930
    def _show_removed_file(self, state, kind, name, to_file):
 
1931
        if kind == 'directory':
 
1932
            # use this even on windows?
 
1933
            kind_ch = '/'
 
1934
        elif kind == 'symlink':
 
1935
            kind_ch = '->'
 
1936
        elif kind == 'file':
 
1937
            kind_ch = ''
 
1938
        else:
 
1939
            raise ValueError(kind)
 
1940
        to_file.write(state + '       ' + name + kind_ch + '\n')
 
1941
 
1930
1942
    @needs_tree_write_lock
1931
1943
    def remove(self, files, verbose=False, to_file=None, keep_files=True,
1932
1944
        force=False):
1944
1956
 
1945
1957
        new_files=set()
1946
1958
        unknown_nested_files=set()
 
1959
        if to_file is None:
 
1960
            to_file = sys.stdout
1947
1961
 
1948
1962
        def recurse_directory_to_add_files(directory):
1949
1963
            # Recurse directory and add all files
2019
2033
                        new_status = 'I'
2020
2034
                    else:
2021
2035
                        new_status = '?'
2022
 
                    textui.show_status(new_status, self.kind(fid), f,
2023
 
                                       to_file=to_file)
 
2036
                    # XXX: Really should be a more abstract reporter interface
 
2037
                    self._show_removed_file(new_status, self.kind(fid), f,
 
2038
                        to_file)
2024
2039
                # Unversion file
2025
2040
                inv_delta.append((f, None, fid, None))
2026
2041
                message = "removed %s" % (f,)