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

4
  • 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 2: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 8: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) github.com/bbatsov/emacs-dev-kit/blob/master/vendor/dsvn.el and I found psvn on Emacs wiki (Stefan Reichoer) 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 6:21
  • I used xsteve.at/prg/emacs/psvn.el and compiled it.
    – Thomas K.
    Dec 23 '18 at 9:20
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!

4
  • Many thanks! Great help for my daily work!
    – Thomas K.
    Dec 25 '18 at 17:21
  • Great! If it answered your question, please upvote my answer. Cheers.
    – wef
    Dec 25 '18 at 21:48
  • Sorry I would upvote. But I'm below 15 reputations. And so I'm not allowed to.
    – Thomas K.
    Dec 27 '18 at 8:34
  • No worries, they're pretty strict around here, eh!
    – wef
    Dec 27 '18 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.