1. Mads Sülau Valstorp Jørgensen
  2. mercurial-trac-hook
Issue #3 wontfix

upgrades to work with trac 0.12

cfhowes
created an issue

perhaps i don't understand trac 0.12 well, but i could not get any built-in features for updating tickets and hours to work, so i modified this to work with trac 0.12.

things updated: - use Environment() instead of open_environment() - require reponame config option to support multiple repositories and properly update the ticket with link - fix the date passed to ticket notifier so that it finds the changes to include in the notification email.

patch attached.

Comments (8)

  1. Marcus Lindblom Sonestedt

    IIRC Trac 0.12 supports Mercurial out of the box, so this hook should be pretty obsolete. (I got something similar in reply when I requested the hook to be included in the trac dist at 0.11 time)

    But I'm not sure tho... If the built-in stuff doesn't work, then having this to work would help.

    Is the patch backward compatible with 0.11 or 0.12 only? (I'd prefer backward compatibility, naturally..)

  2. Nikolaj Sjujskij

    > IIRC Trac 0.12 supports Mercurial out of the box

    I daresay it does not. There's a mercurial plugin, it lives in main Trac svn (yuck) repo, it's officially supported and so on, but it's a plug-in, and is not distributed with Trac 0.12 itself. Probably adding your hook to plug-in would be a logical thing to do (just a suggestion).

  3. Nikolaj Sjujskij

    Oh, and there's one more thing:

    -                tn.notify(ticket, newticket=0, modtime=self.now)
    +                tn.notify(ticket, newticket=0, modtime=chgset.date)
    

    This change (from patch.out attached) should work in 0.11 too. This should "fix the date passed to ticket notifier so that it finds the changes to include in the notification email", just as cfhowes said. I've just added that change to our production repo (actually I've figured it out myself, and then looked into this patch), so when new notification arrives, I'll report success (I hope) here.

  4. Log in to comment