[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Where is Subversion 1.7's pristine copy of a given file?

From: Ryan Schmidt <subversion-2012a_at_ryandesign.com>
Date: Fri, 13 Apr 2012 03:55:34 -0500

I have not upgraded to Subversion 1.7 yet. I'm still on 1.6.17.

One reason is that there is a script I like to use, that I wrote, called svntwdiff. It goes like this:

$ cat svntwdiff
#!/bin/bash

if [ -z "$1" ]; then
    echo "usage: $0 <file>"
    exit 1
fi

FILE="$1"
FILEDIR="$(dirname "${FILE}")"
FILEBASE="$(basename "${FILE}")"
SVNDIR="${FILEDIR}/.svn"
ORIGFILE="${SVNDIR}/text-base/${FILEBASE}.svn-base"

if [ ! -f "${FILE}" ]; then
    echo "error: ${FILE} doesn't exist"
    exit 1
fi

if [ ! -d "${SVNDIR}" ]; then
    echo "error: ${SVNDIR} doesn't exist; maybe ${FILEDIR} isn't a working copy"
    exit 1
fi

if [ ! -f "${ORIGFILE}" ]; then
    echo "error: ${ORIGFILE} doesn't exist; maybe ${FILE} hasn't been committed yet"
    exit 1
fi

twdiff "${FILE}" "${ORIGFILE}"

"twdiff" is a command-line wrapper that comes with the GUI TextWrangler editor; it opens the two given textfiles in TextWrangler and lets me view and edit the differences between files. I often use svntwdiff to examine changes in a file and selectively back out portions of them.

How can I modify this script to be compatible with a Subversion 1.7 format working copy?
Received on 2012-04-13 10:56:17 CEST

This is an archived mail posted to the Subversion Users mailing list.