Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ferrisb

macrumors member
Original poster
Jun 23, 2003
52
0
Riverton, Utah
I'm trying to setup svn on my mac, but I'm having a few issues. I've got the client installed, and it works fine with our company repository. However, I'd like to setup my own repo. for my own projects.

I've read that you can do this without having to install Apache 2.0, and use svn with the svnserve app. I'm just having a hard time getting things to work correctly. I was able to use svnadmin to create a new repository, but I can't access it to import any of my projects. I keep getting the following error:

PHP:
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///svnRepo/test1'

Has anyone been able to setup their own repository? I'd like to be able to use it locally, but to also access it online when I'm not at home. I've tried to find some tutorials on how to do this using just the svnserve as I've read about, but can't find any.

Thanks for the help.
 
When you start up svnserve, do it like this:

Code:
svnserve -d -r /path/to/your/repository
Then that path above becomes svnserve's base. Say that within that last directory, you have a project called "myproj". You'd check it out by typing:

Code:
svn co svn://localhost/myproj
Regarding access from home, as long as this machine is directly connected to the Internet, you should be able to get at it like this:

Code:
svn co svn://(machine IP address)/myproj
Hope that helps. I struggled with this not too long ago as well.

EDIT: Found a good svnserve help page: http://rush3d.com/reference/svnbook/ch06s03.html
 
That was just what I needed. Thanks!

I've been screwing with this for a few hours now, and you provided the right answer for me. Thanks again. I've got it working locally, and now I just need to get my online access working now.

As a side note, how can I kill the svnserve program? The only way I've found right now is to use Activity Monitor and use the "Quit Process" button.
 
Unfortunately, UNIX apps are kind of a PITA to quit. What I usually do is 'ps -ax | grep appName', find the PID number, and type 'kill -9 pid'.

One thing you can do is set up a UNIX script that essentially automates this task. Here is one such script I found (source):
Code:
#!/bin/ksh
if [ $# -gt 0 ]; then
process_name=$1
ps_count=`ps -ef | grep -v 'grep' | grep -v 'kill' | grep -i -c $process_name`
echo "Process count: $ps_count"
set -A array_name `ps -ef | grep -i $process_name | grep -v 'grep' | grep -v 'kill' | awk '{print $2}' | sort -u`
print "ps -ef | grep -i $process_name | grep -v 'grep' | grep -v 'kill' | awk '{print \$2 \$8}' | sort -u -n"

print "${array_name[*]}"
kill_count=0
while [ $kill_count -lt $ps_count ]
do
kill -9 ${array_name[$kill_count]}
# print "kill -15 ${array_name[$kill_count]}"
((kill_count=kill_count+1))
done

else
print "Usage: $0 process_name"
print ""
fi
Copy and paste that into a file (in this example, the file is named quitproc). From the terminal, navigate to this file and type
Code:
chmod a+x quitproc
Then, you should be able to kill svnserve by typing
Code:
./quitproc svnserve
Theoretically, anyway. ;) I haven't tried this particular script. Good luck.
 
Not sure how UNIX savvy you are, so I thought I'd add this:

One flaw in my instructions above is that 'quitproc' will only work when you're in the same directory as that file. If move it to /usr/bin, you'll be able to access it from anywhere.

Code:
sudo move quitproc /usr/bin
<enter root password when prompted>

quitproc svnserve
 
If the process is named svnserve, you can also do: killall svnserve and that should take care of it.
 
panphage said:
If the process is named svnserve, you can also do: killall svnserve and that should take care of it.
Wow... I never knew about that. Thanks for the tip. My previous two posts are officialy useless.
 
therevolution said:
Wow... I never knew about that. Thanks for the tip. My previous two posts are officialy useless.
I think killall will only work if the process is owned by you though...
 
panphage said:
I think killall will only work if the process is owned by you though...
Sure, and that's a good thing. You don't want random people killing your processes.

However, if you 'sudo killall', you should be able to kill any process.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.