Krishnaveni
Krishnaveni

Reputation: 809

commit only directory and not the files in it

I am committing the files to SVN using the API available in SVNKit, using the below code

ourClientManager.getWCClient().doAdd(subFile, false, false, true, false);
ourClientManager.getCommitClient().doCommit(path, false, comment, false, false);

When i commit a new directory, the file in it are automatically committed. (I have set recursive false.) Is there a way to stop that? I want to pass a different comment for the new directory committed and the file committed, so i want commit them separately. Please suggest if there is a way.

Upvotes: 6

Views: 7665

Answers (3)

Never Sleep Again
Never Sleep Again

Reputation: 1350

ci takes the --depth switch too, like add does, and you don't have to muck with properties.

svn add --parents directory_with_WIP/*.pl
svn ci -m 'The new directory' --depth=empty directory_with_WIP
svn ci -m 'First file ready' directory_with_WIP/flibber.pl

Upvotes: 1

vkGunasekaran
vkGunasekaran

Reputation: 6814

Answer given by Luke works well, but it wont add sub directories inside 'mydirectory', So the svn command will be,

svn add -N mydirectory

Enter inside 'mydirectory' and execute this command,

svn propset svn:ignore '*.*'

svn commit -m "Adding directory structure only"

Upvotes: 0

Luke Z
Luke Z

Reputation: 2429

In svn commands, you'd do svn add --depth=empty mydirectory

With SVNKit, pass in the EMPTY value for the SVNDepth parameter, e.g.:

doAdd(mydirectory, false, false, false, SVNDepth.EMPTY)

Upvotes: 13

Related Questions