You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jay Berkenbilt <ej...@ql.org> on 2004/12/29 18:14:46 UTC

bulk rename in single transaction

Executive summary: I'm looking for a way to do the equivalent of
multiple URL-based svn rename commands in a single transaction in much
the way you can do multiple URL-based svn mkdir commands in a single
transaction by running svn mkdir with multiple arguments.  Options
considered include writing code using subversion APIs, doing lots of
co/update -Ns, or fabricating an incremental dump file and loading it.

------

As part of migrating a 9-year old 1 GB CVS repository to subversion, I
would like to do some bulk manipulation of a few thousand tags:
specifically, I'm renaming and rearranging the directories in the new
repository.  (For example, rather than "tags/release-xml-base-1_6-rh9",
I want "releases/xml-base/rh9/1.6".)

For various reasons, I'd like to do this in a single transaction, and
I'm looking for options.  If I had unlimited disk space, I could just
check out the "tags" directory and do all the changes locally with svn
rename, but this is obviously not an option!  Were it not for the disk
space and checkout time issue, this would be a viable option as I have
the tools and expertise to do massive regular expression-based
renames.

I'm not afraid to write some code, so options that include writing
code using one of the subversion APIs are acceptable.  If there's a
way to do it without writing code, I'd like to hear about that as
well.

One solution I've come up with is to use svn co -N liberally to check
out into a working copy the top-level directories of each tag.  The
following does the job:

svn co -N file:///test/SVN
cd SVN
svn update -N tags
cd tags
files=(`svn ls file:///test/SVN/tags | sed -e 's,/$,,')
svn update -N $files

Then I can rename to my heart's content and do a big checkin at the
end.

The biggest drawback with this is that the svn update command above
took many hours to run.  I'm looking for something a little more
efficient/elegant.  If there were a way for me to specify a maximum
depth, I could an update in tags with a maximum depth of 1, or do a
checkout of tags with a maximum depth of 2.  Hopefully that would run
much faster.

As far as coding options are concerned, not knowing the APIs, I see
two possible options:

 1. Write some code to do a checkout with a maximum depth if such a
    thing is possible using the APIs, then proceed with the local
    renames

 2. Do something else to do multiple renames in a single transaction
    without having a working copy.  This is what I'm really looking
    for.

It's possible, for example, to do multiple URL-based mkdir commands in
a single transaction, but not to do multiple URL-based rename commands
in a single transaction.

What would be ideal would be to able to put all the renames in a file
and run something to generate a single transaction that would perform
all of those operations.

I'm not above fabricating an incremental dump and restoring from it
either.  This looks like it would be quite doable for this case.  Of
course, I would do a backup before doing this. :-)

Other ideas?  Suggestions on how to proceed?  Any help would be
appreciated.

-- 
Jay Berkenbilt <ej...@ql.org>
http://www.ql.org/q/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: bulk rename in single transaction

Posted by Max Bowsher <ma...@ukf.net>.
Jay Berkenbilt wrote:
> Executive summary: I'm looking for a way to do the equivalent of
> multiple URL-based svn rename commands in a single transaction in much
> the way you can do multiple URL-based svn mkdir commands in a single
> transaction by running svn mkdir with multiple arguments.  Options
> considered include writing code using subversion APIs, doing lots of
> co/update -Ns, or fabricating an incremental dump file and loading it.

I haven't used it myself, but the python script RSVN (see the links page) is 
supposed to be able to do this.

Max.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: bulk rename in single transaction

Posted by François Beausoleil <fb...@ftml.net>.
On 2004-12-29 18:28, Jay Berkenbilt wrote:
> I notice that the usage message mentions rmove and also says "Using
> these commands, it is easy to build MOVE, which ...." and that the web
> page doesn't mention rmove.  I'm guessing rmove must have been added
> recently and the no-longer-needed statement was accidentally left at
> the bottom of the usage message.

Yes, you are right.  This was forgotten.  Corrected in r16.

Bye !
François


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: bulk rename in single transaction

Posted by Jay Berkenbilt <ej...@ql.org>.
>   On 2004-12-29 13:14, Jay Berkenbilt wrote:
>   > Other ideas?  Suggestions on how to proceed?  Any help would be
>   > appreciated.
>
>   I am the maintainer of RSVN, and that is exactly what it was designed to 
>   do.  In fact, I refactored my vendor/ area.  It would have taken 
>   something like 300 commits had I done it using the SVN command line 
>   client.  Using a working copy was not possible, as each move operation 
>   took around 20 minutes.
>
>   RSVN Wiki:  https://opensvn.csie.org/traccgi/rsvn/trac.cgi/wiki
>   RSVN Repository:  https://opensvn.csie.org/rsvn/trunk
>
>   Hope that helps,
>   François

Excellent, thanks.  I looked at it earlier today after Max's
suggestion.  It looks like it will do exactly what I want and also
provides a useful example for how to use the python interface.

I notice that the usage message mentions rmove and also says "Using
these commands, it is easy to build MOVE, which ...." and that the web
page doesn't mention rmove.  I'm guessing rmove must have been added
recently and the no-longer-needed statement was accidentally left at
the bottom of the usage message.

-- 
Jay Berkenbilt <ej...@ql.org>
http://www.ql.org/q/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: bulk rename in single transaction

Posted by François Beausoleil <fb...@ftml.net>.
On 2004-12-29 13:14, Jay Berkenbilt wrote:
> Other ideas?  Suggestions on how to proceed?  Any help would be
> appreciated.

I am the maintainer of RSVN, and that is exactly what it was designed to 
do.  In fact, I refactored my vendor/ area.  It would have taken 
something like 300 commits had I done it using the SVN command line 
client.  Using a working copy was not possible, as each move operation 
took around 20 minutes.

RSVN Wiki:  https://opensvn.csie.org/traccgi/rsvn/trac.cgi/wiki
RSVN Repository:  https://opensvn.csie.org/rsvn/trunk

Hope that helps,
François


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org