icramc
icramc

Reputation: 248

Anatomy of an .svn folder

While trying to commit a change with svn I got svn: Illegal repository URL '' error. Later found out that URL and Repository Root starts with file:// when I do svn info. I was told to edit the .svn/entries and update the URL and Repository Root with the correct paths.

I have been using svn for sometime but never had a need to get into .svn directory to do anything except the above problem. Could someone explain what is each file/folder for inside .svn and when it is needed to hack into these to fix something?

Upvotes: 2

Views: 1590

Answers (2)

alroc
alroc

Reputation: 28194

You should never edit the contents of .svn directly unless you know exactly what you're doing and why. It should only be touched via the Subversion client libraries.

Editing the contents of .svn directly may get the desired results. Or it may break your working copy completely.

To change where your repository points, you should use svn switch to point to a different path within the same repository, and svn relocate (or svn switch --relocate in versions that haven't implemented the alias yet) to point to the same repository path on a different host/protocol.

You can't, to my knowledge, change both the host/protocol and the path inside the repository. For that, you'll need to check out a new working copy and migrate any changes over to it manually.

Upvotes: 2

james
james

Reputation: 832

Try 'svn help switch', used to switch a working copy to a new URL. Be sure to read the bits on '--ignore-ancestry' and '--relocate' (which switches from file:// to http://, apparently).

And, as a safety thing, you might copy the working copy to a different directory so that there's no chance of any changes being lost.

That way, at the very worst, you could check out a new working copy and then copy your changes over.

Also, I'm on svn 1.7.5. You didn't mention your version.

Upvotes: 1

Related Questions