Subversion Help Needed

Discussion in 'Mac Apps and Mac App Store' started by ferrisb, May 5, 2005.

  1. ferrisb macrumors member

    Joined:
    Jun 23, 2003
    Location:
    Riverton, Utah
    #1
    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:
    svnUnable 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.
     
  2. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #2
    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
     
  3. ferrisb thread starter macrumors member

    Joined:
    Jun 23, 2003
    Location:
    Riverton, Utah
    #3
    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.
     
  4. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #4
    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.
     
  5. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #5
    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
    
     
  6. panphage macrumors 6502

    Joined:
    Jul 1, 2003
    #6
    If the process is named svnserve, you can also do: killall svnserve and that should take care of it.
     
  7. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #7
    Wow... I never knew about that. Thanks for the tip. My previous two posts are officialy useless.
     
  8. panphage macrumors 6502

    Joined:
    Jul 1, 2003
    #8
    I think killall will only work if the process is owned by you though...
     
  9. therevolution macrumors 6502

    Joined:
    May 12, 2003
    #9
    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.
     

Share This Page