You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Chris Ross <cr...@markmonitor.com> on 2008/02/11 16:00:55 UTC

Subversion/mod_dav_svn questions

  Hi.  I have a couple of questions that are of the same nature.  The
first is mod_dav_svn specific, I think, and the next is specific to
mailer.py (which I'll put in another message)

  I'm trying to get the repository name reported, in places where it
doesn't show up by default.  First, in the CustomLog from apache.  I am
using Apache (2.0.x) as my access to my repositories, and as suggested
in numerous places, have the following in my configuration:

    CustomLog logs/svn_log "%t %u %{SVN-ACTION}e" env=SVN-ACTION

  However, my configuration is with an overall <Location>, using
SVNParentPath.  And, the above CustomLog spec results in the log
messages looking somewhat like:

[11/Feb/2008:10:48:56 -0500] cross unlock '/foo/newfile'
[11/Feb/2008:10:48:57 -0500] cross commit r12
[11/Feb/2008:10:50:21 -0500] cross commit r13

  Now, I could infer from the revision number what repository this is
in, but that's the only way.  There are at least 3 repositories being
logged to this file by mod_dav_svn, but the repository name isn't being
logged.  Is that available somewhere?

  Thanks...

                        - Chris


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

Re: Subversion/mod_dav_svn questions

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 11, 2008, at 18:32, Matt Pounsett wrote:

> On 2008-Feb-11, at 19:24, Ryan Schmidt wrote:
>
>>>   However, my configuration is with an overall <Location>, using
>>> SVNParentPath.  And, the above CustomLog spec results in the log
>>> messages looking somewhat like:
>
> [...]
>
>>>   Now, I could infer from the revision number what repository  
>>> this is
>>> in, but that's the only way.  There are at least 3 repositories  
>>> being
>>> logged to this file by mod_dav_svn, but the repository name isn't  
>>> being
>>> logged.  Is that available somewhere?
>>
>> It's too bad the repo name doesn't seem to be available as a  
>> separate variable anywhere. I had to parse it out of the URL.
>
> Assuming your <Location> blocks look something like this:
>
>     <Location /myrepo>
>         DAV svn
>         SVNPath /var/svn/repos/myrepo
>     </Location>
>
> Could you do this?
>
>     <Location /myrepo>
>         DAV svn
>         SVNPath /var/svn/repos/myrepo
> 	SetEnv SVN-REPO myrepo
>     </Location>
>
> And then reference 'SVN-REPO' in your custom log entry?
>
> I have no idea if that would work or not.. but it might be worth a  
> try.

If you're using SVNPath pointing to a single repo there isn't much of  
a problem. But the original poster (and me too) was using  
SVNParentPath and therefore multiple repositories.


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

Re: Subversion/mod_dav_svn questions

Posted by Matt Pounsett <ma...@conundrum.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 2008-Feb-11, at 19:24, Ryan Schmidt wrote:

>>   However, my configuration is with an overall <Location>, using
>> SVNParentPath.  And, the above CustomLog spec results in the log
>> messages looking somewhat like:

[...]

>>   Now, I could infer from the revision number what repository this is
>> in, but that's the only way.  There are at least 3 repositories being
>> logged to this file by mod_dav_svn, but the repository name isn't  
>> being
>> logged.  Is that available somewhere?
>
> It's too bad the repo name doesn't seem to be available as a  
> separate variable anywhere. I had to parse it out of the URL.

Assuming your <Location> blocks look something like this:

     <Location /myrepo>
         DAV svn
         SVNPath /var/svn/repos/myrepo
     </Location>

Could you do this?

     <Location /myrepo>
         DAV svn
         SVNPath /var/svn/repos/myrepo
	SetEnv SVN-REPO myrepo
     </Location>

And then reference 'SVN-REPO' in your custom log entry?

I have no idea if that would work or not.. but it might be worth a try.

Matt


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFHsOkvmFeRJ0tjIxERAp5uAJ99jw9IIBo2nEXTRZUHbH0/c8hy8gCdEMmr
B4deO7srMp/fWw0tA9netWg=
=sn3o
-----END PGP SIGNATURE-----

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

Re: Subversion/mod_dav_svn questions

Posted by Chris Ross <cr...@markmonitor.com>.
On Wed, 2008-02-13 at 02:45 -0600, Ryan Schmidt wrote:
> >   That seems to solve a slightly different problem.
> 
> Yes, but I wasn't asking you to use my script; I was recommending you  
> read the read-me file which accompanies my script, which explains the  
> technique I used to get the repository name to my script, which is  
> the bit of information you were asking how to get. The read-me  
> includes the log format for the Apache configuration file. You may  
> also want to read the script to see how that information is taken out  
> of the log and how the repository name is then obtained.

  My apologies.  You're right, of course, that after carefully looking
at both the README (as I'd originally done) and the script itself (which
I hadn't looked at on my first pass), I see now what you're doing.  So
having apache write what I'm looking for directly into the log isn't
possible, it appears, but if I wrote a program (or modified yours) I
could then write into a log file anything I wanted.  I see that.  A
little too clunky for my tastes right now, but I see now how to do it.
Thanks!

> The problem my script solves *does* still exist. Yes, Subversion has  
> a post-commit hook. What it doesn't have is a post-update, post- 
> checkout, post-export or post-switch hook. That's what my script does.

  My apologies again.  That's what I get for typing without checking all
of my facts.  Of course, your script supports things that do in fact not
exist natively in the subversion distribution.

  Thank you again for all of your help.  I'm sorry for being a bit dense
at times.  :-)

                           - Chris


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

Re: Subversion/mod_dav_svn questions

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 12, 2008, at 17:14, Chris Ross wrote:

> On Tue, 2008-02-12 at 13:40 -0600, Ryan Schmidt wrote:
>
>>>> It's too bad the repo name doesn't seem to be available as a  
>>>> separate
>>>> variable anywhere. I had to parse it out of the URL.
>>>
>>>   How did you do this, by the way?  Were you able to get it into
>>> the log
>>> file, as I described my desire above?
>>
>> Yes, in a way. You can read about my method in the read-me file for
>> my svnhookdispatcher script:
>>
>> http://www.ryandesign.com/svnhookdispatcher/
>
>   That seems to solve a slightly different problem.

Yes, but I wasn't asking you to use my script; I was recommending you  
read the read-me file which accompanies my script, which explains the  
technique I used to get the repository name to my script, which is  
the bit of information you were asking how to get. The read-me  
includes the log format for the Apache configuration file. You may  
also want to read the script to see how that information is taken out  
of the log and how the repository name is then obtained.

> And, the original
> problem you're solving doesn't exist any more, as subversion  
> already has
> mechanisms for post-commit hook scripts, which is what I'm using now.

The problem my script solves *does* still exist. Yes, Subversion has  
a post-commit hook. What it doesn't have is a post-update, post- 
checkout, post-export or post-switch hook. That's what my script does.

> The problem I'm having is that that post-commit script, nor the
> mailer.py script I'm having it run, appear to be able to get to the
> repository name.
>
>   I suppose I could set it in the environment from the post-commit
> script, and modify mailer.py to look in the environment for it.  It  
> just
> seems like mailer.py would already have a way to get to the bits that
> were the arguments to the post-commit script...
>
>   Thanks much for your help!  It did expose a new option...


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

Re: Subversion/mod_dav_svn questions

Posted by Chris Ross <cr...@markmonitor.com>.
On Tue, 2008-02-12 at 13:40 -0600, Ryan Schmidt wrote:
> >> It's too bad the repo name doesn't seem to be available as a separate
> >> variable anywhere. I had to parse it out of the URL.
> >
> >   How did you do this, by the way?  Were you able to get it into  
> > the log
> > file, as I described my desire above?
> 
> Yes, in a way. You can read about my method in the read-me file for  
> my svnhookdispatcher script:
> 
> http://www.ryandesign.com/svnhookdispatcher/

  That seems to solve a slightly different problem.  And, the original
problem you're solving doesn't exist any more, as subversion already has
mechanisms for post-commit hook scripts, which is what I'm using now.
The problem I'm having is that that post-commit script, nor the
mailer.py script I'm having it run, appear to be able to get to the
repository name.

  I suppose I could set it in the environment from the post-commit
script, and modify mailer.py to look in the environment for it.  It just
seems like mailer.py would already have a way to get to the bits that
were the arguments to the post-commit script...

  Thanks much for your help!  It did expose a new option...

                              - Chris

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

Re: Subversion/mod_dav_svn questions

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 12, 2008, at 09:26, Chris Ross wrote:

> On Mon, 2008-02-11 at 18:24 -0600, Ryan Schmidt wrote:
>
>>>     CustomLog logs/svn_log "%t %u %{SVN-ACTION}e" env=SVN-ACTION
>>>
>>>   However, my configuration is with an overall <Location>, using
>>> SVNParentPath.  And, the above CustomLog spec results in the log
>>> messages looking somewhat like:
>>>
>>> [11/Feb/2008:10:48:56 -0500] cross unlock '/foo/newfile'
>>> [11/Feb/2008:10:48:57 -0500] cross commit r12
>>> [11/Feb/2008:10:50:21 -0500] cross commit r13
>>>
>>>   Now, I could infer from the revision number what repository  
>>> this is
>>> in, but that's the only way.  There are at least 3 repositories  
>>> being
>>> logged to this file by mod_dav_svn, but the repository name isn't
>>> being
>>> logged.  Is that available somewhere?
>>
>> It's too bad the repo name doesn't seem to be available as a separate
>> variable anywhere. I had to parse it out of the URL.
>
>   How did you do this, by the way?  Were you able to get it into  
> the log
> file, as I described my desire above?

Yes, in a way. You can read about my method in the read-me file for  
my svnhookdispatcher script:

http://www.ryandesign.com/svnhookdispatcher/



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

Re: Subversion/mod_dav_svn questions

Posted by Chris Ross <cr...@markmonitor.com>.
On Mon, 2008-02-11 at 18:24 -0600, Ryan Schmidt wrote: 
> >     CustomLog logs/svn_log "%t %u %{SVN-ACTION}e" env=SVN-ACTION
> >
> >   However, my configuration is with an overall <Location>, using
> > SVNParentPath.  And, the above CustomLog spec results in the log
> > messages looking somewhat like:
> >
> > [11/Feb/2008:10:48:56 -0500] cross unlock '/foo/newfile'
> > [11/Feb/2008:10:48:57 -0500] cross commit r12
> > [11/Feb/2008:10:50:21 -0500] cross commit r13
> >
> >   Now, I could infer from the revision number what repository this is
> > in, but that's the only way.  There are at least 3 repositories being
> > logged to this file by mod_dav_svn, but the repository name isn't  
> > being
> > logged.  Is that available somewhere?
> 
> It's too bad the repo name doesn't seem to be available as a separate  
> variable anywhere. I had to parse it out of the URL.

  How did you do this, by the way?  Were you able to get it into the log
file, as I described my desire above?

                        - Chris


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

Re: Subversion/mod_dav_svn questions

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Feb 11, 2008, at 10:00, Chris Ross wrote:

>   I'm trying to get the repository name reported, in places where it
> doesn't show up by default.  First, in the CustomLog from apache.   
> I am
> using Apache (2.0.x) as my access to my repositories, and as suggested
> in numerous places, have the following in my configuration:
>
>     CustomLog logs/svn_log "%t %u %{SVN-ACTION}e" env=SVN-ACTION
>
>   However, my configuration is with an overall <Location>, using
> SVNParentPath.  And, the above CustomLog spec results in the log
> messages looking somewhat like:
>
> [11/Feb/2008:10:48:56 -0500] cross unlock '/foo/newfile'
> [11/Feb/2008:10:48:57 -0500] cross commit r12
> [11/Feb/2008:10:50:21 -0500] cross commit r13
>
>   Now, I could infer from the revision number what repository this is
> in, but that's the only way.  There are at least 3 repositories being
> logged to this file by mod_dav_svn, but the repository name isn't  
> being
> logged.  Is that available somewhere?

It's too bad the repo name doesn't seem to be available as a separate  
variable anywhere. I had to parse it out of the URL.


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