| [143] | 1 | ======================== |
|---|
| 2 | Darcs backend for Trac |
|---|
| 3 | ======================== |
|---|
| [1] | 4 | |
|---|
| [143] | 5 | This 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] | 12 | It used to work on 0.11, and even with 0.10, at least up to version |
|---|
| 13 | 0.8 of the backend... No time to even try, so no guarantee, sorry! |
|---|
| [1] | 14 | |
|---|
| [93] | 15 | To use the module you can either install it or make an egg and copy |
|---|
| 16 | it in the right place. |
|---|
| [1] | 17 | |
|---|
| [93] | 18 | Installation |
|---|
| [143] | 19 | ============ |
|---|
| [1] | 20 | |
|---|
| [93] | 21 | You can install the module the usual way:: |
|---|
| [1] | 22 | |
|---|
| [93] | 23 | $ python setup.py install [--prefix /usr/local] |
|---|
| [1] | 24 | |
|---|
| [93] | 25 | Otherwise you can make an egg:: |
|---|
| 26 | |
|---|
| 27 | $ python setup.py bdist_egg |
|---|
| 28 | |
|---|
| 29 | and either install it globally with:: |
|---|
| 30 | |
|---|
| 31 | $ easy_install dist/TracDarcs-someversion.egg |
|---|
| 32 | |
|---|
| 33 | or manually copy the egg from the "dist" subdir into the environment's |
|---|
| [191] | 34 | "plugins" subdirectory. The latter requires adding that directory to |
|---|
| 35 | the ``PYTHONPATH`` if you wanna use the post hook as explained below. |
|---|
| [93] | 36 | |
|---|
| [191] | 37 | Plugin activation |
|---|
| 38 | ----------------- |
|---|
| 39 | |
|---|
| 40 | In general, follow the directions in TracPlugins. At the minimum, the |
|---|
| 41 | plugin must be activated with something like the following in the Trac |
|---|
| 42 | instance's ``conf/trac.ini`` file:: |
|---|
| 43 | |
|---|
| 44 | [components] |
|---|
| 45 | tracdarcs.* = enabled |
|---|
| [129] | 46 | |
|---|
| [188] | 47 | Specific configuration options |
|---|
| 48 | ------------------------------ |
|---|
| 49 | |
|---|
| 50 | Some feature can be altered by using the following trac+darcs specific |
|---|
| 51 | options in the ``[darcs]`` section of the configuration: |
|---|
| 52 | |
|---|
| 53 | command : 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 | |
|---|
| 58 | dont_escape_8bit : boolean |
|---|
| 59 | False by default, maps to the `darcs` ``$DARCS_DONT_ESCAPE_8BIT`` |
|---|
| 60 | behaviour. |
|---|
| 61 | |
|---|
| 62 | possible_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 | |
|---|
| 67 | max_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 | |
|---|
| 71 | eager_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] | 78 | Using a post apply hook |
|---|
| [188] | 79 | ----------------------- |
|---|
| 80 | |
|---|
| [189] | 81 | The `recommended way`__ to trigger the sync between the repository and |
|---|
| 82 | the Trac instance is by using a darcs `post hook`__ on its ``apply``: |
|---|
| 83 | in this way the database will be updated as soon as darcs finish |
|---|
| 84 | applying any new changeset. |
|---|
| [188] | 85 | |
|---|
| 86 | This can be accomplished by putting something like the following |
|---|
| 87 | setting 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 | |
|---|
| 92 | where of course you should replace `TRAC_ENV` with the full path of |
|---|
| 93 | the 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] | 106 | At that point, you could deactivate the per request sync that Trac |
|---|
| 107 | still does by default, by setting ``repository_sync_per_request`` to |
|---|
| 108 | an 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] | 113 | Related repositories |
|---|
| 114 | -------------------- |
|---|
| 115 | |
|---|
| 116 | When you manage multiple branches of the same darcs repository, you |
|---|
| 117 | may find useful to inform trac+darcs about that, so that it will show |
|---|
| 118 | additional 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 | |
|---|
| 125 | To do that, you simply group together the related repositories giving |
|---|
| 126 | them a common ``identity``, an arbitrary string. |
|---|
| 127 | |
|---|
| 128 | You can see current identity of a repository with:: |
|---|
| 129 | |
|---|
| 130 | $ trac-admin . repository identity master |
|---|
| 131 | No identity set on repository master |
|---|
| 132 | |
|---|
| 133 | and you can set it with:: |
|---|
| 134 | |
|---|
| 135 | $ trac-admin . repository identity master ProjectFoo |
|---|
| 136 | Identity of repository master set to ProjectFoo |
|---|
| 137 | |
|---|
| 138 | You can adjust it with:: |
|---|
| 139 | |
|---|
| 140 | $ trac-admin . repository identity master ProjectBar |
|---|
| 141 | Identity of repository master set to ProjectBar (was ProjectFoo) |
|---|
| 142 | |
|---|
| 143 | or remove it:: |
|---|
| 144 | |
|---|
| 145 | $ trac-admin . repository identity master "" |
|---|
| [200] | 146 | Identity removed from repository master |
|---|
| [199] | 147 | |
|---|
| [201] | 148 | When browsing a changeset in a repository that shares its identity |
|---|
| 149 | with other repositories, you will see a property ``Present in`` |
|---|
| 150 | listing the links to *instances* of the same patch in the other |
|---|
| 151 | related repositories, if there are any. At the same time, a property |
|---|
| 152 | ``Missing in`` will show the complementary list, i.e. the related |
|---|
| 153 | repositories where the given patch is not present, if any. |
|---|