On Friday, October 13, 2017 at 12:04:41 PM UTC-7, Nicolas MARTIN wrote:
>
> Hello Trac users, 
>
>
> I'd like to add the commit ticket updater feature to our project so I 
> followed the instructions from 
> https://trac.edgewall.org/wiki/CommitTicketUpdater and then 
> https://trac.edgewall.org/wiki/1.0/TracRepositoryAdmin in order to 
> enable explicit repository synchronisation. 
>
> Under svn directory, I appended a existing Perl script used for emailing 
> commit notification with the next lines: 
>
> ## Explicit repository synchronization for updating ticket based on commit 
> log message ('Commit Ticket Updater') 
> my @cmd = ('/usr/bin/trac-admin'); 
> push @cmd, '/path/to/project/trac'; 
> push @cmd, "changeset added $ARGV[0] $ARGV[1]"; 
> system(@cmd) == 0 or die "Python 'post-commit' script returned error $?"; 
>
> When pushing a commit, a developer get the error message: 
>
> Warning: post-commit hook failed (exit code 2) with output: 
>
> Error: TimeoutError: Unable to get database connection within 0 seconds. 
> (TracError: Database "/path/to/project/trac/db/trac.db" not found.) 
>
> When I made some tests under project user, I had no issue because 
> trac-admin knows that we are on a PostgreSQL DB with database option in 
> trac.ini. I even made an utter test with a void environment (seems no 
> user environment variable) : 
>
> $ env - /usr/bin/perl ./post-commit /path/to/project/svn $rev 
>
> Does somebody have a clue how I can get this post-commit hook working ? 
>


That error is puzzling if your [trac] database string points to a 
PostgreSQL database. I haven't seen that one before.

I would use trac-svn-hook. I added documentation for it in Trac 1.2, but 
the documentation should be applicable to Trac 1.0 as well:
https://trac.edgewall.org/wiki/TracRepositoryAdmin#Subversion

If you are on SVN 1.8 or later you can use hooks-env variables 
configuration, using documentation for the forthcoming Trac 1.4 and 
trac-svn-hook from the trunk. It should also be backward compatible with 
Trac 1.0.
https://trac.edgewall.org/browser/trunk/contrib/trac-svn-hook
https://trac.edgewall.org/wiki/1.3/TracRepositoryAdmin#Subversion
https://trac.edgewall.org/ticket/12771

- Ryan

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to trac-users+unsubscr...@googlegroups.com.
To post to this group, send email to trac-users@googlegroups.com.
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to