| [644] | 1 | Tailor 1.0 |
|---|
| 2 | ########## |
|---|
| 3 | |
|---|
| [646] | 4 | .. contents:: |
|---|
| 5 | |
|---|
| [173] | 6 | About |
|---|
| 7 | ===== |
|---|
| [172] | 8 | |
|---|
| [711] | 9 | Tailor is a tool to migrate changesets between ArX_, Bazaar_, `Bazaar-NG`_, |
|---|
| [703] | 10 | CVS_, Codeville_, Darcs_, Git_, Mercurial_, Monotone_, Subversion_ and Tla_ |
|---|
| [554] | 11 | [#]_ repositories. |
|---|
| [173] | 12 | |
|---|
| [172] | 13 | This script makes it easier to keep the upstream changes merged in |
|---|
| 14 | a branch of a product, storing needed information such as the upstream |
|---|
| 15 | URI and revision in special properties on the branched directory. |
|---|
| 16 | |
|---|
| [180] | 17 | The following ascii-art illustrates the usual scenario:: |
|---|
| 18 | |
|---|
| 19 | +------------+ +------------+ |
|---|
| 20 | +--------------+ | Immutable | | Working | |
|---|
| 21 | | Upstream CVS |-------->| darcs |----------->| darcs | |
|---|
| 22 | | repository | tailor | repository | darcs pull | repository | |
|---|
| 23 | +--------------+ +------------+ +------------+ |
|---|
| 24 | |^ |
|---|
| 25 | || |
|---|
| 26 | || |
|---|
| 27 | v| |
|---|
| 28 | User |
|---|
| 29 | |
|---|
| 30 | Ideally you should be able to swap and replace "CVS server" and "darcs |
|---|
| [306] | 31 | repository" with any combination of the supported systems. |
|---|
| 32 | |
|---|
| 33 | A more convoluted setup shows how brave people are using it to get a |
|---|
| 34 | two way sync:: |
|---|
| 35 | |
|---|
| 36 | +----------+ +--------+ +--------+ +---------+ |
|---|
| 37 | | | -----> | hybrid | darcs | | ----> | my | |
|---|
| 38 | | upstream | tailor | CVS | -----> | master | darcs | working | |
|---|
| 39 | | CVS | <----- | darcs | <----- | darcs | <---- | darcs | |
|---|
| 40 | | | | sync | tailor | | | | |
|---|
| 41 | +----------+ +--------+ +--------+ +---------+ |
|---|
| 42 | (cron) (cron) |
|---|
| [180] | 43 | |
|---|
| [172] | 44 | |
|---|
| [703] | 45 | .. [#] ArX, Baazar-NG, Codeville, Git and Mercurial systems may be |
|---|
| [381] | 46 | used only as the `target` backend, since the `source` support |
|---|
| 47 | isn't coded yet. Contributions on these backends will be very |
|---|
| 48 | appreciated, since I do not use them enough to figure out the |
|---|
| 49 | best way to get pending changes and build tailor ChangeSets out |
|---|
| 50 | of them. |
|---|
| [310] | 51 | |
|---|
| [712] | 52 | To the opposite, Bazaar and Tla are supported only as source |
|---|
| 53 | systems. |
|---|
| [554] | 54 | |
|---|
| 55 | .. _arx: http://www.nongnu.org/arx/ |
|---|
| [703] | 56 | .. _bazaar: http://bazaar.canonical.com/ |
|---|
| [635] | 57 | .. _bazaar-ng: http://www.bazaar-ng.org/ |
|---|
| [554] | 58 | .. _codeville: http://www.codeville.org/ |
|---|
| 59 | .. _cvs: http://www.nongnu.org/cvs/ |
|---|
| 60 | .. _darcs: http://www.darcs.net/ |
|---|
| [691] | 61 | .. _git: http://git.or.cz/ |
|---|
| [381] | 62 | .. _mercurial: http://www.selenic.com/mercurial/ |
|---|
| [637] | 63 | .. _monotone: http://www.venge.net/monotone/ |
|---|
| [554] | 64 | .. _subversion: http://subversion.tigris.org/ |
|---|
| 65 | .. _tla: http://www.gnuarch.org/arch/index.html |
|---|
| [315] | 66 | |
|---|
| [488] | 67 | |
|---|
| [173] | 68 | Installation |
|---|
| 69 | ============ |
|---|
| 70 | |
|---|
| [399] | 71 | tailor is written in Python, and thus Python must be installed on |
|---|
| [229] | 72 | your system to use it. It has been successfully used with Python 2.3 |
|---|
| 73 | and 2.4. |
|---|
| 74 | |
|---|
| [338] | 75 | Since it relies on external tools to do the real work such as `cvs`, |
|---|
| [636] | 76 | `darcs` [#]_ and `svn`, they need to be installed as well, although only |
|---|
| [261] | 77 | those you will actually use. |
|---|
| [172] | 78 | |
|---|
| [399] | 79 | Make tailor executable:: |
|---|
| [172] | 80 | |
|---|
| [399] | 81 | $ chmod +x tailor |
|---|
| [172] | 82 | |
|---|
| [399] | 83 | You can either run tailor where it is currently located, or move it |
|---|
| [172] | 84 | along with the vcpx directory to a location in your PATH. |
|---|
| [261] | 85 | |
|---|
| 86 | There's even a standard setup.py that you may use to install the |
|---|
| 87 | script using Python conventional distutils. |
|---|
| [172] | 88 | |
|---|
| [636] | 89 | .. [#] Darcs 1.0.2 is too old, 1.0.3 is good, 1.0.4 (the fourth |
|---|
| 90 | release candidate is under final testing) is recommended since |
|---|
| 91 | it's faster in most operations! |
|---|
| 92 | |
|---|
| [172] | 93 | |
|---|
| [589] | 94 | Testing |
|---|
| 95 | ======= |
|---|
| 96 | |
|---|
| 97 | You can run the test suite with the following command line:: |
|---|
| 98 | |
|---|
| 99 | $ tailor test -v |
|---|
| 100 | |
|---|
| 101 | that runs all the tests in sequence, or:: |
|---|
| 102 | |
|---|
| 103 | $ tailor test -v TailorTest |
|---|
| 104 | |
|---|
| 105 | to trigger just a subset of them. |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | Operation |
|---|
| 109 | ========= |
|---|
| 110 | |
|---|
| 111 | tailor needs now a configuration file that collects the various bits |
|---|
| 112 | of information it needs to do it's job. |
|---|
| 113 | |
|---|
| 114 | The simplest way of starting out a new configuration is by omitting |
|---|
| 115 | the --configfile command line option, and specifying the other as |
|---|
| 116 | needed plus --verbose: in this situation, tailor will print out an |
|---|
| 117 | equivalent configuration that you can redirect to a file, that you |
|---|
| 118 | later will pass as --configfile. |
|---|
| 119 | |
|---|
| 120 | |
|---|
| [173] | 121 | Examples |
|---|
| [589] | 122 | -------- |
|---|
| [172] | 123 | |
|---|
| [589] | 124 | 1. Bootstrap a new tailored project, starting at upstream revision 10 |
|---|
| [173] | 125 | |
|---|
| [589] | 126 | a. First create a config file:: |
|---|
| 127 | |
|---|
| 128 | $ tailor --verbose -s svn -R http://svn.server/path/to/svnrepo \ |
|---|
| 129 | --module /Product/trunk -r 10 --subdir Product \ |
|---|
| 130 | ~/darcs/MyProduct > myproject.tailor |
|---|
| [172] | 131 | |
|---|
| [589] | 132 | b. Modify it as you like (mostly adjusting root-directories and the |
|---|
| 133 | like):: |
|---|
| 134 | |
|---|
| 135 | $ emacs myproject.tailor |
|---|
| [173] | 136 | |
|---|
| [589] | 137 | c. Run tailor on it:: |
|---|
| 138 | |
|---|
| 139 | $ tailor --configfile myproject.tailor |
|---|
| [422] | 140 | |
|---|
| [589] | 141 | 2. Bootstrap a new product, fetching its whole CVS repository and |
|---|
| 142 | storing under SVN |
|---|
| [428] | 143 | |
|---|
| [589] | 144 | a. First create a config file:: |
|---|
| [422] | 145 | |
|---|
| [589] | 146 | $ tailor --verbose --source-kind cvs --target-kind svn \ |
|---|
| [286] | 147 | --repository :pserver:cvs.zope.org:/cvs-repository \ |
|---|
| [589] | 148 | --module CMF/CMFCore --revision INITIAL \ |
|---|
| 149 | --target-repository file:///some/where/svnrepo \ |
|---|
| 150 | --target-module / cmfcore > cmfcore.tailor |
|---|
| [421] | 151 | |
|---|
| [589] | 152 | b. Modify it as you like (mostly adjusting root-directories and the |
|---|
| 153 | like):: |
|---|
| 154 | |
|---|
| [646] | 155 | $ emacs cmfcore.tailor |
|---|
| [212] | 156 | |
|---|
| [589] | 157 | c. Run tailor on it once, to bootstrap the project:: |
|---|
| 158 | |
|---|
| [646] | 159 | $ tailor -D -v --configfile cmfcore.tailor |
|---|
| [429] | 160 | |
|---|
| [589] | 161 | If the target repository is on the local filesystem (ie, it |
|---|
| 162 | starts with ``file:///``) and it does not exist, tailor |
|---|
| 163 | creates a new empty Subversion repository at the specified |
|---|
| 164 | location. |
|---|
| 165 | |
|---|
| 166 | .. note:: Before step d) below, you may want to install an |
|---|
| [429] | 167 | appropriate hook in the repository to enable the |
|---|
| 168 | propset command to operate on unversioned properties, |
|---|
| 169 | as described in the `svn manual`__. Then you can |
|---|
| 170 | specify '--use-svn-propset' option, and tailor will |
|---|
| 171 | put the original author and timestamp in the proper |
|---|
| 172 | svn metadata instead of appending them to the changelog. |
|---|
| 173 | |
|---|
| [458] | 174 | Other than the annoying repository manual intervention, |
|---|
| 175 | this thread__ and this other__ explain why using |
|---|
| 176 | ``-r{DATE}`` may produce strange results with this setup. |
|---|
| 177 | |
|---|
| [589] | 178 | d. Run tailor again and again, to sync up with latest changes:: |
|---|
| 179 | |
|---|
| 180 | $ tailor -D -v --configfile myproject.tailor |
|---|
| 181 | |
|---|
| [554] | 182 | __ http://svnbook.red-bean.com/en/1.0/ch05s02.html#svn-ch-5-sect-2.1 |
|---|
| [458] | 183 | __ http://svn.haxx.se/users/archive-2005-07/0605.shtml |
|---|
| 184 | __ http://svn.haxx.se/users/archive-2005-03/0596.shtml |
|---|
| [429] | 185 | |
|---|
| [455] | 186 | |
|---|
| [589] | 187 | 3. Given the configuration file shown below in `Config file format`_, |
|---|
| [488] | 188 | the following command:: |
|---|
| 189 | |
|---|
| [589] | 190 | $ tailor --configfile example.tailor |
|---|
| [488] | 191 | |
|---|
| 192 | is equivalent to this one:: |
|---|
| 193 | |
|---|
| [589] | 194 | $ tailor --configfile example.tailor tailor |
|---|
| [488] | 195 | |
|---|
| [589] | 196 | in that they operate respectively on the default project(s) or |
|---|
| [488] | 197 | the ones specified on the command line (and in this case there |
|---|
| 198 | is just a single default project, tailor). |
|---|
| 199 | |
|---|
| 200 | This one instead:: |
|---|
| 201 | |
|---|
| 202 | $ tailor --configfile example.tailor tailor tailor-reverse |
|---|
| 203 | |
|---|
| [589] | 204 | operates on both projects. |
|---|
| 205 | |
|---|
| 206 | |
|---|
| 207 | CVS start-revision |
|---|
| 208 | ------------------ |
|---|
| 209 | |
|---|
| 210 | With CVS, you can specify a particular *point in time* specifying |
|---|
| 211 | a `start-revision` with a timestamp like ``2001-12-25 23:26:48 UTC``. |
|---|
| 212 | |
|---|
| 213 | To specify also a particular `branch`, prepend it before the |
|---|
| 214 | timestamp, as in ``unstable-branch 2001-12-25 23:26:48 UTC``. |
|---|
| [718] | 215 | |
|---|
| 216 | To migrate the whole history of a specific `branch`, use something |
|---|
| 217 | like ``somebranch INITIAL``. |
|---|
| [488] | 218 | |
|---|
| 219 | |
|---|
| [198] | 220 | Resolving conflicts |
|---|
| [196] | 221 | =================== |
|---|
| 222 | |
|---|
| [399] | 223 | Should one of the replayed changes generate any conflict, tailor |
|---|
| [198] | 224 | will prompt the user to correct them. This is done after the upstream |
|---|
| 225 | patch has been applied and before the final commit on the target |
|---|
| 226 | system, so that manually tweaking the conflict can produce a clean |
|---|
| 227 | patch. |
|---|
| [212] | 228 | |
|---|
| 229 | |
|---|
| 230 | Shortcomings |
|---|
| 231 | ============ |
|---|
| 232 | |
|---|
| 233 | Tailor currently suffers of the following reported problems: |
|---|
| 234 | |
|---|
| 235 | a) It does not handle "empty" CVS checkouts, in other words you cannot |
|---|
| 236 | bootstrap a project that has nothing in its CVS upstream |
|---|
| 237 | repository, or from a point in time where this condition was true. |
|---|
| 238 | |
|---|
| [423] | 239 | b) It's completely unsupported under Windows, evenif it now uses |
|---|
| 240 | 2.4's subprocess_ that seems able to hide Windows crazyness... |
|---|
| [276] | 241 | |
|---|
| [691] | 242 | c) ArX, Baazar-NG, Codeville, Git, and Mercurial are (currently) only |
|---|
| [703] | 243 | supported as *target*; Bazaar and Tla only as *source*. |
|---|
| [212] | 244 | |
|---|
| [307] | 245 | d) Specifying ``--subdir .`` may not work, in particular when dealing |
|---|
| 246 | with remote CVS repositories (it does when the CVS repository is |
|---|
| 247 | on local machine). |
|---|
| 248 | |
|---|
| [212] | 249 | This list will always be incomplete, but I'll do my best to keep it |
|---|
| 250 | short :-) |
|---|
| [214] | 251 | |
|---|
| 252 | .. _subprocess: http://www.lysator.liu.se/~astrand/popen5/ |
|---|
| [196] | 253 | |
|---|
| [172] | 254 | |
|---|
| [173] | 255 | Config file format |
|---|
| [488] | 256 | ================== |
|---|
| [173] | 257 | |
|---|
| 258 | When your project is composed by multiple upstream modules, it is |
|---|
| 259 | easier to collect such information in a single file. This is done by |
|---|
| 260 | specifying the `--configfile` option with a file name as argument. In |
|---|
| [589] | 261 | this case, tailor will read the above information from a standard |
|---|
| 262 | Python ConfigParser file. |
|---|
| [173] | 263 | |
|---|
| [488] | 264 | For example:: |
|---|
| [173] | 265 | |
|---|
| [488] | 266 | [DEFAULT] |
|---|
| [589] | 267 | verbose = True |
|---|
| [488] | 268 | projects = tailor |
|---|
| [173] | 269 | |
|---|
| [488] | 270 | [tailor] |
|---|
| [646] | 271 | root-directory = /tmp/n9 |
|---|
| [488] | 272 | source = darcs:tailor |
|---|
| 273 | target = svn:tailor |
|---|
| 274 | state-file = tailor.state |
|---|
| 275 | |
|---|
| 276 | [tailor-reverse] |
|---|
| [646] | 277 | root-directory = /tmp/n9 |
|---|
| [488] | 278 | source = svn:tailor |
|---|
| 279 | target = darcs:tailor |
|---|
| 280 | state-file = reverse.state |
|---|
| 281 | |
|---|
| 282 | [svn:tailor] |
|---|
| 283 | repository = file:///tmp/testtai |
|---|
| 284 | module = /project1 |
|---|
| [646] | 285 | subdir = svnside |
|---|
| 286 | |
|---|
| [488] | 287 | [darcs:tailor] |
|---|
| [589] | 288 | repository = ~/WiP/cvsync |
|---|
| [646] | 289 | subdir = darcside |
|---|
| 290 | |
|---|
| [651] | 291 | The configuration may hold one or more `projects`_ and two or more |
|---|
| 292 | `repositories`_: project names do not contains colons ":", |
|---|
| [646] | 293 | repository names must and the first part of the name before the |
|---|
| 294 | colon specify the kind of the repository. So, the above example |
|---|
| 295 | contains two projects, one that goes from `darcs` to `subversion`, the |
|---|
| 296 | other in the opposite direction. |
|---|
| 297 | |
|---|
| 298 | The ``[DEFAULT]`` section contains the default values, that will be |
|---|
| 299 | used when a specific setting is missing from the particular section. |
|---|
| 300 | |
|---|
| 301 | You can specify on which project tailor should operate by |
|---|
| 302 | giving its name on the command line, even more than one. When not |
|---|
| 303 | explicitly given, tailor will look at ``projects`` in the |
|---|
| 304 | ``[DEFAULT]`` section, and if its missing it will loop over all |
|---|
| 305 | projects in the configuration. |
|---|
| 306 | |
|---|
| 307 | The following simpler config just go in one direction, for a single |
|---|
| 308 | project, so no need neither for ``[DEFAULT].projects`` nor command |
|---|
| 309 | line arguments:: |
|---|
| 310 | |
|---|
| 311 | [pxlib] |
|---|
| 312 | source = cvs:pxlib |
|---|
| 313 | target = hg:pxlib |
|---|
| 314 | root-directory = ~/mypxlib |
|---|
| 315 | start-revision = INITIAL |
|---|
| 316 | subdir = pxlib |
|---|
| 317 | |
|---|
| 318 | [cvs:pxlib] |
|---|
| 319 | repository = :pserver:anonymous@cvs.sf.net:/cvsroot/pxlib |
|---|
| 320 | module = pxlib |
|---|
| 321 | |
|---|
| 322 | [hg:pxlib] |
|---|
| 323 | hg-command = /usr/local/bin/hg |
|---|
| 324 | |
|---|
| 325 | This will use a single directory, ``pxlib`` to contain both the source |
|---|
| 326 | and the target system. If you prefer keeping the separated, you just |
|---|
| [703] | 327 | need to specify a different directory for each repository [#]_, as in:: |
|---|
| [646] | 328 | |
|---|
| 329 | [pxlib] |
|---|
| 330 | source = cvs:pxlib |
|---|
| 331 | target = hg:pxlib |
|---|
| 332 | root-directory = ~/mypxlib |
|---|
| 333 | start-revision = INITIAL |
|---|
| 334 | |
|---|
| 335 | [cvs:pxlib] |
|---|
| 336 | repository = :pserver:anonymous@cvs.sf.net:/cvsroot/pxlib |
|---|
| 337 | module = pxlib |
|---|
| 338 | subdir = original |
|---|
| 339 | |
|---|
| 340 | [hg:pxlib] |
|---|
| 341 | hg-command = /usr/local/bin/hg |
|---|
| 342 | subdir = migrated |
|---|
| [172] | 343 | |
|---|
| [646] | 344 | This will extract upstream CVS sources into ``~/mypxlib/original``, |
|---|
| 345 | and create a new Mercurial repository in ``~/mypxlib/migrated``. |
|---|
| [172] | 346 | |
|---|
| [703] | 347 | On final example to show the syntax of Bazaar sources:: |
|---|
| 348 | |
|---|
| 349 | [project] |
|---|
| 350 | target = hg:target |
|---|
| 351 | start-revision = base-0 |
|---|
| 352 | root-directory = /tmp/calife |
|---|
| 353 | state-file = tailor.state |
|---|
| 354 | source = baz:source |
|---|
| 355 | |
|---|
| 356 | [baz:source] |
|---|
| 357 | module = calife--pam--3.0 |
|---|
| 358 | repository = roberto@keltia.net--2003-depot |
|---|
| 359 | subdir = tla |
|---|
| 360 | |
|---|
| 361 | [hg:target] |
|---|
| 362 | repository = /tmp/HG/calife-pam |
|---|
| 363 | subdir = hg |
|---|
| 364 | |
|---|
| 365 | .. [#] NB: when the source and the target repositories specify |
|---|
| 366 | different directories with the ``subdir`` option, tailor |
|---|
| 367 | uses ``rsync`` to keep them in sync, so that tool needs |
|---|
| 368 | to be installed. |
|---|
| 369 | |
|---|
| [651] | 370 | |
|---|
| 371 | Configuration sections |
|---|
| 372 | ---------------------- |
|---|
| 373 | |
|---|
| [656] | 374 | Default |
|---|
| 375 | ~~~~~~~ |
|---|
| 376 | |
|---|
| 377 | The ``[DEFAULT]`` section in the configuration file may set the |
|---|
| 378 | default value for any of the recognized options: when a value is |
|---|
| 379 | missing from a specific section it is looked up in this section. |
|---|
| 380 | |
|---|
| 381 | One particular option, ``projects``, is meaningful only in the |
|---|
| 382 | ``[DEFAULT]`` section: it's a comma separated list of project names, |
|---|
| 383 | the one that will be operated on by tailor when no project is |
|---|
| 384 | specified on the command line. When the there are no ``projects`` |
|---|
| 385 | setting nor any on the command line, tailor activates all configured |
|---|
| 386 | projects, in order of appearance in the config file. |
|---|
| 387 | |
|---|
| 388 | |
|---|
| [651] | 389 | Projects |
|---|
| 390 | ~~~~~~~~ |
|---|
| 391 | |
|---|
| 392 | A project is identified by a section whose name does not contain any |
|---|
| 393 | colon (":") character, and configured with the following values: |
|---|
| 394 | |
|---|
| 395 | root-directory |
|---|
| 396 | This is where all the fun will happen: this directory will contain |
|---|
| 397 | the source and the target working copy, and usually the state and |
|---|
| 398 | the log file. It support the conventional `~user` to indicate user's |
|---|
| 399 | home directory. |
|---|
| 400 | |
|---|
| 401 | subdir |
|---|
| 402 | This is the subdirectory, relative to the `root-directory`, where |
|---|
| 403 | tailor will extract the source working copy. It may be '.' for some |
|---|
| 404 | backend kinds. |
|---|
| 405 | |
|---|
| 406 | state-file |
|---|
| 407 | Name of the state file needed to store tailor last activity. |
|---|
| 408 | |
|---|
| 409 | source |
|---|
| 410 | The source repository: a repository name is something like |
|---|
| 411 | "darcs:somename", that will be loaded from the homonymous section |
|---|
| 412 | in the configuration. |
|---|
| 413 | |
|---|
| 414 | target |
|---|
| 415 | The counterpart of `source`, the repository that will receive the |
|---|
| 416 | changes coming from there. |
|---|
| 417 | |
|---|
| 418 | Non mandatory options: |
|---|
| 419 | |
|---|
| 420 | verbose |
|---|
| 421 | Print the commands as they are executed. |
|---|
| 422 | |
|---|
| 423 | debug |
|---|
| 424 | Print also their output. |
|---|
| 425 | |
|---|
| 426 | before-commit |
|---|
| 427 | This is a function name, or a sequence of function names enclosed |
|---|
| 428 | by brackets, that will be executed on each changeset just before |
|---|
| 429 | it get replayed on the target system: this may be used to perform |
|---|
| 430 | any kind of alteration on the content of the changeset, or to skip |
|---|
| 431 | some of them. |
|---|
| 432 | |
|---|
| 433 | after-commit |
|---|
| 434 | This is a function name, or a sequence of function names enclosed |
|---|
| 435 | by brackets, that will be executed on each changeset just after |
|---|
| 436 | the commit on the target system: this may be used for example to |
|---|
| 437 | create a tag. |
|---|
| 438 | |
|---|
| 439 | subdir |
|---|
| 440 | The name of the subdirectory, under ``root-directory``, that will |
|---|
| 441 | contain the source and target repositories/working directories. |
|---|
| 442 | |
|---|
| [655] | 443 | start-revision |
|---|
| 444 | This identifies from when tailor should start the migration. It can |
|---|
| 445 | be either ``INITIAL``, to indicate the start of the history, or |
|---|
| 446 | ``HEAD`` to indicate the current latest changeset, or a backend |
|---|
| 447 | specific way of indicate a particular revision/tag in the history. |
|---|
| 448 | See also `CVS start-revision`_ above. |
|---|
| [662] | 449 | |
|---|
| 450 | patch-name-format |
|---|
| 451 | Some backends have a distinct notion of `patch name` and `change |
|---|
| 452 | log`, others just suggest a policy that the first line of the |
|---|
| 453 | message is a summary, the rest if present is a more detailed |
|---|
| 454 | description of the change. With this option you can control the |
|---|
| 455 | format of the name, or of the first line of the changelog. |
|---|
| 456 | |
|---|
| 457 | The prototype may contain ``%(keyword)s`` such as 'author', 'date', |
|---|
| 458 | 'revision', 'firstlogline', 'remaininglog'. It defaults to |
|---|
| 459 | `Tailorized "%(revision)s"`; setting it to the empty string means |
|---|
| 460 | that tailor will simply use the original changelog. |
|---|
| [723] | 461 | |
|---|
| 462 | When you set it empty, as in |
|---|
| 463 | |
|---|
| 464 | :: |
|---|
| 465 | |
|---|
| 466 | [project] |
|---|
| 467 | patch-name-format = |
|---|
| 468 | |
|---|
| 469 | tailor will keep the original changelog as is. |
|---|
| [662] | 470 | |
|---|
| 471 | remove-first-log-line |
|---|
| 472 | Remove the first line of the upstream changelog. This is intended to |
|---|
| 473 | go in pair with ``patch-name-format``, when using it's 'firstlogline' |
|---|
| 474 | variable to build the name of the patch. By default is ``False``. |
|---|
| [651] | 475 | |
|---|
| [722] | 476 | refill-changelogs |
|---|
| 477 | Off by default, when active tailor reformats every changelog before |
|---|
| 478 | committing on the target system. |
|---|
| [655] | 479 | |
|---|
| [651] | 480 | Repositories |
|---|
| 481 | ~~~~~~~~~~~~ |
|---|
| 482 | |
|---|
| 483 | All the section whose name contains at least one colon character |
|---|
| 484 | denote a repository. A single repository may be shared by zero, one or |
|---|
| 485 | more projects. The first part of the name up to the first colon |
|---|
| [703] | 486 | indicates the `kind` of the repository, one of ``arx``, ``baz``, ``bzr``, |
|---|
| [691] | 487 | ``bzrng``, ``cdv``, ``cg``, ``cvs``, ``darcs``, ``hg``, ``monotone``, |
|---|
| [725] | 488 | ``svn``, ``svndump`` and ``tla``. |
|---|
| [651] | 489 | |
|---|
| 490 | When a repository is used as a `source`, it must indicate its origin |
|---|
| 491 | with ``repository``, and for some backends also a ``module``, but are |
|---|
| 492 | not required when it's a target system, even if some backend may use |
|---|
| 493 | the information to create the target repository (like ``svn`` backend |
|---|
| 494 | does). |
|---|
| 495 | |
|---|
| 496 | Each repository may then impose a particular external binary to be |
|---|
| 497 | used, as done in the example above for ``hg``. Actually only one of |
|---|
| 498 | them, `bzrng`, accepts an option ``python-path``, to indicate where |
|---|
| 499 | the BazaarNG Python library is located. |
|---|
| 500 | |
|---|
| 501 | A repository may also have it's own ``subdir``: when the `source` and |
|---|
| 502 | `target` repositories use different subdirectories, tailor uses |
|---|
| 503 | ``rsync`` to copy the changes between the two after each applied |
|---|
| 504 | changeset. |
|---|
| [680] | 505 | |
|---|
| 506 | CVS and CVSPS repositories may turn of automatic tagging of entries, |
|---|
| 507 | that tailor does by default to prevent manual interventions in the |
|---|
| 508 | CVS working copy, using ``tag_entries = False``. |
|---|
| [651] | 509 | |
|---|
| [506] | 510 | |
|---|
| 511 | Using a Python script as configuration file |
|---|
| 512 | ------------------------------------------- |
|---|
| 513 | |
|---|
| 514 | Instead of executing ``tailor --configfile project.tailor.conf`` |
|---|
| 515 | you can prepend the following signature to the config itself:: |
|---|
| 516 | |
|---|
| 517 | #!/usr/bin/env /path/to/tailor |
|---|
| 518 | |
|---|
| 519 | Giving execute mode to it will permit the launch of the tailor |
|---|
| 520 | process by running the config script directly:: |
|---|
| 521 | |
|---|
| 522 | $ ./project.tailor.conf |
|---|
| 523 | |
|---|
| 524 | When a config file is signed in this way [#]_, either you pass it as |
|---|
| 525 | argument to ``--configfile`` or executed as above, tailor will |
|---|
| 526 | actually execute it as a full fledged Python script, that may define |
|---|
| 527 | functions that alter the behaviour of tailor itself. |
|---|
| 528 | |
|---|
| 529 | A common usage of this functionality is to define so called `hooks`, |
|---|
| 530 | sequences of functions that are executed at particular points in |
|---|
| 531 | the tailorization process. |
|---|
| 532 | |
|---|
| [639] | 533 | Just to illustrate the functionality, consider the following example:: |
|---|
| [506] | 534 | |
|---|
| [639] | 535 | #!/usr/bin/env tailor |
|---|
| 536 | |
|---|
| [506] | 537 | """ |
|---|
| [639] | 538 | [DEFAULT] |
|---|
| 539 | debug = False |
|---|
| 540 | verbose = True |
|---|
| 541 | |
|---|
| [506] | 542 | [project] |
|---|
| [639] | 543 | target = bzrng:target |
|---|
| 544 | root-directory = /tmp/prova |
|---|
| 545 | state-file = tailor.state |
|---|
| 546 | source = darcs:source |
|---|
| 547 | before-commit = before |
|---|
| 548 | after-commit = after |
|---|
| 549 | start-revision = Almost arbitrarily tagging this as version 0.8 |
|---|
| 550 | |
|---|
| 551 | [bzrng:target] |
|---|
| 552 | python-path = /opt/src/bzr.dev |
|---|
| 553 | subdir = bzrside |
|---|
| 554 | |
|---|
| 555 | [darcs:source] |
|---|
| 556 | repository = /home/lele/WiP/cvsync |
|---|
| 557 | subdir = darcside |
|---|
| [506] | 558 | """ |
|---|
| 559 | |
|---|
| [639] | 560 | def before(wd, changeset): |
|---|
| 561 | print "BEFORE", changeset |
|---|
| 562 | changeset.author = "LELE" |
|---|
| 563 | return changeset |
|---|
| 564 | |
|---|
| 565 | def after(wd, changeset): |
|---|
| 566 | print "AFTER", changeset |
|---|
| [506] | 567 | |
|---|
| [639] | 568 | With the above in a `script` called say ``tester``, just doing:: |
|---|
| 569 | |
|---|
| 570 | $ chmod 755 tester |
|---|
| 571 | $ ./tester |
|---|
| 572 | |
|---|
| 573 | will migrate the history from a darcs repository to a bazaar-ng one, |
|---|
| 574 | forcing the author to a well-known name :-) |
|---|
| 575 | |
|---|
| [506] | 576 | .. [#] Tailor does actually read just the first two bytes from the |
|---|
| 577 | file, and compare them with "#!", so you are free to choose |
|---|
| 578 | whatever syntax works in your environment. |
|---|
| 579 | |
|---|
| 580 | |
|---|
| [488] | 581 | State file |
|---|
| 582 | ---------- |
|---|
| [315] | 583 | |
|---|
| [488] | 584 | The state file stores two things: the last upstream revision that |
|---|
| 585 | has been applied to the tree, and a sequence of pending (not yet |
|---|
| 586 | applied) changesets, that may be empty. In the latter case, tailor |
|---|
| 587 | will fetch latest changes from the upstream repository. |
|---|
| [315] | 588 | |
|---|
| [333] | 589 | |
|---|
| [173] | 590 | Further help |
|---|
| 591 | ============ |
|---|
| [172] | 592 | |
|---|
| [399] | 593 | See the output of ``tailor -h`` for some further tips. There's |
|---|
| [310] | 594 | also a `wiki page`_ that may give you some other hints. The |
|---|
| 595 | development of Tailor is mainly driven by user requests at this point, |
|---|
| 596 | and the preferred comunication media is the dedicated `mailing list`_ |
|---|
| 597 | [#]_. |
|---|
| [177] | 598 | |
|---|
| 599 | .. _wiki page: |
|---|
| [287] | 600 | http://www.darcs.net/DarcsWiki/Tailor |
|---|
| [177] | 601 | |
|---|
| [288] | 602 | .. _mailing list: |
|---|
| 603 | http://lists.zooko.com/mailman/listinfo/tailor |
|---|
| 604 | |
|---|
| [177] | 605 | I will be more than happy to answer any doubt, question or suggestion |
|---|
| 606 | you may have on it. I'm usually hanging as "lelit" on the IRC channel |
|---|
| 607 | devoted to darcs on the `freenode.net` network. Do not hesitate to |
|---|
| 608 | contact me either by email or chatting there. |
|---|
| [288] | 609 | |
|---|
| [310] | 610 | .. [#] I wish to say a big `Thank you` to `Zooko <zooko@zooko.com>`_, |
|---|
| 611 | for hosting the ML and for supporting Tailor in several ways, |
|---|
| 612 | from suggestions to bug reporting and fixing. |
|---|
| [173] | 613 | |
|---|
| 614 | |
|---|
| [635] | 615 | Authors |
|---|
| 616 | ======= |
|---|
| [173] | 617 | |
|---|
| [172] | 618 | Lele Gaifax <lele@nautilus.homeip.net> |
|---|
| [261] | 619 | |
|---|
| [554] | 620 | Since I'm not currently using all the supported systems (so little |
|---|
| 621 | time, so many VCSs...) I'm not in position to test them out properly, |
|---|
| 622 | but I'll do my best to keep them in sync, maybe with your support :-) |
|---|
| 623 | |
|---|
| 624 | ArX support |
|---|
| 625 | ----------- |
|---|
| 626 | |
|---|
| 627 | ArX_ support was contributed by `Walter Landry <wlandry@ucsd.edu>`_. |
|---|
| [261] | 628 | |
|---|
| [635] | 629 | Bazaar-NG support |
|---|
| 630 | ----------------- |
|---|
| 631 | |
|---|
| 632 | `Bazaar-NG`_ support was contributed by `Johan Rydberg |
|---|
| 633 | <jrydberg@gnu.org>`_. |
|---|
| [691] | 634 | |
|---|
| 635 | Git support |
|---|
| 636 | ----------- |
|---|
| 637 | |
|---|
| 638 | `Git`_ support (using Cogito) was contributed by `Todd Mokros |
|---|
| 639 | <tmokros@tmokros.net>`_. |
|---|
| [635] | 640 | |
|---|
| [261] | 641 | Monotone support |
|---|
| 642 | ---------------- |
|---|
| 643 | |
|---|
| 644 | Monotone_ support was kindly contributed by `Markus Schiltknecht |
|---|
| [308] | 645 | <markus@bluegap.ch>`_ and further developed by `rghetta |
|---|
| [686] | 646 | <birrachiara@tin.it>`_, that was able to linearize the multi-headed |
|---|
| 647 | monotone history into something tailor groks. Kudos! |
|---|
| [554] | 648 | |
|---|
| 649 | Tla support |
|---|
| 650 | ----------- |
|---|
| 651 | |
|---|
| 652 | Tla_ support was contributed by `Robin Farine |
|---|
| 653 | <robin.farine@terminus.org>`_. |
|---|
| [261] | 654 | |
|---|
| [305] | 655 | |
|---|
| 656 | License |
|---|
| 657 | ======= |
|---|
| 658 | |
|---|
| 659 | Tailor is distribuited under the `GNU General Public License`__. |
|---|
| 660 | |
|---|
| 661 | __ http://www.fsf.org/licensing/licenses/gpl.html |
|---|
| [177] | 662 | |
|---|
| [172] | 663 | |
|---|
| [176] | 664 | About this document |
|---|
| 665 | =================== |
|---|
| [177] | 666 | |
|---|
| 667 | This document and most of the internal documention use the |
|---|
| 668 | reStructuredText format so that it can be easily converted into other |
|---|
| 669 | formats, such as HTML. For more information about this, please see: |
|---|
| [172] | 670 | |
|---|
| [177] | 671 | http://docutils.sourceforge.net/rst.html |
|---|
| [176] | 672 | |
|---|
| 673 | |
|---|
| 674 | .. vim:ft=rest |
|---|
| [174] | 675 | .. Local Variables: |
|---|
| 676 | .. mode: rst |
|---|
| 677 | .. End: |
|---|