[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

JavaHL and Transactions

From: <corneil.duplessis_at_gmail.com>
Date: Tue, 18 Aug 2015 08:34:40 +0200

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.

Regards
Corneil du Plessis
Received on 2015-08-18 08:34:46 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.