? Earlier 7 items total Later ?

On this page:?

svnserve launchd item for OS X 10.4

It's not that straightforward getting svnserve to work under launchd. I can't take the credit for this but I thought it would be useful to have it here on TextSnippets.

1) Install subversion if you don't have it already. Here's how with DarwinPorts.

sudo port install subversion


2) Create your Subversion repository (for my own use, I used /Users/xyz/Repositories) e.g.

svnadmin create /Users/xyz/Repositories


3) Place the following XML into a file named org.tigris.subversion.svnserve in the /Library/LaunchDaemons directory.





        Debug
        
        GroupName
        xyz
        Label
        org.tigris.subversion.svnserve
        OnDemand
        
        Program
        /opt/local/bin/svnserve
        ProgramArguments
        
                svnserve
                --inetd
                --root=/Users/xyz/Repositories
        
        ServiceDescription
        SVN Version Control System
        Sockets
        
                Listeners
                
                        SockFamily
                        IPv4
                        SockServiceName
                        svn
                        SockType
                        stream
                
        
        Umask
        2
        UserName
        xyz
        inetdCompatibility
        
                Wait
                
        




You'll need to change xyz to your user name ...

4) Test it out by doing a

sudo launchctl load /Library/LaunchDaemons/org.tigris.subversion.svnserve

sudo launchctl start /Library/LaunchDaemons/org.tigris.subversion.svnserve

svn co svn://your.host.name/aModule/In/Your/Repository

Finding files to be added

svn add `svn st | grep '\?' | tr '\?' ' ' | xargs`

stop creating useless .ds_store files on your non-mac network share

http://docs.info.apple.com/article.html?artnum=301711

1. Open the Terminal.
2. Type:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true

3. Press Return.
4. Restart the computer.

now you'll no longer fill the windows file server with annoying .ds_store files. you'll no longer unknowingly commit hundreds of irrelevent .ds_store files to your subversion repository mounted over webdav with auto-versioning. rejoice.

knowning how many commits it actually took you

If you use the same repository for mostly everything, you'll occasionally find it amusing that your brand new project is at r1800 or that that old project not touched since r60 now shares r2385 with everyone else.

Well, amusing != useful, so here's what I use when I'm curious about how many commits a certain project took me:

svn log --stop-on-copy | grep -e "--------" | wc -l

Backing up subversion repositories from a remote machine

#!/usr/local/bin/bash
#
# Author: Jacques Marneweck 
# License: http://www.php.net/license/3_0.txt PHP License v3.0
# http://www.powertrip.co.za/

LOCALVER=`/usr/local/bin/svnlook youngest /home/svn/livejournal`
REMOTEVER=`/usr/bin/ssh jacques@hostname /usr/local/bin/svnlook youngest /home/svn/livejournal`
echo "Local version is ${LOCALVER}"
echo "Remote version is ${REMOTEVER}"

if [ "$REMOTEVER" -gt "$LOCALVER" ];
then
  echo "Remote version is greater than local version"
  START=$(echo "${LOCALVER} + 1" | /usr/bin/bc -l)
  /usr/bin/ssh jacques@hostname /usr/local/bin/svnadmin dump --incremental --deltas --revision ${START}:${REMOTEVER} /path/to/repo | /usr/local/bin/svnadmin load --ignore-uuid /path/to/repo
else
  echo "Both local and remote version have the same data"
fi

SVNnotify post-commit hook

For example, the post-commit hook for the repository named "repos"
pacific# cat /home/svn/repos/hooks/post-commit


is

#!/bin/sh
REPOS="$1"
REV="$2"
/usr/local/bin/svnnotify -r $REV -C -d -H HTML::ColorDiff -p $REPOS -t [email protected] --from [email protected] --reply-to [email protected]

Switching a working copy with subversion

If you find that the location to a subversion repository has changed, do this:

svn switch --relocate http://textpattern.com/svn/repos/current/textpattern http://svn.textpattern.com/current/textpattern


Where the old url is http://textpattern.com/svn/repos/current/textpattern

And the new one is http://svn.textpattern.com/current/textpattern

To see if it worked, do this:

svn info | grep URL


And you should see something like this:

URL: http://svn.textpattern.com/current/textpattern


(source: Switching a Working Copy)

? Earlier 7 items total Later ?