Install svn: ignore flag using svnkit

I am using SVNKit in my application. I have a scenario where some files should be ignored when performing svn operations. those. I need to set the svn: ignore property for specific patterns.

How to do it with SVNKit?

+3
source share
2 answers

You can use the ISVNOptions class.

It has a function addIgnorePattern() , which should allow you to ignore the file based on the given template.

If you want to ignore β€œignore” in a specific directory, you must set the svn:ignore property in your parent directory and not in the file itself (since it is ignored that this file will never be added to the repository).

 File dir = file.getParentFile().getAbsoluteFile(); ourClientManager.getWCClient().doSetProperty(dir, SVNProperty.IGNORE, file.getName(), false, false, null); 

To ignore multiple files in a directory, the value of the svn:ignore property must contain a line for each ignored file, for example:

 a\n b\n *.bin 

Once the property is set, the commit directory will be stored in the repository to add a new property value.

+3
source

A list of arguments (file, propName, propValue, force, recursive, IPropertyHandler).

So, if you want to apply a property recursively, just set the 5th argument (recursive) for it to true.

+1
source

All Articles