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

Re: API question: client-side transaction creation

From: Jay Berkenbilt <ejb_at_ql.org>
Date: 2005-02-24 23:47:07 CET

Jay Berkenbilt <ejb@ql.org> wrote:

> I'd like to find or write a program that uses Subversion APIs to
> perform multiple mkdir/copy/move operations in a single transaction at
> that runs from the client side rather than the repository side. I'm
> aware of RSVN which has basically the functionality I'm looking for
> but runs from the repository side. Is anyone aware of a program that
> does this from the client side?

I've written this tool in perl using the SVN client APIs. I intend to
release it somewhere once I've had some time to really use it, but if
anyone's interested in the mean time, let me know. In the absence of
any replies, I'll announce this after my CVS to Subversion migration
is completed since it's likely that I'll be poking at this tool a bit
until that time.

This tool is reasonably involved -- it's over 1,000 lines of perl
code. It consists mostly of a class called QSVN::Transaction that has
methods for mkdir, create_file, copy, move, delete, and commit. When
you call commit, it puts everything in order and creates a tree delta,
figuring out exactly what to do by using ls from the client interface.
(This is an oversimplification.) Then there's a command-line tool
that reads commands from stdin or a file and makes the appropriate
calls. I intend to use this class and another utility class I also
wrote to write some additional tools for my conversion, such as one
that can atomically create branches and tags by copying multiple
directories at once. One of the functions in my utility class can
find a URL x/p given p and a URL that is a child of x (such as that of
the current directory in the working copy). I will be using this to
have my tool automatically read some configuration data from a node in
the repository. I'm being vague here, but I can elaborate if there's
any interest. Basically, the idea is to be able to put .asvn/config
under the root of the repository and have tools find it and read it
dynamically, thus allowing us to implement things like repository-wide
global ignores and other similar features....

I have to say that it was a pleasure to use the subversion APIs. It
was not at all difficult to figure out how to use the perl bindings
once I read through the necessary C header files.

--Jay

-- 
Jay Berkenbilt <ejb@ql.org>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 24 23:50:10 2005

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.