/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:23:07 UTC
  • mto: This revision was merged to the branch mainline in revision 4828.
  • Revision ID: mbp@sourcefrog.net-20091114112307-gezkfgg9ymipqv96
Further cleanup of removal reporting code

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
 
 
1942
1930
    @needs_tree_write_lock
1943
1931
    def remove(self, files, verbose=False, to_file=None, keep_files=True,
1944
1932
        force=False):
2034
2022
                    else:
2035
2023
                        new_status = '?'
2036
2024
                    # XXX: Really should be a more abstract reporter interface
2037
 
                    self._show_removed_file(new_status, self.kind(fid), f,
2038
 
                        to_file)
 
2025
                    kind_ch = osutils.kind_marker(self.kind(fid))
 
2026
                    to_file.write(new_status + '       ' + f + kind_ch + '\n')
2039
2027
                # Unversion file
2040
2028
                inv_delta.append((f, None, fid, None))
2041
2029
                message = "removed %s" % (f,)