Hello Fernando,
The answer depends on what you mean by "during a commit" (could you post an 
example of the code you 
use to commit, because there're several ways to perform a commit in SVNKit?).

But in general you can use SVNRepository#checkPath method. But note: you should 
use a separate SVN 
connection (or maybe separate SVN connection pool), i.e. separate SVNRepository 
instance, to do that 
in order to avoid "SVNKit methods are not reenterable" error. See this post for 
details:

http://vcs.atspace.co.uk/2012/09/21/are-svnkit-methods-reenterable/

If this is not critical for you to check the path existence while commit 
(whatever this means), I 
would recommend you to check the path existence *before* commit, because in 
this way you can reuse 
existing connection or connection pool, saving a lot of time (usually creating 
a new connection is 
the most time-consuming operation in SVNKit). There's no big difference in 
checking path existence 
while or before commit, because theoretically someone else can create a commit 
that changes that 
path existence, after your check for existence, but before fixing your commit 
creation transaction.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge

> Hi,
> 
> How can i check if a directory or file exists during a commit ?

Reply via email to