Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

Need help with trac-post-commit-hook command

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


yinglcs at gmail

Jan 17, 2007, 9:21 AM

Post #1 of 15 (4699 views)
Permalink
Need help with trac-post-commit-hook command

Hi,

I am trying to get the 'trac-post-commit-hook' to work. When I 'svn
commit' I already put 'Fix #4...' in my commit message:


export TRAC_ENV=/srv/svn/tracenv

$ ~/src/trac-0.10.3/contrib/trac-post-commit-hook -u yinglcs -m 'Fix
standalone mode' -s http://localhost/tracprojects/sample -r 9 -p
/srv/svn/tracenv/sample

I don't see any error message from the command.
I have change the path, '/srv/svn/tracenv', '/srv/svn/tracenv/sample',
they are valid.
And I have hit 'http://localhost/tracprojects/sample' with my browser,
so the url is valid too.

But I don't see anything changed, from the timeline of the Trac, there
is no new activity. And when I view my tickets, it does not associate
my changes with a specified ticket.

Can you please tell me what am I missing.

Thank you.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


manu.blot at gmail

Jan 17, 2007, 9:43 AM

Post #2 of 15 (4468 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

> $ ~/src/trac-0.10.3/contrib/trac-post-commit-hook -u yinglcs -m 'Fix
> standalone mode' -s http://localhost/tracprojects/sample -r 9 -p
> /srv/svn/tracenv/sample
>
> Can you please tell me what am I missing.

At least a valid log message: -m "Fixes #4 ..." ...

Cheers,
Manu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


richard.matsunaga at waypointinfo

Jan 17, 2007, 9:54 AM

Post #3 of 15 (4443 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

I'm a little confused by what you have done.

To enable the SVN hooks, you really only need to enable the 'post-commit'
hook in your subversion hooks directory. There is already a template there
(post-commit.tmpl) that you need to make executable and edit the particulars
of the script for your installation.

Cheers,
Richard

-----Original Message-----
From: trac-users [at] googlegroups [mailto:trac-users [at] googlegroups] On
Behalf Of ying lcs
Sent: January 17, 2007 12:22 PM
To: trac-users [at] googlegroups
Subject: [Trac] Need help with trac-post-commit-hook command


Hi,

I am trying to get the 'trac-post-commit-hook' to work. When I 'svn commit'
I already put 'Fix #4...' in my commit message:


export TRAC_ENV=/srv/svn/tracenv

$ ~/src/trac-0.10.3/contrib/trac-post-commit-hook -u yinglcs -m 'Fix
standalone mode' -s http://localhost/tracprojects/sample -r 9 -p
/srv/svn/tracenv/sample

I don't see any error message from the command.
I have change the path, '/srv/svn/tracenv', '/srv/svn/tracenv/sample', they
are valid.
And I have hit 'http://localhost/tracprojects/sample' with my browser, so
the url is valid too.

But I don't see anything changed, from the timeline of the Trac, there is no
new activity. And when I view my tickets, it does not associate my changes
with a specified ticket.

Can you please tell me what am I missing.

Thank you.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


me at mattgillen

Jan 17, 2007, 10:20 AM

Post #4 of 15 (4481 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

ying lcs wrote:
>
> Hi,
>
> I am trying to get the 'trac-post-commit-hook' to work. When I 'svn
> commit' I already put 'Fix #4...' in my commit message:
>
>
> export TRAC_ENV=/srv/svn/tracenv
>
> $ ~/src/trac-0.10.3/contrib/trac-post-commit-hook -u yinglcs -m 'Fix
> standalone mode' -s http://localhost/tracprojects/sample -r 9 -p
> /srv/svn/tracenv/sample
>
> I don't see any error message from the command.
> I have change the path, '/srv/svn/tracenv', '/srv/svn/tracenv/sample',
> they are valid.
> And I have hit 'http://localhost/tracprojects/sample' with my browser,
> so the url is valid too.
>
> But I don't see anything changed, from the timeline of the Trac, there
> is no new activity. And when I view my tickets, it does not associate
> my changes with a specified ticket.
>
> Can you please tell me what am I missing.

Don't make up a new log message, use svnlook to extract it for you:
LOG=`svnlook log -r $REV $REPOS`
trac-post-commit-hook -u yinglcs -m $LOG -s...

(likewise with the 'author' parameter: AUTHOR=`svnlook author -r $REV $REPOS`)

Matt

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


marcus at synchromedia

Jan 17, 2007, 10:24 AM

Post #5 of 15 (4488 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

One thing to look out for - because the trac post commit script is
maintained independent of trac releases, there's no way to tell which
version you should be using with which version of trac. It happens
that the current version seems to want 0.11-dev as it refers to
things (utc date thing) that are only in there. Weirdly, I have it
complaining about this under 0.10.3 but for only one user, though the
config is common to all.

