| 12 | |
| 13 | The related changesets are presented just above the ordinary change history: |
| 14 | |
| 15 | [[Image(ticket_changesets_box.gif, border=2)]] |
| 16 | |
| 17 | When several repositories contains changesets relating to a ticket, the content will gracefully be split into one sub-section for each repository. |
| 18 | |
| 19 | The plugin can be configured to present the box as initially collapsed, or hidden completely when no changesets are related to the ticket. Revision ranges can be presented in compact form, for example [420-422] instead of [420] [421] [422]. |
| 20 | |
| 21 | The macros `CommitMessage(repo, rev)` and `TicketChangesets(ticket)` are provided to present a commit message for a given repository and revision, and all changesets that are related to a given ticket. |
| 22 | |
| 23 | === Console administration commands |
| 24 | |
| 25 | Console administration commands are available for retrieving and re-synchronizing ticket-changesets relations, and reformatting existing ticket commit messages. |
| 26 | |
| 27 | `trac-admin /path/to/env ticket_changesets diff`:: |
| 28 | Examine ticket commit messages before reformat. |
| 29 | |
| 30 | Generate a diff-like output for analysis before reformatting. The database will not be changed. Before this operation, you may want to run: |
| 31 | {{{#!sh |
| 32 | trac-admin $ENV repository resync "*" |
| 33 | }}} |
| 34 | |
| 35 | `trac-admin /path/to/env ticket_changesets get [ticketid]`:: |
| 36 | Get a comma-separated list of related revisions (#7267). |
| 37 | |
| 38 | List format: |
| 39 | {{{ |
| 40 | #ticketid: rev/reponame,... |
| 41 | ... |
| 42 | }}} |
| 43 | "/reponame" is left out for the default repository. |
| 44 | |
| 45 | All tickets related to changesets are listed if ticketid is omitted, one ticket on each line. If no ticket-changesets relations exists in the database, "None" is displayed. |
| 46 | |
| 47 | `trac-admin /path/to/env ticket_changesets reformat` '''(DANGEROUS!)''':: |
| 48 | Reformat ticket commit messages. |
| 49 | |
| 50 | Before this operation, you may want to run: |
| 51 | {{{#!sh |
| 52 | trac-admin $ENV repository resync "*" |
| 53 | }}} |
| 54 | |
| 55 | and then analyse the output of: |
| 56 | {{{#!sh |
| 57 | trac-admin $ENV ticket_changesets diff |
| 58 | }}} |
| 59 | |
| 60 | `trac-admin /path/to/env ticket_changesets resync`:: |
| 61 | Re-synchronize ticket changesets with all repositories |
| 62 | |
| 63 | Relations between tickets and changesets are re-built by examining all commit messages, in all repositories, for ticket references. Ticket comments are neither updated nor added due to new discoveries. |
| 64 | |
| 65 | Before this operation, you may want to run: |
| 66 | {{{#!sh |
| 67 | trac-admin $ENV repository resync "*" |
| 68 | }}} |
117 | | == Example |
118 | | |
119 | | The related changesets are presented just above the ordinary change history: |
120 | | |
121 | | [[Image(ticket_changesets_box.gif, border=2)]] |
122 | | |
123 | | When several repositories contains changesets relating to a ticket, the content will gracefully be split into one sub-section for each repository. |
124 | | |
125 | | The plugin can be configured to present the box as initially collapsed, or hidden completely when no changesets are related to the ticket. Revision ranges can be presented in compact form, for example [420-422] instead of [420] [421] [422]. |
126 | | |
127 | | The macros `CommitMessage(repo, rev)` and `TicketChangesets(ticket)` are provided to present a commit message for a given repository and revision, and all changesets that are related to a given ticket. |
128 | | |
129 | | === Console administration commands |
130 | | |
131 | | Console administration commands are available for retrieving and re-synchronizing ticket-changesets relations, and reformatting existing ticket commit messages. |
132 | | |
133 | | `trac-admin /path/to/env ticket_changesets diff`:: |
134 | | Examine ticket commit messages before reformat. |
135 | | |
136 | | Generate a diff-like output for analysis before reformatting. The database will not be changed. Before this operation, you may want to run: |
137 | | {{{#!sh |
138 | | trac-admin $ENV repository resync "*" |
139 | | }}} |
140 | | |
141 | | `trac-admin /path/to/env ticket_changesets get [ticketid]`:: |
142 | | Get a comma-separated list of related revisions (#7267). |
143 | | |
144 | | List format: |
145 | | {{{ |
146 | | #ticketid: rev/reponame,... |
147 | | ... |
148 | | }}} |
149 | | "/reponame" is left out for the default repository. |
150 | | |
151 | | All tickets related to changesets are listed if ticketid is omitted, one ticket on each line. If no ticket-changesets relations exists in the database, "None" is displayed. |
152 | | |
153 | | `trac-admin /path/to/env ticket_changesets reformat` '''(DANGEROUS!)''':: |
154 | | Reformat ticket commit messages. |
155 | | |
156 | | Before this operation, you may want to run: |
157 | | {{{#!sh |
158 | | trac-admin $ENV repository resync "*" |
159 | | }}} |
160 | | |
161 | | and then analyse the output of: |
162 | | {{{#!sh |
163 | | trac-admin $ENV ticket_changesets diff |
164 | | }}} |
165 | | |
166 | | `trac-admin /path/to/env ticket_changesets resync`:: |
167 | | Re-synchronize ticket changesets with all repositories |
168 | | |
169 | | Relations between tickets and changesets are re-built by examining all commit messages, in all repositories, for ticket references. Ticket comments are neither updated nor added due to new discoveries. |
170 | | |
171 | | Before this operation, you may want to run: |
172 | | {{{#!sh |
173 | | trac-admin $ENV repository resync "*" |
174 | | }}} |
175 | | |