Hi Vladislav,
You can try to commit working copy root if it's ok for you. To get working copy 
root use this code

final File workingCopyRoot = SVNWCUtil.getWorkingCopyRoot(file, false);

Otherwise, I know no solution. If you add the file parent as a target, all its 
children (not only 
that file) will be committed. If you don't want that. Probably changelists can 
help somehow, but I'm 
not sure. If it's important for you to commit exactly that file, probably I'll 
check that idea but 
later.
--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge

> Hi, all!
> 
> I am trying to add  unversioned nodes recursively to WC and to SVN
> Repository :) Using WC2 api :)
> Something like this (just for example. WC dir is: C:\SVN\WC ):
> 
> final SvnOperationFactory factory = new SvnOperationFactory();
> final SvnCommit commit = factory.createCommit();
> SvnScheduleForAddition add = factory.createScheduleForAddition();
> SvnTarget target = SvnTarget.fromFile(new
> File("C:\\SVN\\WC\\Dir2\\Dir3\\Dir4\\textfile.txt"));
> 
> add.addTarget(target);
> add.setAddParents(true); // !
> add.setForce(true);
> add.run();
> 
> In these steps  i "added" textfile.txt and all parents directories:
> Operation: Add C:\SVN\WC\Dir2
> Operation: Add C:\SVN\WC\Dir2\Dir3
> Operation: Add C:\SVN\WC\Dir2\Dir3\Dir4
> Operation: Add C:\SVN\WC\Dir2\Dir3\Dir4\textfile.txt
> 
> Now i trying to commit all these changes:
> 
> commit.addTarget(target);
> commit.setKeepLocks(true);
> commit.setCommitMessage("Commit Message!");
> SVNCommitInfo info = commit.run();
> 
> But i got an error:
> "svn: E200009: 'C:\SVN\WC\Dir2\Dir3\Dir4' is not known to exist in the
> repository and is not part of the commit, yet its child
> 'C:\SVN\WC\Dir2\Dir3\Dir4\textfile.txt' is part of the commit"
> 
> So... Can i somehow automatically add parent directories of commit's
> target to commit?

Reply via email to