6

For example, a file is modified to do an enhance ticket, what I want to do is associated the committed file to the ticket. When using Trac and SVN together, how will I know that a file is committed to solve a certain ticket? Is this possible?

Thank you.

j08691
  • 204,283
  • 31
  • 260
  • 272
Jarvis
  • 577
  • 3
  • 10
  • 16

3 Answers3

6

As stated on the TracWiki, the intended workflow is:

  1. A Trac user begins work on a ticket
  2. They obtain code from the version control system
  3. After the work is completed they perform a commit of their modifications to the version control repository
  4. The user inserts the Trac ticket number into the commit message as a TracLink
  5. Trac can now display the change set for the ticket

Where the TracLink is something like #1 or ticket:1 or even comment:1:ticket:2 when referring to a ticket.


If you miss creating the link when the commit is made, you can still create one in the ticket comments themselves using TracLinks such as: r2, r1:3, [1:3], log:@1:3, etc.

Tim Henigan
  • 60,452
  • 11
  • 85
  • 78
  • And the basic link could be added via svn:bugtraq properties, at least for clients that support it. – Lasse V. Karlsen Aug 11 '09 at 11:41
  • Additionaly, you can setup a post-commit script to automatically push tickets to testing (or whatever workflow you use) – basszero Aug 12 '09 at 00:44
  • I'm fairly sure the Trac post-commit hook must be enabled (as retractile mentioned), and it is not by default in aTrac installation. – RjOllos Sep 02 '09 at 19:55
2

you can link to the revision when closing ticket: r253, e.g.
and you can link to the ticket in commit message: #7525, e.g.

other than that, I doubt that anything can be done.

Obviously you could parse log message with on-commit hook and make a notification of sorts re tickets of interest, but you'd need to have access to the server I guess.

SilentGhost
  • 307,395
  • 66
  • 306
  • 293
1

You may find the Trac post-commit hook useful. It allows you to close tickets using your commit log messages. See the script here.

retracile
  • 12,167
  • 4
  • 35
  • 42