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

Re: Edit author pre-revprop-change

From: Silver Zachara <silver.zachara_at_gmail.com>
Date: Thu, 27 Nov 2008 11:07:51 +0100

Hi,

David Weintraub send me this script, I wan to say a word of thanks to
him. I will test this script now.

thank you Dave.

I'm a Perl person and not a Python person, so here's a quick Perl script:

======================
!# /usr/bin/env perl
use warnings;
use strict;

# Set where the "svnlook" command is located
my $svnlook = qq(path/to/svnlook/svnlook);

# Get the various parameters
my ($reposPath, $revision, $user, $propName, $action) = @ARGV;

# Find the actual author of the revision
my $author = qx($svnlook propget --revprop -r$revision $reposPath
svn:author);

# Okay if the author is modifying a log entry they made
if (($action -eq "M") and ($propName -eq "svn:log") and ($author -eq
$user)) {
    exit 0; #Everything is fine!
}

die qq(The only revision property that may be changed is the comment,
and only the author may do that);
=======================

You can download ActiveState's Perl at http://activestate.com. Click on
the download links, and then find the ActivePerl download. Don't
download the Pro-Studio version.

Then, all you need to do is setup the pre-revprop-change.bat trigger to
execute your Perl script.

--
David Weintraub
qazwart_at_gmail.com <mailto:qazwart_at_gmail.com>
-- 
-------------------------------------------------------------------
                      --== Silver Zachara ==--
- pgp - http://radeonvmod.ic.cz/keys/silver.zachara@gmail.com.asc -

Received on 2008-11-27 11:08:12 CET

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.