[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-08 23:10:41 CET

Slava, this version looks much better.

> # get max number of revision from range
> REV1=`echo "$1" | sed 's/^\([0-9]\+\):\([0-9]\+\)$/\1/g'`
> REV2=`echo "$1" | sed 's/^\([0-9]\+\):\([0-9]\+\)$/\2/g'`
> if [ $REV1 -gt $REV2 ] ; then
> MAXREV=$REV1
> else
> MAXREV=$REV2
> fi

This will fail if you use a range with non-numeric revisions - say,
HEAD or BASE or {2007-01-25}.

I suggest just splitting on ":" and using REV2 unconditionally. Don't
worry about the case of "520:514" - if people want the newer rev, they
can specify it in the right order.

> mkdir -p "$DIR"/`dirname "$listItem"`
> $SVN cat -r$MAXREV "$listItem" > "$DIR/$listItem"

I suggest 'svn export' instead of 'svn cat'. You don't need the shell
redirection, and more importantly, 'svn export' preserves the execute
permission bits (from the svn:executable property).

Finally, I think you want to use peg-rev syntax - ${listItem}@$MAXREV -
rather than -r syntax. That way you get the same files that the log
messages refer to.

Received on Thu Feb 8 23:10:59 2007

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

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