source: tracdarcs/README.rst @ 200

Revision 200, 5.0 KB checked in by lele@…, 3 years ago (diff)

Typo

RevLine 
[143]1========================
2 Darcs backend for Trac
3========================
[1]4
[143]5This package implements a darcs backend for Trac supporting the new
[188]6`multirepository feature`__, that has been merged in the current
7`Trac 0.12`__.
[143]8
9__ http://trac.edgewall.org/wiki/MultipleRepositorySupport
10__ http://trac.edgewall.org/milestone/0.12
11
[188]12It used to work on 0.11, and even with 0.10, at least up to version
130.8 of the backend... No time to even try, so no guarantee, sorry!
[1]14
[93]15To use the module you can either install it or make an egg and copy
16it in the right place.
[1]17
[93]18Installation
[143]19============
[1]20
[93]21You can install the module the usual way::
[1]22
[93]23  $ python setup.py install [--prefix /usr/local]
[1]24
[93]25Otherwise you can make an egg::
26
27  $ python setup.py bdist_egg
28
29and either install it globally with::
30
31  $ easy_install dist/TracDarcs-someversion.egg
32
33or manually copy the egg from the "dist" subdir into the environment's
[191]34"plugins" subdirectory. The latter requires adding that directory to
35the ``PYTHONPATH`` if you wanna use the post hook as explained below.
[93]36
[191]37Plugin activation
38-----------------
39
40In general, follow the directions in TracPlugins. At the minimum, the
41plugin must be activated with something like the following in the Trac
42instance's ``conf/trac.ini`` file::
43
44  [components]
45  tracdarcs.* = enabled
[129]46
[188]47Specific configuration options
48------------------------------
49
50Some feature can be altered by using the following trac+darcs specific
51options in the ``[darcs]`` section of the configuration:
52
53command : string
54  This is the effective `darcs` executable that will be used. By
55  default its ``darcs``, but you could set it to
56  ``/usr/local/bin/darcs`` to use a newer version...
57
58dont_escape_8bit : boolean
59  False by default, maps to the `darcs` ``$DARCS_DONT_ESCAPE_8BIT``
60  behaviour.
61
62possible_encodings : string
63  By default 'utf-8,iso8859-1', its a comma-separated-value list of
64  possible string encodings to try one after the other, should a
65  decode error occur while parsing darcs changesets.
66
67max_concurrent_darcses : integer
68  By default 0 to mean no limits, otherwise it is the maximum number
69  of concurrent running darcs processes at the same time.
70
71eager_annotations : boolean
72  False by default, when true the content and the annotation cache of
73  each modified file get computed immediately after a changeset gets
74  added. This will move the heavy computation at pull time, rather
75  than at first visit time. Of course, it will also enlarge the
76  trac database...
77
[191]78Using a post apply hook
[188]79-----------------------
80
[189]81The `recommended way`__ to trigger the sync between the repository and
82the Trac instance is by using a darcs `post hook`__ on its ``apply``:
83in this way the database will be updated as soon as darcs finish
84applying any new changeset.
[188]85
86This can be accomplished by putting something like the following
87setting into the repository ``_darcs/prefs/defaults`` file::
88
[189]89  apply posthook trac-admin TRAC_ENV changeset added $(pwd) $(python -m tracdarcs.changesparser)
[188]90  apply run-posthook
91
92where of course you should replace `TRAC_ENV` with the full path of
93the related trac instance.
94
[189]95.. note:: ``python -m tracdarcs.changesparser`` is just a quick way of
96   extracting the list of changeset hashes from the the ``darcs
97   changes --xml`` format: it accepts the input either as the
[191]98   ``$DARCS_PATCHES_XML`` environment variable (as set by darcs
99   posthooks) or from standard input::
[188]100
[189]101    $ darcs changes --xml | python -m tracdarcs.changesparser | head -3
102    20100611081300-97f81-bc5c1f7acf0c168bbfa9fb911e3cc2a4e71d5eef
103    20100610150339-97f81-cd1b73f2ba1b1d98c28542ecbd1d5e2bd9052056
104    20100512164420-97f81-de3fbc73d7c401fb92503ef1b25e19e0f48d2ad1
[188]105
[189]106At that point, you could deactivate the per request sync that Trac
107still does by default, by setting ``repository_sync_per_request`` to
108an empty value in the ``[trac]`` section of the configuration.
[188]109
[189]110__ http://trac.edgewall.org/wiki/0.12/TracRepositoryAdmin#ExplicitSync
[188]111__ http://darcs.net/manual/node7.html#SECTION00712000000000000000
112
[199]113Related repositories
114--------------------
115
116When you manage multiple branches of the same darcs repository, you
117may find useful to inform trac+darcs about that, so that it will show
118additional properties on each changeset:
119
120* a list of other "instances" of the same patch, that is when the
121  changeset is present in other related repositories,
122
123* a list of related repositories where the changeset is *not* present.
124
125To do that, you simply group together the related repositories giving
126them a common ``identity``, an arbitrary string.
127
128You can see current identity of a repository with::
129
130  $ trac-admin . repository identity master
131  No identity set on repository master
132
133and you can set it with::
134
135  $ trac-admin . repository identity master ProjectFoo
136  Identity of repository master set to ProjectFoo
137
138You can adjust it with::
139
140  $ trac-admin . repository identity master ProjectBar
141  Identity of repository master set to ProjectBar (was ProjectFoo)
142
143or remove it::
144
145  $ trac-admin . repository identity master ""
[200]146  Identity removed from repository master
Note: See TracBrowser for help on using the repository browser.