Marcus
--
Marcus Bointon
Synchromedia Limited: Creators of http://www.smartmessages.net/
marcus [at] synchromedia | http://www.synchromedia.co.uk/



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


me at mattgillen

Jan 17, 2007, 10:25 AM

Post #6 of 15 (4455 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

There a couple reasons you'd need to run the script outside of the normal SVN
hooks location. One reason is that he made commits before installing the hook
and wants Trac to recognize that.

Richard Matsunaga wrote:
>
> I'm a little confused by what you have done.
>
> To enable the SVN hooks, you really only need to enable the 'post-commit'
> hook in your subversion hooks directory. There is already a template there
> (post-commit.tmpl) that you need to make executable and edit the
> particulars
> of the script for your installation.
>
> Cheers,
> Richard
>
> -----Original Message-----
> From: trac-users [at] googlegroups [mailto:trac-users [at] googlegroups] On
> Behalf Of ying lcs
> Sent: January 17, 2007 12:22 PM
> To: trac-users [at] googlegroups
> Subject: [Trac] Need help with trac-post-commit-hook command
>
>
> Hi,
>
> I am trying to get the 'trac-post-commit-hook' to work. When I 'svn commit'
> I already put 'Fix #4...' in my commit message:
>
>
> export TRAC_ENV=/srv/svn/tracenv
>
> $ ~/src/trac-0.10.3/contrib/trac-post-commit-hook -u yinglcs -m 'Fix
> standalone mode' -s http://localhost/tracprojects/sample -r 9 -p
> /srv/svn/tracenv/sample
>
> I don't see any error message from the command.
> I have change the path, '/srv/svn/tracenv', '/srv/svn/tracenv/sample', they
> are valid.
> And I have hit 'http://localhost/tracprojects/sample' with my browser, so
> the url is valid too.
>
> But I don't see anything changed, from the timeline of the Trac, there
> is no
> new activity. And when I view my tickets, it does not associate my changes
> with a specified ticket.
>
> Can you please tell me what am I missing.
>
> Thank you.
>
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


cboos at neuf

Jan 17, 2007, 10:33 AM

Post #7 of 15 (4471 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

Matthew Gillen wrote:
> ...
> Don't make up a new log message, use svnlook to extract it for you:
> LOG=`svnlook log -r $REV $REPOS`
> trac-post-commit-hook -u yinglcs -m $LOG -s...
>
> (likewise with the 'author' parameter: AUTHOR=`svnlook author -r $REV
> $REPOS`)

Note that the latest incarnation of the trac-post-commit-hook script
(both in 0.10-stable and trunk) are now much simpler to call and less
error prone w.r.t. encoding issues, based on the work of markus.
The log and author information are now fetched using the Trac API, which
always give correct unicode strings back, regardless of the console
encoding and other vodoo considerations... so they don't need to be
setup on the command line anymore.
And there's even a .cmd script for Windows ;)

-- Christian


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


yinglcs at gmail

Jan 19, 2007, 12:27 PM

Post #8 of 15 (4475 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

Thanks.

I am using Trac 0.10.3 with subversion 1.4.2 on linux

I try this again:
$ svn commit -m "Fixes #1"
$ ~/src/trac-0.10.3/contrib/trac-post-commit-hook -u yinglcs -m "Fixes
#1" -s http://localhost/tracprojects/sample -p /srv/svn/tracenv/sample

But all I can see is my trouble ticket #1 is being closed (I assume it
is done by the post-commit-hook script), but I don't see the tricket #1
is tagged with my changes I committed.

Can you please tell me what am I missing?

Thank you.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


manu.blot at gmail

Jan 19, 2007, 1:38 PM

Post #9 of 15 (4452 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

> But all I can see is my trouble ticket #1 is being closed (I assume it
> is done by the post-commit-hook script), but I don't see the tricket #1
> is tagged with my changes I committed.

I'm not sure about what you actually expect from this script:

The script will close the ticket, and add a reference to the changeset
(that contains your changes), using the usual wiki syntax "(In [rev])
Fixes #1", where rev is the revision number, and [rev] is a link to
the changeset view, i.e. the list of changed files and the formatted
diff.

Do you see the [rev] link in the ticket comment?

Cheers,
Manu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


R.Sokoll at intershop

Jan 19, 2007, 1:45 PM

Post #10 of 15 (4443 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

On Fri, Jan 19, 2007 at 08:27:08PM -0000, yinglcs [at] gmail wrote:

