In order to commit file deletion you need to "schedule it for
deletion" first. Same is correct for adding a file - commit will only
add files or directories that are "scheduled for addition".
To schedule a file respectively for addition or deletion you need to
run SVNWCClient.doAdd or doRemove method. You may run doAdd
recursively on a top of a working copy with 'force' option set to
'true' in order to schedule all unversioned files for addition.
There is a "shortcut" that you may use with
SVNCommitClient.doCommit(...) to delete files that a no longer in the
working copy, but were not scheduled for deletion:
SVNCommitClient cc = SVNClientManager.newInstance().getCommitClient();
cc.setCommitParameters(new ISVNCommitParameters() {
// delete even those files
// that are not scheduled for deletion.
public Action onMissingFile(File file) {
return DELETE;
}
public Action onMissingDirectory(File file) {
return DELETE;
}
// delete files from disk after committing deletion.
public boolean onDirectoryDeletion(File directory) {
return true;
}
public boolean onFileDeletion(File file) {
return true;
}
});
cc.doCommit(...);
Alexander Kitaev,
TMate Software,
http://subgit.com/ - Svn to Git Migration!
http://svnkit.com/ - Java [Sub]Versioning Library!
http://hg4j.com/ - Java Mercurial Library!
http://sqljet.com/ - Java SQLite Library!
On 3 January 2012 18:44, adsonvinicius <[email protected]> wrote:
>
> Ok i tried. Let me know, On Update action in Tortoise, if one file is not in
> server anymore it will be deleted on Working Copy. The same can apply in
> commit action. Is it possible in svn kit?
>
> I put manually one file into a Working Copy and used the code which you
> said, but got this error:
>
> C:\Users\adson\Desktop\CMS\build\web\arquivos\SSA\categorias\Untitled-1.png'
> is not under version control
>
> Why it happends? I need to commit file by file in recursive doCommit?
>
> Thanks,
> Adson
>
>
> AlexanderKitaev wrote:
>>
>> Hello,
>>
>> In case you have a working copy you'll need to schedule file for
>> deletion and then run commit:
>>
>> File file = new File("/file/path");
>>
>> SVNClientManager clientManager = SVNClientManager.newInstance();
>> clientManager.getWCClient().doDelete(file, false, false);
>> clientManager.getCommitClient().
>> doCommit(new File[] {file}, false, "file deleted", null, null,
>> false, false, SVNDepth.INFINITY);
>>
>>
>> Alexander Kitaev,
>> TMate Software,
>> http://subgit.com/ - Svn to Git Migration!
>> http://svnkit.com/ - Java [Sub]Versioning Library!
>> http://hg4j.com/ - Java Mercurial Library!
>> http://sqljet.com/ - Java SQLite Library!
>>
>>
>>
>> On 14 December 2011 19:30, adsonvinicius <[email protected]> wrote:
>>>
>>> I has passed 3 days trying remove phisically a file inside one Checked
>>> out
>>> folder and using SVNKit do a Commit . But i never got it reflect this
>>> operation in repository. Does anyone know how to do that? I'm trying to
>>> do
>>> the same operation when we click in Commit button on a icon folder
>>> checked
>>> out.
>>> --
>>> View this message in context:
>>> http://old.nabble.com/How-to-do-a-simple-Commit-as-Tortoise--tp32975346p32975346.html
>>> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/How-to-do-a-simple-Commit-as-Tortoise--tp32975346p33073566.html
> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>
>