REMOVING SPECIFIC FILES FROM COMMIT LIST

View: New views
2 Messages — Rating Filter:   Alert me  

REMOVING SPECIFIC FILES FROM COMMIT LIST

by rajagopal NS :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We use svnkit 1.1.6.

While using doCommit method of svnCommitClient for committing. We use recursive on.

While a committing a directory in a particular session, we want to send some exclusion list (files/paths that should not be committed).

We would like to know how we can do the same?

Is it possible to Collect Commit Items using API, remove whatever we want to remove and then commit?

Regards
Rajagopal NS

Re: REMOVING SPECIFIC FILES FROM COMMIT LIST

by Alexander Kitaev-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Yes it is possible. There are two ways to do that:

You may set custom ISVNCommitHandler to SVNCommitClient that will be
called prior to commit:

public String getCommitMessage(
      String message,
      SVNCommitItem[] commitables) throws SVNException {
   commitables[0] = null;
   return message;
}

Above code excludes first item from the list of items to be committed.

Another option is to use two stage commit:

SVNCommitPacket packet =
   commitClient.doCollectCommitItems(paths, keepLocks, force, recursive);
try {
    SVNCommitItem item = packet.getCommitItems()[0];
    packet.setCommitItemSkipped(item, true);
    commitClient.doCommit(packet, keepLocks, commitMessage);
} finally {
    if (packet != null) {
       packet.dispose();
    }
}

Make sure that you always call "packet.dispose()" even if you do not
call "doCommit" - otherwise working copy might remain locked.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://sqljet.com/ - Java SQLite Library!

rajagopal NS wrote:

> We use svnkit 1.1.6.
>
> While using doCommit method of svnCommitClient for committing. We use
> recursive on.
>
> While a committing a directory in a particular session, we want to send some
> exclusion list (files/paths that should not be committed).
>
> We would like to know how we can do the same?
>
> Is it possible to Collect Commit Items using API, remove whatever we want to
> remove and then commit?
>
> Regards
> Rajagopal NS

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...