| 1 | = Advocating a Tighter Subversion Integration = |
| 2 | |
| 3 | == Motivation == |
| 4 | |
| 5 | Trac is not a versioning system, but it allows developers to use one effectively. |
| 6 | |
| 7 | Nevertheless, Trac has its own versioning needs for its data. |
| 8 | That would be useful for managing attachments. |
| 9 | That's also true for the Wiki page content in the current Trac |
| 10 | and that would be true for any Trac object in the the TracObjectModelProposal. |
| 11 | |
| 12 | If one takes for granted the underlying versioning system, |
| 13 | why not use it for that task instead of having to implement |
| 14 | an ad-hoc versioning scheme? |
| 15 | |
| 16 | That would: |
| 17 | * provide better diffs than what we have now |
| 18 | * need a smaller memory footprint (each version of each wiki page |
| 19 | would not have to be stored in its full extent, only the diffs) |
| 20 | * provide versioning for attachments |
| 21 | * enable the users to directly interact with the Trac content, |
| 22 | instead of having only the Trac web interface: |
| 23 | * they could edit the wiki content with a text editor, |
| 24 | as they would do with a normal repository file |
| 25 | * they could do some refactorings on the Wiki content (renamings, |
| 26 | fixing some pervasive typographical error, etc.) |
| 27 | * they could directly add attachments to Trac object |
| 28 | |
| 29 | Another feature that would be possible is to redirect a Wiki page |
| 30 | as being some actual file in the normal repository. For example, a |
| 31 | wiki page containing the description of a given software component |
| 32 | could actually be placed in the {{{doc}}} subfolder of that |
| 33 | component. Keeping it closer to the source increases its chances |
| 34 | to stay uptodate. |
| 35 | |
| 36 | This Wiki redirection would be quite simple to implement: |
| 37 | the content would be a TracLinks pointing to a specific file |
| 38 | in the repository. Actually, that's similar to the TicketAliases idea (See ticket #xxx). |
| 39 | |
| 40 | The same for attachments: any file from the repository could be |
| 41 | said to be "attached" to a Trac object, instead of having to be |
| 42 | uploaded in all cases. In the end, an Attachment and a File would |
| 43 | really be the same thing. |
| 44 | |
| 45 | |
| 46 | == Implementation == |
| 47 | |
| 48 | There would be essentially 2 ways to implement that integration: |
| 49 | * using a private area in the Subversion repository being trac'ed |
| 50 | * using a private repository |
| 51 | |
| 52 | === A private area === |
| 53 | |
| 54 | A top-level folder in the repository would be used by trac. |
| 55 | This could be {{{/trac}}}, but that would be configurable. |
| 56 | |
| 57 | There would be no point to deal with a Changeset saying |
| 58 | ''!WikiPage !AbCdEf modified'', beside the regular !WikiPage edited event, |
| 59 | except, of course, if that modification was done outside of Trac, |
| 60 | by a direct modification and commit on the Trac files. |
| 61 | |
| 62 | Deciding whether a changeset must be taken into account or ignored |
| 63 | could be done very simply: each revision created by Trac could be |
| 64 | remembered as such, in a {{{trac_revision}}} table. |
| 65 | |
| 66 | The only disadvantage of this approach would be the presence |
| 67 | of gaps in the sequence of changesets. |
| 68 | |
| 69 | |
| 70 | === A private repository === |
| 71 | |
| 72 | Alternatively, all the versioning needs of Trac could be fulfilled |
| 73 | by the use of a private repository. This would prevent any |
| 74 | interference with the main repository. |
| 75 | |
| 76 | The disadvantage of this approach are: |
| 77 | * The need to differentiate between a !WikiPage in the main |
| 78 | repository and a !WikiPage in Trac's own repository. |
| 79 | One more level of indirection. |
| 80 | * It would require more administrative work to make that repository |
| 81 | directly accessible to clients. That access would be convenient |
| 82 | for directly editing a wiki content with a text editor. |