> I try this again:
> $ svn commit -m "Fixes #1"
> $ ~/src/trac-0.10.3/contrib/trac-post-commit-hook -u yinglcs -m "Fixes
> #1" -s http://localhost/tracprojects/sample -p /srv/svn/tracenv/sample
>
> But all I can see is my trouble ticket #1 is being closed (I assume it
> is done by the post-commit-hook script), but I don't see the tricket #1
> is tagged with my changes I committed.
>
> Can you please tell me what am I missing?

Read the usage instructions in the script:

------8<-------
# It should be called from the 'post-commit' script in Subversion, such
# as
# via:
#
# REPOS="$1"
# REV="$2"
# LOG=`/usr/bin/svnlook log -r $REV $REPOS`
# AUTHOR=`/usr/bin/svnlook author -r $REV $REPOS`
# TRAC_ENV='/somewhere/trac/project/'
# TRAC_URL='http://trac.mysite.com/project/'
#
# /usr/bin/python /usr/local/src/trac/contrib/trac-post-commit-hook \
# -p "$TRAC_ENV" \
# -r "$REV" \
# -u "$AUTHOR" \
# -m "$LOG" \
# -s "$TRAC_URL"
------8<-------

Rainer

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


yinglcs at gmail

Jan 19, 2007, 1:46 PM

Post #11 of 15 (4465 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

Thanks for your response.

I only see these entries in the change history of my ticket, no [rev]
link:
01/19/07 14:15:45 changed by yinglcs ¶

* status changed from new to closed.
* resolution set to fixed.

(In [None]) Fixes #1

I expected to see it associates my ticket with what changes I put in in
subversion. Right now, I don't any information in my ticket which shows
what changes i made for this ticket.

Thank you for any more pointers.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


dherman at ediets

Jan 19, 2007, 1:56 PM

Post #12 of 15 (4455 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

That's probably because it's not running the hookscript.

-----Original Message-----
From: trac-users [at] googlegroups [mailto:trac-users [at] googlegroups] On Behalf Of yinglcs [at] gmail
Sent: Friday, January 19, 2007 4:46 PM
To: Trac Users
Subject: [Trac] Re: Need help with trac-post-commit-hook command


Thanks for your response.

I only see these entries in the change history of my ticket, no [rev]
link:
01/19/07 14:15:45 changed by yinglcs ¶

* status changed from new to closed.
* resolution set to fixed.

(In [None]) Fixes #1

I expected to see it associates my ticket with what changes I put in in subversion. Right now, I don't any information in my ticket which shows what changes i made for this ticket.

Thank you for any more pointers.




--
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


manu.blot at gmail

Jan 19, 2007, 3:14 PM

Post #13 of 15 (4458 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

> (In [None]) Fixes #1

^^^ None : that's it. I guess that's None (instead of a revision
number) is because you run the script with some invalid parameters.
(missing the -r option)

It should run fine once Subversion calls it from its hooks directory.

Cheers,
Manu

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


yinglcs at gmail

Jan 19, 2007, 7:24 PM

Post #14 of 15 (4456 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

Thanks for all the help.

I tried this:
1. copy the track-post-commit-hook to
/srv/svn/repositories/sample/hooks
2. rename it to post-commit
3. make sure it is executable
4. go to my svn working directory and execute 'svn commit -m "Fixes
#3.'

But my trouble ticket #3 hasnot closed and there is not files
associated with my ticket.
My understanding is the trac post-commit will be executed by
subversion, but it does not look like it did.

Thanks for any more pointers.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


kantrn at rpi

Jan 19, 2007, 8:29 PM

Post #15 of 15 (4455 views)
Permalink
Re: Need help with trac-post-commit-hook command [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jan 19, 2007, at 10:24 PM, yinglcs [at] gmail wrote:

>
> Thanks for all the help.
>
> I tried this:
> 1. copy the track-post-commit-hook to
> /srv/svn/repositories/sample/hooks
> 2. rename it to post-commit

No, you need to call the trac script from the normal post-commit
script. The trac hook script takes different arguments than the main
one. Look at the top of the trac script to see how to call it.

> 3. make sure it is executable
> 4. go to my svn working directory and execute 'svn commit -m "Fixes
> #3.'
>
> But my trouble ticket #3 hasnot closed and there is not files
> associated with my ticket.
> My understanding is the trac post-commit will be executed by
> subversion, but it does not look like it did.
>
> Thanks for any more pointers.
>
>
> >

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

iD8DBQFFsZqUA9fEp2eRsU8RAkSWAJwIOVIst2g2iV9Or2eECzPlfqO+jwCeKwbk
aOpuiNmzoXDJv0aT6eRfOeo=
=qtny
-----END PGP SIGNATURE-----

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users-unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.