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

Re: 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 05:28:41 -0500

On Apr 13, 2012, at 04:58, Daniel Shahaf wrote:

> Ryan Schmidt wrote on Fri, Apr 13, 2012 at 04:55:17 -0500:
>>
>> On Apr 13, 2012, at 04:43, Daniel Shahaf wrote:
>>
>>> 1.x-compatible:
>>> use 'svn cat' to obtain a tempfile.
>>
>> That's a good idea. It sounds like this would be less work and
>> automatically backward- and future-compatible.
>
> Indeed. Just make sure to pass @BASE to avoid a round trip to the server.
>
> (you may want to double-check that it indeed avoids a server round-trip
> in that case; it should, but I never verified whether it does.)

There didn't appear to be any traffic to my repository regardless if I added @BASE or not but I added it anyway since you said to.

Here's the new script for anyone interested. Thanks again for your help.

$ cat svntwdiff
#!/bin/bash

# http://svn.haxx.se/users/archive-2012-04/0090.shtml

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

FILE="$1"

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

if [ -z "${TMPDIR}" ]; then
    TMPDIR=/tmp
fi

svn info "${FILE}" >/dev/null || exit $?

TMPFILE="$(mktemp "${TMPDIR}/svntwdiff.XXXXXXXXXX")"

svn cat "${FILE}"@BASE > "${TMPFILE}"

twdiff --wait --resume "${FILE}" "${TMPFILE}"

rm -f "${TMPFILE}"
Received on 2012-04-13 12:29:20 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.