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

Re: Setting Revprops before Revision is Created

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Thu, 24 Jun 2010 20:02:23 +0300 (Jerusalem Daylight Time)

David Weintraub wrote on Thu, 24 Jun 2010 at 19:52 -0000:
> > David Weintraub wrote on Tue, 22 Jun 2010 at 14:40 -0000:
> >> Thanks!
> >>
> >> That's all I have to know. It is possible to set revprops when doing a
> >> commit, so I should have a mechanism to check for those when doing a
> >> commit too.
>
> On Tue, Jun 22, 2010 at 10:38 AM, Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
> > You're welcome.
> >
> > (The mechanism ought to be 'svnlook -t' from the pre-commit hook.)
>
> Yes, you can set the revprops on a commit, but apparently you cannot
> do a "svnlook -t $TX proplist --revprop $REPO".
>

Works for me (using trunk):

[[[
% svn ci -mfoo1 wc1 --with-revprop=k=v
Sending wc1\trunk\iota
Transmitting file data ...\..\..\subversion\svn\commit-cmd.c:142: (apr_err=165001)
..\..\..\subversion\libsvn_client\commit.c:854: (apr_err=165001)
svn: Commit failed (details follow):
..\..\..\subversion\libsvn_repos\commit.c:713: (apr_err=165001)
..\..\..\subversion\libsvn_repos\fs-wrap.c:53: (apr_err=165001)
..\..\..\subversion\libsvn_repos\hooks.c:499: (apr_err=165001)
..\..\..\subversion\libsvn_repos\hooks.c:298: (apr_err=165001)
..\..\..\subversion\libsvn_repos\hooks.c:158: (apr_err=165001)
svn: Commit blocked by pre-commit hook (exit code 1) with output:
  svn:log : foo1
  svn:author : daniel
  svn:check-locks : true
  k : v
  svn:date : 2010-06-24T16:58:23.921875Z
]]]

(using a trivial hook that just runs 'svnlook pl --revprop -v -t $2 $1')

I think it was backported to 1.6.x a couple of releases ago. Can you
check if 1.6.12 still has the bug?

> I keep getting the error "svnlook: Invalid revision number '-1'".
>

It helps to know that

    #define SVN_INVALID_REVNUM -1

> The funny thing is I'm writing in Perl, and I have a check on my
> "open" statement to fail if "svnlook -t$TX proplist -revprop $REPO"
> fails during the open.
>
> However, the open statement doesn't fail. Instead, the failure comes
> when I first attempt to read from that pipe.
>

> I'll take out the whole revprop check mechanism and just have it for
> the "svnlook log". I can check the svn:log for issues.
>

Perhaps you'll reconsider this? The mechanism *is* useful for recent
1.6.x releases and for >=1.7.0 releases.

> Maybe the next revision will allow svnlook to check if a revprop is
> going to be set on the incoming transaction.
>

It does.

>
Received on 2010-06-24 19:04:41 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.