Opened 6 years ago

Closed 6 years ago

# Problems with SVN post commit hook

Reported by: Owned by: aboas bobbysmith007 normal TimingAndEstimationPlugin normal 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

### comment:1 Changed 6 years ago 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.

### comment:2 Changed 6 years ago by bobbysmith007

• Resolution set to fixed
• Status changed from assigned to closed

(In [2778]) closes #2171

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

### comment:3 Changed 6 years ago by JasonWinnebeck

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

### comment:4 Changed 6 years ago 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

### comment:5 Changed 6 years ago 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

### comment:6 Changed 6 years ago 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)!

### comment:7 Changed 6 years ago by bobbysmith007

(In [2835]) re #2171

Fixed typo.

### comment:8 Changed 6 years ago by bobbysmith007

Good eye, thanks!

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

Russ

### Modify Ticket

Change Properties