-
Notifications
You must be signed in to change notification settings - Fork 22
/
HACKING
73 lines (38 loc) · 2.3 KB
/
HACKING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
YOU WANT TO CONTRIBUTE BUT YOU DON'T KNOW HOW? NO MORE SUCH EXCUSES
0. Install Trac
In most cases this can be done via easy_install:
# easy_install Trac==1.2
If you run into problems, see Trac documentation [1][2].
You will also need to install the Subversion python bindings. Some systems have packages for it (e.g. python-subversion on Debian)[3], but on OSX this means compiling them from source[4].
1. Create a test Trac install somewhere:
$ trac-admin <trac-name> initenv
The default offered values are good.
This will create a <trac-name> directory with the Trac install in the current directory.
2. Create a local SVN repo:
$ svnadmin create <repo-name>
3. Checkout the repo and add a dummy file:
$ svn co file://<full-path-to-svn-repo> # including leading slash, e.g. file:///home/username/svn-repo/
4. Add the repo in the trac.ini:
$ $EDITOR <trac-name>/conf/trac.ini
Change:
repository_dir = <full-path-to-svn-repo>
repository_type = svn
5. Create htpasswd file for Trac auth:
$ htpasswd -c <auth-file-name> <desired-username>
Remember the file location.
6. Add yourself as admin:
$ trac-admin <trac-name> permission add <username> TRAC_ADMIN
6. Run trac server:
$ tracd -s -r --port 8000 --basic-auth='<trac-name>,<full-path-to-auth-file-name>,<whatever-you-want>' <path-to-trac-folder> # see http://trac.edgewall.org/wiki/TracStandalone
You should now have a working vanilla Trac at http://localhost:8000/, where you can log in and be an admin.
7. Checkout the plugin in R/W mode:
$ git clone git@github.com:Automattic/vip-trac-code-comments.git
8. From the plugin directory, deploy the plugin in development mode:
$ python setup.py develop -mxd <path-to-trac>/plugins
9. Restart Trac. Then in the Admin section in Trac, go to Plugins and enable all the components of the TracCodeComments plugin and also the CodeComments macro.
10. For debugging, you probably also want to enable logging in Trac by setting the log_type option to "file" in trac.ini.
# Footnotes
[1] http://trac.edgewall.org/wiki/1.2/TracInstall
[2] http://trac.edgewall.org/wiki/TracDev/DevelopmentEnvironmentSetup
[3] http://trac.edgewall.org/wiki/TracSubversion#GettingSubversion
[4] http://stackoverflow.com/questions/14538468/how-to-install-python-subversion-bindings-needed-by-hg-convert-on-mac-os-x-10-8/16950786#16950786