9

So, there is a folder in a subversion repository which is incorrectly named. I have been tasked with renaming it. Unfortunately, the repository is very large which means it takes quite a bit of time to try to check things out. It's also continually giving me "connection reset by peer" messages.

Is there a way to simply send the commit instruction to the repository without a checkout? I don't need to have a working checkout locally.

(If it is relevant, the repository is hosted in Assembla)

10

First, for your direct question: svn move allows giving URLs in a repository, to avoid the need for a working copy for this one operation. For example,

svn mv http://example.com/svn/repo/trunk/path/to/dir http://example.com/svn/repo/trunk/path/to/renameddir -m "renaming poorly named directory"

But really, repository size should have basically no impact on this task. You DON'T need to check out a full repository for this task. Probably you don't need to check out the full repository for MOST tasks, really, so you should read on! A concept called a sparse working copy allows you to check out only what you need for your task. Additionally, always only checkout the subtree you need from the repository.

For your immediate task, you can create a working copy containing only the folders in the directory immediately above the one that needs a rename. To continue the example, you would get this working copy like this:

svn co --depth immediates http://example.com/svn/repo/trunk/path/to MY_WORKING_COPY

Note, this will also pull in any files in the "to" directory outside of subdirectories, if there are any. If you want to avoid those, that's also possible:

svn co --depth empty http://example.com/svn/repo/trunk/path/to MY_WORKING_COPY
svn up --set-depth empty MY_WORKING_COPY/dir

Note, the TortoiseSVN client allows easy automation of the second method, if you need a bunch of files/subdirectories.

Search the web for "sparse working copy" and you'll find plenty more info.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.