I successfully installed subversion on my server. When I run the command:

which svn

I get the response:

/usr/bin/svn

I create a repository inside my root directory which is my httpdocs folder with the following command:

svnadmin create ~/svn

I successfully created the following files and folders and configured them and I see the following files and directories inside the svn directory:

conf  db  format  hooks  locks  README.txt

But I cannot create trunk, branch, and tag directories. In fact I cannot create directories period. Here is the command I have been using:

svn mkdir file:///httpdocs/svn/site

When I make this command the message I get is the following:

svn: Could not use external editor to fetch log message; consider setting the
$SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no
'editor-cmd' run-time configuration option was found

Also When I type in url:

http://mydomain.com/svn

I get the follwoing message:

404 - Not Found 

What do I need to do to configure my repository, check to see if my repository is actually working. Oh and I did run the following command:

svnserve -d
2

There are 2 answers

0
David W. On BEST ANSWER

I create a repository inside my root directory which is my httpdocs folder with the following command...

That's not how you get Subversion to work with Apache httpd if that's what you're trying to do. You need the mod_dav and mod_dav_svn modules for Apache. You might have to recompile Apache to get these.

Once you get mod_dav and mod_dav_svn installed, you need to configure your httpd.conf file (or put a configuration file under your httpd's conf.d depending how it's configured on your system) for it to work.

In the end, it's not all that difficult. Most Apache installations have mod_dav and mod_dav_svn added in, and you can see if your http.conf file is configured correctly. The on line Subversion manual will have everything you need to get it working.

svn: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no 'editor-cmd' run-time configuration option was found

Read the message. It says Could not use external editor because you didn't specify one. Again the Subversion on line manual explains it in detail.

Basically, when you commit a change in Subversion, you need to create a commit message. This can be done in two ways:

  • You use the -m option like svn commit -m "This is my commit message".
  • You set the variables SVN_EDITOR, VISUAL, or EDITOR to the name of the program you want to use. For example, in Windows, you'd say C:> set EDITOR=notepad.exe. On Unix, you'd say something like $ export EDITOR=vi. Subversion first checks the value of the SVN_EDITOR variable, then VISUAL, then EDITOR. If none of them are set, it gives you the error you saw.

Why did you get it on the svn mkdir command?

Because you use the URL form of the command, it will make the directory, then commit the change, thus the need for a commit message. This should work:

svn mkdir -m"Adding the site directory to my repository" file:///httpdocs/svn/site

Now, you need to move your repository out of your HTTPDOCs directory. That's a very bad thing to have because it hurts your web server.

If you don't want to use the file:// protocol, you can use svnserve. This is a built-in Subversion repository server and uses the svn:// protocol. Observe:

$ svnadmin create my_repos   #Creates the repository
$ vi my_repos/conf/svnserve.conf  #See footnote 1 below
$ vi my_repos/conf/passwd         #See footnote 1 below
$ svnserve -r my_repos -d
$ svn mkdir -m "Making basic directory layout svn://localhost/trunk \
> svn://localhost/tags svn://localhost/branches
$ export SVN_EDITOR="vi"

Your repository also becomes accessible to all the machines on your network too. Using svnserve is much simpler than Apache httpd, but there are a few issues:

  • You can't run multiple instances of svnserve since it wants to use port 3690 and it doesn't like to share. With Apache httpd, you can have multiple repositories.
  • Security setup with svnserve is limited. With Apache, I can use Windows Active directory or LDAP or I can configure it manually.
  • Some web based subversion repository browsers don't like svnserve.

By the way, if you haven't, go through the Subversion on line manual. It's one of the best manuals I've seen for any open source project.


1 When you setup your repository using svnserve, you need to edit the svnserve.conf file by enabling the line password-db = passed which is about line #20 in the file. Then you have to edit the passed file (located in the same directory) to configure the users and their passwords. Both are very straight forward, but easy to forget, and if you don't do it, you can't commit anything into your repository.

0
Rajeev Singh On

when you need to trunk branches and tags than you have to need the download import_dirs.copy

than after than cd /location/import_dirs.copy than run than command

cd /data/svn/import_dirs.copy/ 
svn import  file:///location of repos/reposname/  -m "inital message"

this is the example of it.....

cd /home/raj/import_dirs.copy/
svn import  file:///srv/svn/nmg/  -m "inital message"

than trunk branches and tags have been done