subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko ─îibej <br...@wandisco.com>
Subject Re: JavaHL and Transactions
Date Tue, 18 Aug 2015 06:49:26 GMT
On 18.08.2015 08:34, corneil.duplessis@gmail.com wrote:
> I am in the process of developing a set of utilities for managing the
> 'promotion' of code from trunk to specific tags etc. The project has been
> doing tag based development for more than 10 years and is now moving from
> CVS to SVN.
>
> I am using the JavaHL api from org.apache.subversion.javahl
> From my experience as a user of Subversion in Eclipse and other tools I
> come to expect support for performing multiple operations in a
> 'transaction' which results in one new version with the relevant comments.
>
> I cannot figure out how to do this with the JavaHL api.
>
> As an example:
> Give the following structure:
> PROJECT1/trunk/sub-project1/files/test.txt
> PROJECT1/trunk/sub-project1/files/test2.txt
> PROJECT1/trunk/sub-project1/morefiles/test3.txt
>
> A promotion of sub-project1 to 'integration' would entail
> copy from PROJECT1/trunk/sub-project1 to PROJECT1/tags/integration/sub-
> project1
> This can be done on cmd line using svn copy
>
>
> Assume someone then modifies test2.txt and test3/txt on trunk and committed
> those changes. Our requirements are to make a backup of the target sub
> project before applying the changes so that a 'demote' can be performed if
> needed.
> A new promotion should now entail:
> create:
> PROJECT1/tags/BACKUP_integration_20150812_180902_username/sub-project1/files
> PROJECT1/tags/BACKUP_integration_20150812_180902_username/sub-project1/morefiles
> move the files that are being modified:
> PROJECT1/tags/integration/sub-project1/files/test2.txt to
> PROJECT1/tags/BACKUP_integration_20150812_180902_username/sub-project1/files/test2.txt
> PROJECT1/tags/integration/sub-project1/morefiles/test3.txt to
> PROJECT1/tags/BACKUP_integration_20150812_180902_username/sub-project1/morefiles/test3.txt
> copy the file that is not modified:
> PROJECT1/tags/integration/sub-project1/files/test.txt to
> PROJECT1/tags/BACKUP_integration_20150812_180902_username/sub-project1/files/test.txt
> copy the modified files from trunk to tags/integration
> PROJECT1/trunk/sub-project1/files/test2.txt to
> PROJECT1/tags/integration/sub-project1/files/test2.txt
> PROJECT1/trunk/sub-project1/morefiles/test3.txt to
> PROJECT1/trunk/sub-project1/morefiles/test3.txt
>
>
> To perform these operations involve multiple api calls and a new version
> for each operation.
> The api allows for multiple files are in the same source and target folder
> in the case of copy and move operations.
>
> It would be some much cleaner with transactions resulting in one new
> version so that it is easy to identify all the related operations.
>
> From an exploration of the C api it seems that transactions are supported.
> I would like to know if I have missed something somewhere.

There is no public API equivalent for the functionality of the svnmucc
tool. There's a *private* API for that in libsvn_client, but it's not
exposed in JavaHL. In C, you can get equivalent functionality by using
the libsvn_ra layer directly; most of that is available in JavaHL
through the ISVNRemote interface in 1.9. See
ISVNRemote.getCommitEditor() and ISVNEditor.

-- Brane

Mime
View raw message