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

Re: Better way to get the full rule of the last commit?

From: Daniel Becroft <djcbecroft_at_gmail.com>
Date: Mon, 11 Oct 2010 13:19:39 +1000

---
Daniel Becroft
On Mon, Oct 11, 2010 at 12:34 PM, Tech Geek <techgeek12345_at_gmail.com> wrote:
> All my repositories live under /var/lib/svn/.
>
> Let's the output of the following command (on the SVN server):
> # svn changed /var/lib/svn/projectA/
> is
> A   PartA/tags/DEV-1.00_RC5/
>
> Now in my post-commit hook I need the following value in a variable (say
> EMAIL_URL):
> EMAIL_URL=/var/lib/svn/projectA/PartA/tags/DEV-1.00_RC5
>
> Right now the way I am getting this value in my post-commit hook is as
> follow:
>
> DIRCHANGE=`$SVNLOOK changed "$REPOS" | $GREP "^A\W.*" | cut -d' ' -f4`
> SRC_CO_PATH="$REPOS/$DIRCHANGE"
>
> Is there any command which will return the full path of the directory
> inside that repository under which the changes were made by the last commit?
>
Sure, you used it above. 'svnlook changed' will always return the path
(relative to the repository root) of the changed file.
However, what I think you are after, is the full URL (include repository
path) to that file. That is not possible for SVN to determine, as it does
not know *how* you are serving the repository (HTTP, HTTPS, svn+ssh, svn,
etc). $REPOS will give you the physical path to the repository, not
necessarily the publicly accessible path.
Cheers,
Daniel B.
Received on 2010-10-11 05:20:36 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.