Ticket #2171 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Problems with SVN post commit hook

Reported by: aboas Assigned to: bobbysmith007
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hi.. I´m not sure this is a bug or a configuration mistake I made, but I´d like to ask anyway.

I´m currently running Trac 0.11 (revision 6139) and TimingAndEstimationPlugin 0.4.9 (revision 2767). I´ve configured the plugin´s post commit hook the usual way (it used to work with version 0.10) and get the following error when commiting (the commit message is of the form "refs#<ticket> (<hours>) <comments>"):

Traceback (most recent call last):

File "/repository/svn/amplis/hooks/trac-post-commit.py", line 232, in ?

CommitHook?()

File "/repository/svn/amplis/hooks/trac-post-commit.py", line 178, in init

self.env.href = Href(url)

TypeError?: 'str' object is not callable

Attachments

Change History

11/13/07 09:21:06 changed by bobbysmith007

  • status changed from new to assigned.

Sorry for the delay, apparently trac-hacks has stopped emailing me new tickets for this project, so I had not seen anything opened in the last month or so.

Thats kind-of funny, because I actually started working on this yesterday in our own preparation for conversion to trac 11. As best I can tell, this script is just broken for trac11 and needs to be rewritten. I commented out that line and instead get errors about int and datetime not supporting the minus operator (which is to illustrate that you are running into only the first of a few bugs). Keep an eye our for a release soon that will fix this.

11/14/07 10:05:21 changed by bobbysmith007

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [2778]) closes #2171

Upgraded the trac-post-commit.py to be compatable with trac 11

11/15/07 08:43:14 changed by JasonWinnebeck

That changeset seemed to remove the documentation for the plugin, was that intended?

11/15/07 13:36:10 changed by bobbysmith007

Looking at my installed version of the plugin I can see all of the docs, so please clarify what you mean.

  • The manual wikipage got deleted?
  • The link from the management page to manual wikipage got deleted?
  • The comments at the top of the post-commit-hook got deleted?
  • something else?

Thanks, Russ

11/15/07 13:41:30 changed by JasonWinnebeck

I saw the following lines removed, and I couldn't see them being replaced anywhere else:

-# Changes for the Timing and Estimation plugin
-#
-# "Blah refs #12 (1)" will add 1h to the spent time for issue #12
-# "Blah refs #12 (spent 1)" will add 1h to the spent time for issue #12
-#
-# As above it is possible to use complicated messages:
-#
-# "Changed blah and foo to do this or that. Fixes #10 (1) and #12 (2), and refs #13 (0.5)."
-#
-# This will close #10 and #12, and add a note to #13 and also add 1h spent time to #10,
-# add 2h spent time to #12 and add 30m spent time to #13.
-#
-# Note that:
-#     spent, sp or simply nothing may be used for spent
-#     ' ', ',', '&' or 'and' may be used between spent
-#

I don't know if that's right or not, I was just browsing through places and links and I noticed it and it didn't seem right.

So to answer your question, I mean literally the changes in r2778, which only touched only source:timingandestimationplugin/branches/trac0.11/scripts/trac-post-commit.py@2778

11/27/07 16:42:42 changed by aboas

It works just fine. It is worth commenting, though, that I had to append an extra ":" to the end of line 96 (r2824):

if LOG:
    f = open (logfile,"w")
    f.write("Begin Log\n")
    f.close()
    def log (s, *params)
        f = open (logfile,"a")

became

if LOG:
    f = open (logfile,"w")
    f.write("Begin Log\n")
    f.close()
    def log (s, *params):
        f = open (logfile,"a")

I´m using Python 2.4 (and am not familiar at all with the language) and that might not be an issue with version 2.5.

Thanks a lot for the fix (and the speed)!

11/28/07 07:56:52 changed by bobbysmith007

(In [2835]) re #2171

Fixed typo.

11/28/07 08:00:18 changed by bobbysmith007

re: JasonWinnebeck

Good eye, thanks!

re: aboas not sure how that typo got there :( Thanks for the note

Russ


Add/Change #2171 (Problems with SVN post commit hook)




Change Properties
Action