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

Re: Add text to commit log

From: Erling Wegger Linde <erlingwl_at_gmail.com>
Date: Tue, 11 Mar 2008 14:06:19 +0100

How do I get the working copy then? If I only get REPO:
/home/svn/milesplatform/ and REV: 33 from the Post-Commit hook..?

Thanks, - Erling

On Tue, Mar 11, 2008 at 2:04 PM, Hansa <mythtv_at_logic-q.nl> wrote:
> > Van: Erling Wegger Linde [mailto:erlingwl_at_gmail.com]
> >
>
> > I got it to create the directory and write to the file using full paths.
> >
> > However, I can't update the log using this line:
> >
> > my $RESULT = `$SVN propset -r $REV --revprop svn:log \"new log\"
> > $REPO`; (do I need the \ before the " by the way?)
>
> Yep.. you need the \ before the " :)
>
>
> > I start my script with:
> >
> > ./post-commit '/home/svn/milesplatform/' '33'
> >
> > I got the REPO url and REV nr by writing these to the .txt file
> > earlier, but I get this error:
> >
> > svn: '/home/svn/milesplatform' is not a working copy
>
> Probably because '/home/svn/milesplatform' is not a working copy :)
> I think '/home/svn/milesplatform' is a repository. These things are
> different.
> A 'working copy' is a checkout from a repository.
>
> Regards,
> Hansa
>
>
>
> > On Tue, Mar 11, 2008 at 1:40 PM, Hansa <mythtv_at_logic-q.nl> wrote:
> > > That's probably because it can't find things like the 'mkdir'
> > command in
> > > your environment.
> > >
> > > To set environment variables in your script:
> > > #!/bin/sh
> > >
> > > PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
> > > export PATH
> > >
> > >
> > > REPOS="$1"
> > > REV="$2"
> > >
> > > mkdir "kjdfkasag"
> > > ...
> > >
> > > That should at least set your environment right
> > > good luck..
> > >
> > >
> > > > -----Oorspronkelijk bericht-----
> > > > Van: Erling Wegger Linde [mailto:erlingwl_at_gmail.com]
> > > > Verzonden: dinsdag 11 maart 2008 13:13
> > > > Aan: users_at_subversion.tigris.org
> > > > Onderwerp: Re: Add text to commit log
> > >
> > >
> > > >
> > > >
> > > > I am trying to get this to work now, however my post-commit hook
> > > > doesn't seem to be executed! It works fine when I execute
> > it manually,
> > > > but it isn't started by Subversion. I have tried chmod'ing ++ I have
> > > > read that it might have something to do with the environment
> > > > variables, but I can't find how I should set them. Here are
> > my script
> > > > (it doesn't do very much useful yet, I create the directory just to
> > > > test it..)
> > > >
> > > > post-commit:
> > > >
> > > > #!/bin/sh
> > > >
> > > > REPOS="$1"
> > > > REV="$2"
> > > >
> > > > mkdir "kjdfkasag"
> > > >
> > > > PERL=/usr/bin/perl
> > > >
> > > > $PERL /usr/share/subversion/hook-scripts/post-commit-expand.pl
> > > > "$REPOS" "$REV"
> > > >
> > > >
> > > > And the script it refers to:
> > > > post-commit-expand.pl
> > > >
> > > > #!/usr/bin/perl
> > > >
> > > > open (MYFILE, '>>test.txt');
> > > > print MYFILE " Test..\n";
> > > > close (MYFILE);
> > > >
> > > > However, nothing is executed at all..
> > > >
> > > > Thanks again,
> > > > - Erling
> > > >
> > > > On Mon, Mar 3, 2008 at 9:52 AM, Erling Wegger Linde
> > > > <erlingwl_at_gmail.com> wrote:
> > > > > Thanks, one of these scripts even recognizes Trac issues!
> > > > >
> > > > > So if I get it right, I create a file in /hooks named
> > > > post-commit (no .sh?)
> > > > > that will start a script.
> > > > >
> > > > > I can then use code from
> > > > >
> > > >
> > http://www.telegraphics.com.au/svn/jabberbots/trunk/post-commit-verbose.pl
> > > > > to fetch the log message and then write it back using
> > > > >
> > > > >
> > > > > svn propset -r revision no --revprop svn:log new message URL
> > > > >
> > > > > As long as I get the permissions and paths correct.
> > > > >
> > > > > I'll try this out immediately :D
> > > > >
> > > > > - Erling
> > > > >
> > > > >
> > > > >
> > > > > On Mon, Mar 3, 2008 at 12:30 AM, Toby Thain
> > <toby_at_telegraphics.com.au>
> > > > > wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 2-Mar-08, at 11:06 AM, Erling Wegger Linde wrote:
> > > > > >
> > > > > > Thanks for your tip, this looks very useful =)
> > > > > >
> > > > > >
> > > > > > But how do I do this in practice? Do I need to write some
> > > > kind of script
> > > > > that monitors SVN and checks for new commits? Or is it possible
> > > > to make SVN
> > > > > to start such a script for each commit? Does someone have any
> > > > best practices
> > > > > here? What scripting languages are used (I am mostly familiar
> > > > with Java)?
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Actually you probably want to use a post-commit hook
> > here. This can be
> > > > > written in any language you like (e.g. I use Perl or bash).
> > > > > >
> > > > > >
> > > > > > Examples:
> > > > > >
> > > > > >
> > > >
> > http://www.telegraphics.com.au/svn/jabberbots/trunk/post-commit-brief.sh
> > > > > >
> > > > > >
> > > >
> > http://www.telegraphics.com.au/svn/jabberbots/trunk/post-commit-verbose.pl
> > > > > >
> > > > > >
> > > > > > --Toby
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Thanks again,
> > > > > > Erling (newbie :)
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > On Thu, Feb 21, 2008 at 3:06 PM, prakash tiwary
> > > > <prakash.tiwary_at_gmail.com>
> > > > > wrote:
> > > > > >
> > > > > > >
> > > > > > > Hi Erling,
> > > > > > > I think,You can use post commit hook from there you can
> > > > can call "svn
> > > > > propset " to modify the log message in certain format.
> > > > > > >
> > > > > > > For example:
> > > > > > > svn propset -r revision no --revprop svn:log new
> > message URL
> > > > > > >
> > > > > > > For further informations:
> > > > > http://subversion.tigris.org/faq.html#change-log-msg
> > > > > > >
> > > > > > > I wish it will help you.
> > > > > > >
> > > > > > > Thanks & Regards
> > > > > > > Prakash
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Feb 21, 2008 at 4:07 PM, Erling Wegger Linde
> > > > > <erlingwl_at_gmail.com> wrote:
> > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I'm trying to abstract away different bug trackers such
> > > > as Jira and
> > > > > Trac. If you use their respective Subversion Plugins -
> > Jira relates
> > > > > "PROJECT-2" and Trac #2 to their respective issues. I would
> > > > like to provide
> > > > > a uniform way for the user to add Issuekeys to the
> > commit-log such as
> > > > > project/2. Furthermore to allow the Trac and Jira
> > subversion plugins to
> > > > > recognise these tags I need subversion to expand the commitlogs.
> > > > > > > >
> > > > > > > > An example:
> > > > > > > >
> > > > > > > > The user enters "this issue is related to project/3"
> > > > > > > > Subversion expands this commit log to : "this issue
> > is related to
> > > > > project/3 PROJECT-3 #3".
> > > > > > > >
> > > > > > > > Is it possible to tell subversion to do this
> > (hopefully without
> > > > > recompiling - configuration or add-on /plug-in mechanism would
> > > > be preferred)
> > > > > and how?
> > > > > > > >
> > > > > > > > Any ideas / suggestions would be deeply appreciated!
> > > > > > > >
> > > > > > > > Thanks, Erling
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Med vennlig hilsen
> > > > > > Erling Wegger Linde
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Med vennlig hilsen
> > > > > > Erling Wegger Linde
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Med vennlig hilsen
> > > > > Erling Wegger Linde
> > > >
> > > >
> > > >
> > > > --
> > > > Med vennlig hilsen
> > > > Erling Wegger Linde
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> > > > For additional commands, e-mail: users-help_at_subversion.tigris.org
> > > >
> > >
> > >
> >
> >
> >
> > --
> >
> >
> > Med vennlig hilsen
> > Erling Wegger Linde
> >
> >
> >
> > --
> > Med vennlig hilsen
> > Erling Wegger Linde
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> > For additional commands, e-mail: users-help_at_subversion.tigris.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: users-help_at_subversion.tigris.org
>
>

-- 
Med vennlig hilsen
Erling Wegger Linde
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-11 14:06:51 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.