tags:

views:

598

answers:

3

Take folder files, inside an SVN working copy, running in Linux. The folder was set to be ignored, with the commands:

  • svn propset svn:ignore * 'files'
  • svn propset svn:ignore 'default/files'
  • and a few other combination, all valid AFAIK

However, the setting just doesn't kick it. If the repository is accessed with a dektop client (ie Cornerstone on Mac OS) the folder is correctly reported as ignored.

I am scratching my head real hard here.

Thanks.

The answer that cleared it out for me is in this comment:
If the files are already under version control, they will never be ignored.

+1  A: 

How are you testing it? If you

svn commit files

Then the ignore isn't checked. If you svn commit ., then the automatic behavior of Subversion will ignore it. (This confused me at one point, too. Subversion assumes you're smarter than the svn:ignore.)

mqsoh
+8  A: 

If you want to ignore a directory files, you need to svn propset svn:ignore files on its PARENT directory, not the directory itself.

e.g.

# your directory structure is this:
# workingCopy
# workingCopy/parent
# workingCopy/parent/subfolder
# to ignore subfolder do this:
svn propset svn:ignore subfolder workingCopy/parent

Edit

If there are files within this folder that are under version control, Subversion will NOT ignore them even if the folder is ignored. You will need to remove them from version control (i.e. svn delete) and then they will be ignored.

A file being under version control takes precedence over any ignore lists that may include it.

Michael Hackner
I did it before and tried it again. Running `svn status` would still report a bunch of new or changed files inside subfolder. They are sent to the server with `svn commit` too. This is puzzling.
If the files are already under version control, they will never be ignored.
Michael Hackner
+1  A: 

So close.

I think you wanted

svn propset svn:ignore files .

if you execute this in the parent directory of the files directory, it'll be ignored. You won't see the effect until the parent is committed, though. And I'm pretty sure you can't ignore a directory that contains versioned files.

Finally, I always use propedit rather than propset, so I don't lose any current settings.

Mark Bessey
Actually, it's `propset PROPNAME PROPVAL PATH`, you swapped the two last arguments. Yet it's so simple to quickly check before posting a solution ;-)
RedGlyph
Fair enough. That's what I get for answering questions from my iPhone...
Mark Bessey
fixed my example.
Mark Bessey
> And I'm pretty sure you can't ignore a directory that contains versioned files. Ah... this is what I've suspected. Is there be away to undo this somehow? I've found this http://stackoverflow.com/questions/414879/how-to-remove-a-file-folder-from-a-svn-repository-and-add-to-ignore-list previous question, but the answer isn't clearing the .svn folders, so I am wondering if that may cause issues.Thanks for all the answers.
In most cases, it's probably easier to just "svn rm" the files, then re-generate them. It's generally a bad idea to copy folders around in your working copy, because the .svn info can confuse the client software. Ypu could take the script from http://stackoverflow.com/questions/414879/how-to-remove-a-file-folder-from-a-svn-repository-and-add-to-ignore-list and modify it to use tar instead of cp, removing the .svn folders with --exclude.
Mark Bessey