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

Re: svn-changes-dump

From: Peter Samuelson <peter_at_p12n.org>
Date: 2007-02-09 07:14:29 CET

[Vyacheslav Iutin]
> #svn export somefile.txt@5
> will get HEAD revision of somefile.txt. Or not?

Easy enough to test. Sure enough, 'svn export PATH@REV' defaults to
-rWORKING even when a peg rev is specified. That surprised me. 'svn
export URL@REV' is different, -r defaults to the peg rev.

> # get last revision from range
> MAXREV=${1#*:}

Ahh, much better syntax - I thought about suggesting this before, but I
wasn't sure if it was common to all POSIX shells. But it is, I just

> # get file list
> diffList=`svn log -v -r$1 | grep -E '[[:space:]]{3}(M|A)' | \
> cut -d'/' -f 4-`

No need for a \ continuation character, both because of the `` and
because of the trailing |. But that's a minor matter. (: And
speaking of minor matters - also speaking about POSIX shell features -
I like $() better than ``. I find it more readable, and you can nest

> # create folders and copy files, we copy files of latest revision from range
> for listItem in $diffList ; do
> if [ ! -d "$listItem" ] ; then
> mkdir -p "$DIR"/`dirname "$listItem"`

Insufficient quoting - if `dirname "$listItem"` has spaces in it, mkdir
gets multiple arguments. "`dirname "$listItem"`" works, though as I
said earlier I prefer "$(dirname "$listItem")".

Received on Fri Feb 9 07:14:42 2007

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