4

I'm migrating a VSS repository to SVN and inadvertently included all of the _vti_cnf, *.scc files in the first check-in. I'd like to remove these from SVN. (Not permanently, of course - just in the HEAD). The application in question is quite large, and finding and deleting these files on a folder-by-folder basis will take forever.

Suggestions? There must be some obvious way to do this, but the proximity of the weekend is interfering with my higher brain functions.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
3Dave
  • 28,657
  • 18
  • 88
  • 151

5 Answers5

4

Jonas' answer should woirk fine. Maybe you are getting conflicts because you're deleting them on file system level, bypassing Subversion's control?

If you can use TortoiseSVN, the following works for me (=I get the necessary commands in the context menu):

  • Open a search window
  • Search for all the unwanted files
  • Select them in the list
  • Right-click
  • Select "TortoiseSVN" > "Delete"
  • Commit the changes

Done!

Usual disclaimer when giving version control advice, be careful, have backups, I'm not taking any responsibility etc. etc.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • Had a brain problem - was deleting folders and then attempting to delete the files they contained. Thx. (Easiest 10 points all day, I'll bet!) – 3Dave Apr 15 '10 at 17:23
3

In a windows command prompt you can perform a recursive file search with 'for' and invoke 'svn delete' for each matching file,

C:\> for /r %i in (abc*def.sql) do svn delete %i

NB: Remember that in a batch file you'll need to replace %i with %%i.

To find out about all the other flags you can use with 'for' (it's the swiss army knife of searching and parsing) use the help command,

C:\> help for
Chris Oldwood
  • 1,060
  • 10
  • 17
2

If you are running linux or Mac OS, you could go with find, like

$ find . -type d -name "_vti_cnf" -exec svn delete {} \;

I'm no more a SVN user (and never used VSS) though, so you may want to modify the command line and/or try with -print first.

instanceof me
  • 38,520
  • 3
  • 31
  • 40
  • Unfortunately, I'm running Windows. Or fortunately, depending on your POV. =/ – 3Dave Apr 15 '10 at 17:08
  • 1
    that'll be unfortunately then ;) – instanceof me Apr 15 '10 at 17:15
  • would this work for you ? http://mattypenny.blogspot.com/2007/04/dos-equivalent-to-unix-find-name-print.html `dir /B /S _vti_cnf` then copy-paste the result into a text editor and add `svn delete ` in front of each line (e.g. using a regex) – instanceof me Apr 15 '10 at 17:17
  • Or http://www.computing.net/answers/windows-xp/dos-command-equivalent-of-unix/147145.html (response #5) – instanceof me Apr 15 '10 at 17:19
1

Can't you just grep (or some other operation that finds files) the *.scc files in a checked out version, delete them, and then commit?

Jonas
  • 74,690
  • 10
  • 137
  • 177
  • You'd think, wouldn't you? I've tried that but it appears to introduce conflicts for some reason. Perhaps I'm just losing my mind. – 3Dave Apr 15 '10 at 17:03
0

Or use PowerShell:

Foreach ($file in Get-Childitem * -include "*.txt")
{
    svn del $file.name
}

where *.txt is the wildcard and * specifies current directory where to look for the files to be deleted

ambidexterous
  • 832
  • 12
  • 21