2

In Tortoise SVN I would do "svn cleanup" with "Delete unversioned files and folders". In Emacs "svn status" I can mark "unknown" files or folders (marked with "?"). But I cannot delete them, as they are not under version control. "svn-status-cleanup" provides no option to delete also unversioned files.

So, how could I remove files not under version control?

Many thanks!

Note added: for svn-status I used xsteve.at/prg/emacs/psvn.el

Thomas K.
  • 43
  • 5
  • Is there a command line equivalent that accomplishes what you wish to achieve, or is it necessary to comb through an Emacs buffer looking for arbitrary files that have been marked or otherwise indicated by the user? If there is a command-line equivalent, then we can create a custom Emacs function if it does not already exist. Once we have the command-line equivalent, we can even grep the Emacs source code to see if a function already exists -- either the same or slightly different (which can be modified). With additional information, someone who is unfamiliar with `svn` can write an answer. – lawlist Dec 21 '18 at 02:35
  • The svn command would be: `svn cleanup --remove-unversioned --remove-ignored --include-externals` But I want to have it more selectively. Because some of the artifacts I want to keep (e.g. and rename for a later comparison). Emacs: With `svn-status` I see all the artifacts showing up with `?`. Now I want to mark them (ok so far) and delete them. And this, I think, cannot be done using `svn`. This I think, must be done using the command `delete-file`. Can `svn` get combined with `dired`? Can I do "delete-file" on the marked file(s) within the `svn-status` buffer? – Thomas K. Dec 21 '18 at 08:49
  • I was unable to locate `defun svn-status` by grepping a default installation of Emacs. When searching with Google, I found `dsvn.el` on Github (David Kågedal and Mattias Engdegård) https://github.com/bbatsov/emacs-dev-kit/blob/master/vendor/dsvn.el and I found `psvn` on Emacs wiki (Stefan Reichoer) https://www.emacswiki.org/emacs/psvn.el Where, please, is the source code that gives you the `svn-status` function that forms the basis for this question? – lawlist Dec 22 '18 at 06:21
  • I used http://www.xsteve.at/prg/emacs/psvn.el and compiled it. – Thomas K. Dec 23 '18 at 09:20

1 Answers1

0

There is a version of psvn.el in /usr/share/emacs/site-lisp/psvn.el delivered by the subversion package itself, at least on Fedora-29. It also contains the link http://www.xsteve.at/prg/emacs/psvn.el so I guess we're talking about the same thing.

Reading the code and testing it out confirmed that the way to do what you want is to run svn-status, select the files you want to delete with m and then press C-u D. It will delete those files even if they are not in svn.

Explanation - the C-u calls the svn-status-rm function with a 'force' argument.

Thanks for an interesting question, TIL!

wef
  • 452
  • 2
  • 9