Changes between Version 14 and Version 15 of TracMercurial
- Timestamp:
- Feb 14, 2006, 4:46:53 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracMercurial
v14 v15 1 1 = Mercurial Plugin for Trac (#1847) = 2 2 3 There is an '''experimental''' plugin for Trac [milestone:0. 9] which enables4 [http://www.selenic.com/mercurial Mercurial] to be used5 instead of [http://subversion.tigris.org Subversion]6 for the VersioningSystemBackend.3 There is an '''experimental''' plugin for Trac [milestone:0.10] 4 which enables [http://www.selenic.com/mercurial Mercurial] 5 to be used instead of [http://subversion.tigris.org Subversion] 6 as the VersioningSystemBackend for Trac. 7 7 8 8 ''The plugin being experimental, expect some rough edges 9 9 and a somewhat unstable set of features/documentation...'' 10 10 11 Change Logs: 12 * log:sandbox/mercurial-plugin 13 * log:sandbox/vc-refactoring 11 14 12 15 == Download and Installation == 13 16 14 17 ==== Trac ==== 15 The plugin needs a slightly modified version of Trac 0.9, 16 which offers support for pluggable SCM backends. 18 The plugin needs a slightly modified version of Trac 0.10. 17 19 This version can be found in source:sandbox/vc-refactoring. 18 It has been partially ported to trunk and retired since,19 but for TracMercurial, you still need the ''original''20 `vc-refactoring` branch, at revision 2620.21 20 22 21 Simply do: 23 22 {{{ 24 svn co -r2620 25 http://svn.edgewall.com/repos/trac/sandbox/vc-refactoring trac-for-hg 26 }}} 27 and install from there (`cd trac-for-hg; python setup.py install`). 23 svn co -r2905 http://svn.edgewall.com/repos/trac/sandbox/vc-refactoring 24 }}} 25 and install from there: 26 {{{ 27 $ cd vc-refactoring 28 $ python setup.py egg_info 29 $ python setup.py install 30 }}} 28 31 29 32 The plugin itself is available from source:sandbox/mercurial-plugin … … 31 34 Check it out, too: 32 35 {{{ 33 svn co -r2 620 http://svn.edgewall.com/repos/trac/sandbox/mercurial-plugin mercurial-plugin36 svn co -r2905 http://svn.edgewall.com/repos/trac/sandbox/mercurial-plugin 34 37 }}} 35 38 and create an "egg" from there (`cd hg-plugin; python setup.py bdist_egg`). 36 39 Note that you'll need 37 40 [http://peak.telecommunity.com/DevCenter/setuptools setuptools] 38 >= 0.6 for that (I used setuptools-0.6a 5).41 >= 0.6 for that (I used setuptools-0.6a9). 39 42 40 43 ===== Releases ===== 41 44 || '''Version''' || mercurial-plugin || Trac vc-refactoring || Compatible with hg || 42 45 || 0.1 || r2514 || r2511 || 0.7, tip without 1d7d0c07 || 43 || || '''r2620''' || '''r2620''' || 0.7, tip with 1d7d0c07 || 46 || || r2620 || r2620 || 0.7, tip with 1d7d0c07 || 47 || '''0.2''' || '''r2905''' || '''r2905''' || 0.7, 0.8, tip || 44 48 45 49 46 50 ==== Mercurial ==== 47 51 The plugin has been tested with recent development versions of Mercurial 48 (upto Changeset 1 568:1d7d0c07e8f3from http://selenic.com/hg)49 and also Mercurial 0.7 (but this needs at least r2514 of the mercurial plugin).50 ''It won't work with earlier versions .''51 52 You can download hgfrom52 (upto Changeset 1704:c2755eba8631 from http://selenic.com/hg) 53 and also with Mercurial 0.7 and 0.8. 54 ''It won't work with earlier versions, in particular not with 0.6x.'' 55 56 You can download Mercurial itself from 53 57 [http://www.selenic.com/mercurial/wiki/index.cgi/Download Hg:Download]. 54 58 … … 58 62 The configuration has to be done on the Trac side, 59 63 there's nothing to do on the Mercurial repository side, 60 except that it should be made available locally. 64 except for the fact that the repository should be made 65 accessible as a local repository. 66 Thanks to the distributed nature of Mercurial, that's 67 always possible (if the repository is not already local, 68 simply `hg clone` it). 69 70 71 === Setting up the mercurial plugin === 72 73 The TracMercurial-0.2 plugin egg should be added to the `plugins` folder of the 74 environment, or it can be globally installed (`python setup.py install` 75 or a `python setup.py develop`). 76 77 For general instructions about plugins, see also TracPlugins. 78 79 If you installed the egg globally and you're modifying an 80 existing Trac environment to use the Mercurial backend, 81 then you have to explicitely ''enable'' the plugin in TracIni: 82 {{{ 83 [components] 84 trac.versioncontrol.hg.* = enabled 85 }}} 86 Note that the above will be done automatically for a new installation, 87 during the `initenv` step. 88 61 89 62 90 === Setting up a Trac environment === … … 67 95 For general instructions, see TracInstall. 68 96 69 The TracAdmin `initenv` command has been slightly modified 70 in the vc-refactoring code base: in addition to the 71 ''repository directory'', it's also needed to specify the 72 ''repository type''. 97 Since milestone:0.10, the TracAdmin `initenv` command has 98 now a ''repository type'' argument besides ''repository directory''. 73 99 74 100 For the ''repository type'', specify `hg` instead of the default `svn`. 75 For the ''repository directory'', specify the location of the Mercurial repository. 76 77 In all case, you [wiki:TracIni <trac_environment>/conf/trac.ini] configuration file 101 For the ''repository directory'', specify the location of the Mercurial repository 102 (without the ending `.hg`). 103 104 Your [wiki:TracIni <trac_environment>/conf/trac.ini] configuration file 78 105 should have a `[trac]` section similar to the following: 79 106 {{{ … … 83 110 }}} 84 111 85 ''Note: those installing from 0.9 + the patch on #1847 will still have to specify `repository_dir=hg:/path/to/my/hg/repository`'' 86 87 Also, currently you still need to explicitely disable the SVN components: 88 {{{ 89 [components] 90 trac.versioncontrol.svn_fs.* = disabled 91 }}} 92 93 ''Note: that constraint will most certainly be lifted in the future'' 94 95 === Setting up the mercurial plugin === 96 97 The TracMercurial-0.1 plugin egg should be added to the `plugins` folder of the 98 environment. 99 100 For general instructions about plugins, see also TracPlugins. 101 102 Finally, if you installed an unpacked egg by doing a `python setup.py install` 103 (useful for development), there's the additional constraint of specifically 104 ''enabling'' the plugin: 105 {{{ 106 [components] 107 trac.versioncontrol.svn_fs.* = disabled 108 hgtrac.* = enabled 112 There's also a few Mercurial specific settings in TracIni: 113 {{{ 114 [hg] 115 # -- Show revision number in addition to the changeset hash 116 show_rev = yes 117 118 # -- Changeset hash format 119 node_format = short 120 # hex: Show the full SHA1 hash 121 # short: Show a shortened hash for the changesets 109 122 }}} 110 123 … … 113 126 114 127 The Mercurial support is pretty basic, but works well. I've tested that 115 on the Mercurial repository itself and the performance is quite good,128 on the Mercurial repository itself and the performance is acceptable, 116 129 even if there's currently ''no'' caching in the database 117 ( I'm still not decided if that's a feature or a bug).130 (this is what I'm going to work on next). 118 131 119 132 For those used to Subversion in general and Subversion repository browsing … … 140 153 141 154 Another additional changeset property is the list of ''Tags'' that 142 might be associated with a changeset. 155 might be associated with a changeset. 156 143 157 144 158 ==== Wiki syntax ==== … … 162 176 changeset without children): [[Image(hg-plugin-browser.png)]] 163 177 178 ''has to be re-added'' 164 179 165 180 == Bugs and Limitations == … … 172 187 * No ''path history'' mode (i.e. show all create/delete operations that 173 188 affected a given path) 189 * Revision log ranges [xxx:yyy] 190 * View arbitrary diffs 174 191 175 192 === Multi-repository support === … … 183 200 within a single environment (see #2086). 184 201 185 186 === Arbitrary diff support === 187 188 The TracDiff features should be supported by TracMercurial too. 202 Note that the last comment on the above ticket suggests a good 203 workaround for this problem. 189 204 190 205 191 206 === To cache or not to cache? === 192 207 193 I happen to like to current database-free implementation of the Mercurial 194 support. 195 It makes it quite easy to change the `repository_dir` on the fly, and this 196 flexibility is good. Also, hg being remarkably efficient, as everybody knows, 197 the performance is quite good... Except in one case, getting the history 198 of a directory. There, I suspect that the database cache would be quite useful. 199 But I have yet to try on a big repository (e.g. the kernel) with either 200 approach before concluding. In any case, thanks to the vc refactoring, 201 the possibility will be offered to choose between a direct access or a 202 cached access, as it's done for Subversion, svn: (cached) or 203 direct-svn-fs: (direct access). 204 205 ''cboos: I think I made up my mind, now that I tried to browse the kernel repo, 206 it's way too slow without a db! 207 Also, the way the diffs are produced currently (i.e. by Trac, from the full 208 content of the files) is also too slow to be usable on such big repositories 209 (e.g. the kernel changeset fc66195f585a took 7 minutes to be displayed on my 210 machine). We need to get the diffs directly from hg.'' 208 When you try TracMercurial on the kernel repo, you quickly realize 209 that it's way too slow without a db! 210 Also, the way the diffs are produced currently (i.e. by Trac, from the full 211 content of the files) is also too slow to be usable on such big repositories 212 (e.g. the kernel changeset fc66195f585a took 7 minutes to be displayed on my 213 machine). 214 See #2591. 211 215 212 216 === Cool Features === … … 237 241 == Implementation Notes == 238 242 239 I'm interested in feedback concerning the code, in particular: 240 * concerning Trac, there are only a few changes to the standard modules, 241 !ChangesetModule (the additional properties) and !BrowserModule 242 (the tags and branches support). Those changes could possibly be promoted 243 to the generic level, therefore removing the need for having to explicitely 244 disable the SVN components... 245 * concerning Mercurial, I'm pretty sure I did things in a sub-optimal 246 way, as I was discovering the guts of hg while writing the plugin. 247 Therefore, I'll be pleased to get tips for improvements. 243 I'm interested in feedback concerning the code, in particular 244 concerning Mercurial. I'm pretty sure I did things in a sub-optimal 245 way, as I was discovering the guts of hg while writing the plugin. 246 Therefore, I'll be pleased to get tips for improvements. 248 247 249 248 '' -- ChristianBoos ''