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

RE: Re: Pre-commit hook set to fail if build fails

From: Mark Shead <sheadm_at_optimalinternet.com>
Date: 2005-11-11 16:45:19 CET

Thanks for your help. Here is what I've come up with so far:

#!/bin/sh
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
PATCH=/usr/bin/patch
svn export file:///$REPOS /tmp/$TXN
cd /tmp/$TXN
$SVNLOOK diff --transaction $TXN $REPOS | $PATCH

This seems to work if files are modified, but it doesn't seem to work if
a file has been deleted or moved. If a file is moved or deleted it will
just remove the contents of the old file, but not the file itself. If
the file is moved it removes the contents of the old file, but doesn't
create a new file. It seems to work ok when a file is added for the
first time.

Any suggestions? Is there a better way to go about getting a copy of
what the repository will look like once the transaction has committed?

--Mark

-----Original Message-----
From: si [mailto:sshnug.si@gmail.com]
Sent: Friday, November 11, 2005 9:06 AM
To: users@subversion.tigris.org
Subject: Re: Pre-commit hook set to fail if build fails

> What would be ideal is if you could checkout a transaction, but that
doesn't seem to be possible.

What about an svn checkout of HEAD into a new working copy (or an svn
update of existing working copy to keep things fast), pipe svnlook diff
for the transaction into a patch program against working copy, trigger
your build, report success/failure of build through pre-commit hook.

Doing it in post-commit and then reverting on failure seems fraught with
danger...what happens if 2 developers commit 5 seconds apart, with the
first failing but the second succeeding?

peace
si

p.s. Josh may have meant svnlook diff --transaction

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Nov 11 16:48:32 2005

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.