source: tailor/README @ 1052

Revision 1052, 28.3 KB checked in by lele@…, 7 years ago (diff)

Annotate the characters that tailor washes out of Subversion XML logs
when filter-badchars is set to True.

RevLine 
[644]1Tailor 1.0
2##########
3
[646]4.. contents::
5
[173]6About
7=====
[172]8
[711]9Tailor is a tool to migrate changesets between ArX_, Bazaar_, `Bazaar-NG`_,
[703]10CVS_, Codeville_, Darcs_, Git_, Mercurial_, Monotone_, Subversion_ and Tla_
[554]11[#]_ repositories.
[173]12
[172]13This script makes it easier to keep the upstream changes merged in
14a branch of a product, storing needed information such as the upstream
15URI and revision in special properties on the branched directory.
16
[180]17The 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
30Ideally you should be able to swap and replace "CVS server" and "darcs
[306]31repository" with any combination of the supported systems.
32
33A more convoluted setup shows how brave people are using it to get a
34two 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
[1012]45.. [#] ArX and Codeville systems may be used only as the `target`
[996]46       backend, since the `source` support isn't coded yet.
47       Contributions on these backends will be very appreciated,
48       since I do not use them enough to figure out the best way to
49       get pending changes and build tailor ChangeSets out of them.
[310]50
[919]51       To the opposite, Bazaar (1.0, not Bazaar-NG) and Tla are
52       supported only as source systems.
[554]53
54.. _arx: http://www.nongnu.org/arx/
[703]55.. _bazaar: http://bazaar.canonical.com/
[635]56.. _bazaar-ng: http://www.bazaar-ng.org/
[554]57.. _codeville: http://www.codeville.org/
58.. _cvs: http://www.nongnu.org/cvs/
59.. _darcs: http://www.darcs.net/
[691]60.. _git: http://git.or.cz/
[381]61.. _mercurial: http://www.selenic.com/mercurial/
[637]62.. _monotone: http://www.venge.net/monotone/
[554]63.. _subversion: http://subversion.tigris.org/
64.. _tla: http://www.gnuarch.org/arch/index.html
[315]65
[488]66
[173]67Installation
68============
69
[399]70tailor is written in Python, and thus Python must be installed on
[229]71your system to use it.  It has been successfully used with Python 2.3
72and 2.4.
73
[338]74Since it relies on external tools to do the real work such as `cvs`,
[636]75`darcs` [#]_ and `svn`, they need to be installed as well, although only
[261]76those you will actually use.
[172]77
[399]78Make tailor executable::
[172]79
[399]80 $ chmod +x tailor
[172]81
[399]82You can either run tailor where it is currently located, or move it
[172]83along with the vcpx directory to a location in your PATH.
[261]84
85There's even a standard setup.py that you may use to install the
[745]86script using Python's conventional distutils.
[172]87
[636]88.. [#] Darcs 1.0.2 is too old, 1.0.3 is good, 1.0.4 (the fourth
89       release candidate is under final testing) is recommended since
90       it's faster in most operations!
91
[172]92
[589]93Testing
94=======
95
[882]96Tailor has more than 50 unit and operational tests, that you can
97run with the following command line::
[589]98
99 $ tailor test -v
100
[882]101Since some tests take very long to complete, in particular the
102operational tests, you may prefer the execution of a single suite::
[589]103
[882]104 $ tailor test -v Darcs
[589]105
[882]106or even a single test within a suite::
107
108 $ tailor test StateFile.testJournal
109
110To obtain a list of the test, use ``--list`` option.  As usual with::
111
112 $ tailor test --help
113
114you will get some more details.
[589]115
116
117Operation
118=========
119
120tailor needs now a configuration file that collects the various bits
121of information it needs to do it's job.
122
123The simplest way of starting out a new configuration is by omitting
124the --configfile command line option, and specifying the other as
125needed plus --verbose: in this situation, tailor will print out an
126equivalent configuration that you can redirect to a file, that you
127later will pass as --configfile.
128
129
[173]130Examples
[589]131--------
[172]132
[589]1331. Bootstrap a new tailored project, starting at upstream revision 10
[173]134
[589]135   a. First create a config file::
136   
137       $ tailor --verbose -s svn -R http://svn.server/path/to/svnrepo \
138                --module /Product/trunk -r 10 --subdir Product \
139                ~/darcs/MyProduct > myproject.tailor
[172]140
[589]141   b. Modify it as you like (mostly adjusting root-directories and the
142      like)::
143     
144       $ emacs myproject.tailor
[173]145
[589]146   c. Run tailor on it::
147   
148       $ tailor --configfile myproject.tailor
[422]149
[589]1502. Bootstrap a new product, fetching its whole CVS repository and
151   storing under SVN
[428]152
[589]153   a. First create a config file::
[422]154
[589]155       $ tailor --verbose --source-kind cvs --target-kind svn \
[286]156                --repository :pserver:cvs.zope.org:/cvs-repository \
[589]157                --module CMF/CMFCore --revision INITIAL \
158                --target-repository file:///some/where/svnrepo \
159                --target-module / cmfcore > cmfcore.tailor
[421]160
[589]161   b. Modify it as you like (mostly adjusting root-directories and the
162      like)::
[874]163
[646]164       $ emacs cmfcore.tailor
[212]165
[874]166   .. note:: By default, tailor uses "." as ``subdir``, to mean that
167             it will extract upstream source directly inside the
168             ``root-directory``.
169
170             This is known to cause problems with CVS as source, with
171             which you could see some wierd error like
172
173             ::
174
175               $ cvs -q -d ...:/cvsroot/mymodule checkout -d . ... mymodule
176               cvs checkout: existing repository /cvsroot/mymodule does not match /cvsroot/mymodule/mymodule
177               cvs checkout: ignoring module mymodule
178
179             When this is the case, the culprit may be a CVS
180             shortcoming not being able to handle ``-d .`` in the
181             right way.  Specify a different ``subdir`` option to
182             avoid the problem.
183
[589]184   c. Run tailor on it once, to bootstrap the project::
185   
[646]186       $ tailor -D -v --configfile cmfcore.tailor
[429]187
[589]188      If the target repository is on the local filesystem (ie, it
189      starts with ``file:///``) and it does not exist, tailor
190      creates a new empty Subversion repository at the specified
191      location.
192     
193   .. note:: Before step d) below, you may want to install an
[429]194             appropriate hook in the repository to enable the
195             propset command to operate on unversioned properties,
196             as described in the `svn manual`__. Then you can
197             specify '--use-svn-propset' option, and tailor will
198             put the original author and timestamp in the proper
199             svn metadata instead of appending them to the changelog.
200
[458]201             Other than the annoying repository manual intervention,
202             this thread__ and this other__ explain why using
203             ``-r{DATE}`` may produce strange results with this setup.
204
[589]205   d. Run tailor again and again, to sync up with latest changes::
206
207       $ tailor -D -v --configfile myproject.tailor
208   
[554]209__ http://svnbook.red-bean.com/en/1.0/ch05s02.html#svn-ch-5-sect-2.1
[458]210__ http://svn.haxx.se/users/archive-2005-07/0605.shtml
211__ http://svn.haxx.se/users/archive-2005-03/0596.shtml
[429]212
[455]213
[589]2143. Given the configuration file shown below in `Config file format`_,
[488]215   the following command::
216
[589]217    $ tailor --configfile example.tailor
[488]218
219   is equivalent to this one::
220
[589]221    $ tailor --configfile example.tailor tailor
[488]222
[589]223   in that they operate respectively on the default project(s) or
[488]224   the ones specified on the command line (and in this case there
225   is just a single default project, tailor).
226
227   This one instead::
228
229    $ tailor --configfile example.tailor tailor tailor-reverse
230
[589]231   operates on both projects.
232
233
234CVS start-revision
235------------------
236
237With CVS, you can specify a particular *point in time* specifying
238a `start-revision` with a timestamp like ``2001-12-25 23:26:48 UTC``.
239
240To specify also a particular `branch`, prepend it before the
241timestamp, as in ``unstable-branch 2001-12-25 23:26:48 UTC``.
[718]242
243To migrate the whole history of a specific `branch`, use something
244like ``somebranch INITIAL``.
[488]245
246
[198]247Resolving conflicts
[196]248===================
249
[399]250Should one of the replayed changes generate any conflict, tailor
[198]251will prompt the user to correct them. This is done after the upstream
252patch has been applied and before the final commit on the target
253system, so that manually tweaking the conflict can produce a clean
254patch.
[212]255
256
257Shortcomings
258============
259
260Tailor currently suffers of the following reported problems:
261
262a) It does not handle "empty" CVS checkouts, in other words you cannot
263   bootstrap a project that has nothing in its CVS upstream
264   repository, or from a point in time where this condition was true.
265
[423]266b) It's completely unsupported under Windows, evenif it now uses
267   2.4's subprocess_ that seems able to hide Windows crazyness...
[276]268
[1012]269c) ArX and Codeville are (currently) only supported as *target*;
270   Bazaar and Tla only as *source*.
[212]271
[307]272d) Specifying ``--subdir .`` may not work, in particular when dealing
273   with remote CVS repositories (it does when the CVS repository is
274   on local machine).
275   
[212]276This list will always be incomplete, but I'll do my best to keep it
277short :-)
[214]278
279.. _subprocess: http://www.lysator.liu.se/~astrand/popen5/
[196]280
[172]281
[173]282Config file format
[488]283==================
[173]284
285When your project is composed by multiple upstream modules, it is
286easier to collect such information in a single file. This is done by
287specifying the `--configfile` option with a file name as argument. In
[589]288this case, tailor will read the above information from a standard
289Python ConfigParser file.
[173]290
[488]291For example::
[173]292
[488]293    [DEFAULT]
[589]294    verbose = True
[488]295    projects = tailor
[173]296
[488]297    [tailor]
[646]298    root-directory = /tmp/n9
[488]299    source = darcs:tailor
300    target = svn:tailor
301    state-file = tailor.state
302
303    [tailor-reverse]
[646]304    root-directory = /tmp/n9
[488]305    source = svn:tailor
306    target = darcs:tailor
307    state-file = reverse.state
308   
309    [svn:tailor]
310    repository = file:///tmp/testtai
311    module = /project1
[646]312    subdir = svnside
313   
[488]314    [darcs:tailor]
[589]315    repository = ~/WiP/cvsync
[646]316    subdir = darcside
317
[651]318The configuration may hold one or more `projects`_ and two or more
319`repositories`_: project names do not contains colons ":",
[646]320repository names must and the first part of the name before the
321colon specify the kind of the repository.  So, the above example
322contains two projects, one that goes from `darcs` to `subversion`, the
323other in the opposite direction.
324
325The ``[DEFAULT]`` section contains the default values, that will be
326used when a specific setting is missing from the particular section.
327
328You can specify on which project tailor should operate by
329giving its name on the command line, even more than one. When not
330explicitly given, tailor will look at ``projects`` in the
331``[DEFAULT]`` section, and if its missing it will loop over all
332projects in the configuration.
333
334The following simpler config just go in one direction, for a single
335project, so no need neither for ``[DEFAULT].projects`` nor command
336line arguments::
337
338    [pxlib]
339    source = cvs:pxlib
340    target = hg:pxlib
341    root-directory = ~/mypxlib
342    start-revision = INITIAL
343    subdir = pxlib
344   
345    [cvs:pxlib]
346    repository = :pserver:anonymous@cvs.sf.net:/cvsroot/pxlib
347    module = pxlib
348
349    [hg:pxlib]
350    hg-command = /usr/local/bin/hg
351
352This will use a single directory, ``pxlib`` to contain both the source
353and the target system. If you prefer keeping the separated, you just
[703]354need to specify a different directory for each repository [#]_, as in::
[646]355
356    [pxlib]
357    source = cvs:pxlib
358    target = hg:pxlib
359    root-directory = ~/mypxlib
360    start-revision = INITIAL
361   
362    [cvs:pxlib]
363    repository = :pserver:anonymous@cvs.sf.net:/cvsroot/pxlib
364    module = pxlib
365    subdir = original
[849]366    delay-before-apply = 10
[646]367
368    [hg:pxlib]
369    hg-command = /usr/local/bin/hg
370    subdir = migrated
[172]371
[646]372This will extract upstream CVS sources into ``~/mypxlib/original``,
373and create a new Mercurial repository in ``~/mypxlib/migrated``.
[172]374
[703]375On final example to show the syntax of Bazaar sources::
376
377    [project]
378    target = hg:target
379    start-revision = base-0
380    root-directory = /tmp/calife
381    state-file = tailor.state
382    source = baz:source
383
384    [baz:source]
385    module = calife--pam--3.0
386    repository = roberto@keltia.net--2003-depot
387    subdir = tla
388
389    [hg:target]
390    repository = /tmp/HG/calife-pam
391    subdir = hg
392
393.. [#] NB: when the source and the target repositories specify
394       different directories with the ``subdir`` option, tailor
395       uses ``rsync`` to keep them in sync, so that tool needs
396       to be installed.
397
[651]398
399Configuration sections
400----------------------
401
[656]402Default
403~~~~~~~
404
405The ``[DEFAULT]`` section in the configuration file may set the
406default value for any of the recognized options: when a value is
407missing from a specific section it is looked up in this section.
408
409One particular option, ``projects``, is meaningful only in the
410``[DEFAULT]`` section: it's a comma separated list of project names,
411the one that will be operated on by tailor when no project is
412specified on the command line.  When the there are no ``projects``
413setting nor any on the command line, tailor activates all configured
414projects, in order of appearance in the config file.
415
416
[651]417Projects
418~~~~~~~~
419
420A project is identified by a section whose name does not contain any
421colon (":") character, and configured with the following values:
422
[1014]423.. note:: If a particular option is missing from the project section,
424          its value is obtained looking up the same option in the
425          ``[DEFAULT]`` section.
426
[898]427root-directory : string
[651]428  This is where all the fun will happen: this directory will contain
429  the source and the target working copy, and usually the state and
[831]430  the log file. It supports the conventional `~user` to indicate user's
431  home directory and defaults to the current working directory.
[651]432
[898]433subdir : string
[651]434  This is the subdirectory, relative to the `root-directory`, where
435  tailor will extract the source working copy. It may be '.' for some
[832]436  backend kinds. The source and target backends will use this value
437  if they don't explicitly override it.
[651]438
[898]439state-file : string
[651]440  Name of the state file needed to store tailor last activity.
441
[898]442source : string
[651]443  The source repository: a repository name is something like
444  "darcs:somename", that will be loaded from the homonymous section
445  in the configuration.
446
[898]447target : string
[651]448  The counterpart of `source`, the repository that will receive the
449  changes coming from there.
450
451Non mandatory options:
452
[898]453verbose : bool
[651]454  Print the commands as they are executed.
455
[898]456debug : bool
[651]457  Print also their output.
458 
[898]459before-commit : tuple
[651]460  This is a function name, or a sequence of function names enclosed
461  by brackets, that will be executed on each changeset just before
462  it get replayed on the target system: this may be used to perform
463  any kind of alteration on the content of the changeset, or to skip
464  some of them.
465
[898]466after-commit : tuple
[651]467  This is a function name, or a sequence of function names enclosed
468  by brackets, that will be executed on each changeset just after
469  the commit on the target system: this may be used for example to
470  create a tag.
471
[898]472subdir : string
[651]473  The name of the subdirectory, under ``root-directory``, that will
474  contain the source and target repositories/working directories.
475
[898]476start-revision : string
[655]477  This identifies from when tailor should start the migration. It can
478  be either ``INITIAL``, to indicate the start of the history, or
479  ``HEAD`` to indicate the current latest changeset, or a backend
480  specific way of indicate a particular revision/tag in the history.
481  See also `CVS start-revision`_ above.
[662]482
[898]483patch-name-format : string
[662]484  Some backends have a distinct notion of `patch name` and `change
485  log`, others just suggest a policy that the first line of the
486  message is a summary, the rest if present is a more detailed
487  description of the change.  With this option you can control the
488  format of the name, or of the first line of the changelog.
489
490  The prototype may contain ``%(keyword)s`` such as 'author', 'date',
[837]491  'revision', 'firstlogline', 'remaininglog' or 'project'.  It
492  defaults to ``[%(project)s @ %(revision)s]``; setting it to the
493  empty string means that tailor will simply use the original
494  changelog.
[723]495
496  When you set it empty, as in
497
498  ::
499
500    [project]
501    patch-name-format =
502
503  tailor will keep the original changelog as is.
[662]504
[898]505remove-first-log-line : bool
[662]506  Remove the first line of the upstream changelog. This is intended to
507  go in pair with ``patch-name-format``, when using it's 'firstlogline'
508  variable to build the name of the patch.  By default is ``False``.
[837]509 
510  A reasonable usage is::
511
512    [DEFAULT]
513    patch-name-format=[%(project)s @ %(revision)s]: %(firstlogline)s
514    remove-first-log-line=True
[651]515
[898]516refill-changelogs : bool
[722]517  Off by default, when active tailor reformats every changelog before
518  committing on the target system.
[655]519
[898]520
[651]521Repositories
522~~~~~~~~~~~~
523
524All the section whose name contains at least one colon character
525denote a repository.  A single repository may be shared by zero, one or
526more projects.  The first part of the name up to the first colon
[703]527indicates the `kind` of the repository, one of ``arx``, ``baz``, ``bzr``,
[879]528``cdv``, ``cvs``, ``darcs``, ``git``, ``hg``, ``hglib``, ``monotone``,
529``svn``, ``svndump`` and ``tla``.
[651]530
[1014]531.. note:: If a particular option is missing from the repository section,
532          its value is obtained looking up the same option in the
533          section of the project *currently* using the repository,
534          falling back to the ``[DEFAULT]`` section.
535
[898]536repository : string
537  When a repository is used as a `source`, it must indicate its origin
538  with ``repository``, and for some backends also a ``module``, but
539  are not required when it's a target system, even if some backend may
540  use the information to create the target repository (like ``svn``
541  backend does).
542
543subdir : string
544  When the `source` and `target` repositories use different
545  subdirectories, tailor uses ``rsync`` to copy the changes between
546  the two after each applied changeset.  When the source repository
547  basedir is a subdirectory of target basedir tailor prefixes all
548  paths coming from upstream to match the relative position.
549
550  This defaults to the project's setting.
551
552command : string
553  Backends based on external command line tool such as *svn* or
554  *darcs* offers this option to impose a particular external binary to
555  be used, as done in the example above for ``hg``.
556
557python-path : string
558  For pythonique backends such as *bzr* and *hglib* this indicates
559  where the respective library is located.
560
561encoding : string
562  States the charset encoding the particular repository uses, and it's
563  particularly important when it differs from local system setup, that
564  you may inspect executing::
565
566    python -m locale
[1015]567
568encoding-errors-policy : string
569  By default is *strict*, that means that Python will raise an
570  exception on Unicode conversion errors. Valid options are *ignore*
571  that simply skips offending glyphs and *replace* where unrecognized
572  entities are replaced with a place holder.
[898]573
574delay-before-apply : integer
575  Sometime the migration is fast enough to put the upstream server
576  under an excessive load. When this is the case, you may specify
577  ``delay-before-apply = 5``, that is the number of seconds tailor
578  will wait before applying each changeset.
579
580  It defaults to *None*, ie no delay at all.
581
582arx
583%%%
584
585..
586
587baz
588%%%
589
590..
591
592bzr
593%%%
594
595..
596
597cdv
598%%%
599
600..
601
602cvs
603%%%
604
605tag-entries : bool
606  CVS and CVSPS repositories may turn off automatic tagging of
607  entries, that tailor does by default to prevent manual interventions
608  in the CVS working copy, using ``tag_entries = False``.
[651]609
[898]610  *True* by default.
611
612cvsps
613%%%%%
614
615tag-entries : bool
616  CVS and CVSPS repositories may turn off automatic tagging of
617  entries, that tailor does by default to prevent manual interventions
618  in the CVS working copy, using ``tag_entries = False``.
619
620  *True* by default.
621 
622darcs
623%%%%%
624
625..
626
627git
628%%%
629
630..
631
632hg
633%%
634
635..
636
637hglib
638%%%%%
639
640..
641
642monotone
643%%%%%%%%
644
645keyid : string
[963]646  Monotone key id to use for commits. The specified key
647  must exist on keystore. Takes precedence
648  over keyfile and keygenid.
[898]649
650keyfile : string
[963]651  File containing a keypair to store in the repository.
652  The keypair is used for commits. Ignored if keyid is
653  specified.
654
655keygenid : string
656  Id of a new keypair to generate and store in the
657  repository.
658  The keypair is used for commits. Ignored if keyid is
659  specified.
660
661passphrase : string
[1019]662  Passphrase to use for commits. Must be specified.
663
664custom_lua : string
665  Optional custom lua script. If present, is written into MT/monotonerc.
[898]666
667svn
668%%%
669
670filter-badchars : bool (or string)
671  Activate (with *True*) or activate and specify (with a *string*) the
672  filter on the svn log to eliminate illegal XML characters.
673
[1052]674  *False* by default, when set to *True* the following characters are
675  washed out from the upstream changes::
676
677    allbadchars = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09" \
678                  "\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15" \
679                  "\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7f"
680
681  If this is not right or enough, you can specify a string value
682  instead of the boolean flag, containing the characters to omit, as
683  in::
684
685    filter-badchars=\x00\x01
[898]686 
687use-propset : bool
688  Indicate that tailor is allowed to properly inject the upstream
689  changeset's author and timestamp into the target repository.  As
690  stated above, this requires a manual intervention on the repository
691  itself and thus is off by default, and tailor simply appends those
692  values to the changelog.  When active at bootstrap time and the
693  repository is local, tailor creates automatically a minimal
694  ``hooks/pre-revprop-change`` script inside the repository, so no
695  other intervention is needed.
[651]696
[898]697  *False* by default.
[936]698
699use-limit : bool
700  By default *True*, should be set to *False* when using old
701  Subversion clients, since ``log --limit`` was introduced with
702  version 1.2. By using this option tailor can fetch just the
703  revision it needs, instead of transfering whole history log.
[978]704
705trust-root : bool
706  Tailor by default verifies that the specified ``repository``
707  effectively points to the root of a Subversion repository,
708  eventually splitting it and adjusting ``module`` accordingly.  This
709  is sometimes undesiderable, for example when the root isn't public
710  and cannot be listed.  Setting this option to *True* disable the
711  check and tailor takes the given ``repository`` and ``module`` as-is.
712
[1042]713ignore-externals : bool
714  By default the Subversion backend does not consider the external
715  references defined in the source repository.  This option force
716  Tailor to behave as it did up to 0.9.20.
[780]717
[898]718svndump
719%%%%%%%
[780]720
[1043]721.. warning:: The svndump backend is totally wrong and almost unusable
722             at this time, and will be replaced by a third party
723             framework.
[680]724
[898]725tla
726%%%
[651]727
[898]728..
[806]729
[847]730
[506]731
732Using a Python script as configuration file
733-------------------------------------------
734
735Instead of executing ``tailor --configfile project.tailor.conf``
736you can prepend the following signature to the config itself::
737
738  #!/usr/bin/env /path/to/tailor
739
740Giving execute mode to it will permit the launch of the tailor
741process by running the config script directly::
742
743  $ ./project.tailor.conf
744
745When a config file is signed in this way [#]_, either you pass it as
746argument to ``--configfile`` or executed as above, tailor will
747actually execute it as a full fledged Python script, that may define
748functions that alter the behaviour of tailor itself.
749
750A common usage of this functionality is to define so called `hooks`,
751sequences of functions that are executed at particular points in
752the tailorization process.
753
[639]754Just to illustrate the functionality, consider the following example::
[506]755
[639]756    #!/usr/bin/env tailor
757
[506]758    """
[639]759    [DEFAULT]
760    debug = False
761    verbose = True
762
[506]763    [project]
[879]764    target = bzr:target
[639]765    root-directory = /tmp/prova
766    state-file = tailor.state
767    source = darcs:source
768    before-commit = before
769    after-commit = after
770    start-revision = Almost arbitrarily tagging this as version 0.8
771
[879]772    [bzr:target]
[639]773    python-path = /opt/src/bzr.dev
774    subdir = bzrside
775
776    [darcs:source]
777    repository = /home/lele/WiP/cvsync
778    subdir = darcside
[506]779    """
780
[639]781    def before(wd, changeset):
782        print "BEFORE", changeset
783        changeset.author = "LELE"
784        return changeset
785
786    def after(wd, changeset):
787        print "AFTER", changeset
[506]788
[639]789With the above in a `script` called say ``tester``, just doing::
790
791    $ chmod 755 tester
792    $ ./tester
793
794will migrate the history from a darcs repository to a bazaar-ng one,
795forcing the author to a well-known name :-)
796
[506]797.. [#] Tailor does actually read just the first two bytes from the
798       file, and compare them with "#!", so you are free to choose
799       whatever syntax works in your environment.
800
801
[488]802State file
803----------
[315]804
[488]805The state file stores two things: the last upstream revision that
806has been applied to the tree, and a sequence of pending (not yet
807applied) changesets, that may be empty. In the latter case, tailor
808will fetch latest changes from the upstream repository.
[315]809
[940]810
811Logging
812-------
813
814Tailor uses the Python's logging module to emit noise. It's basic
815configuration is hardwired and correspond to the following::
816
817    [formatters]
818    keys = console
819
820    [formatter_console]
821    format =  %(asctime)s [%(levelname).1s] %(message)s
822    datefmt = %H:%M:%S
823
824    [loggers]
825    keys = root
826
827    [logger_root]
828    level = INFO
829    handlers = console
830
831    [handlers]
832    keys = console
833
834    [handler_console]
835    class = StreamHandler
836    formatter = console
837    args = (sys.stdout,)
838    level = INFO
839
840However, you can completely override the default adding a
841*supersection* ``[[logging]]`` to the configuration file, something
842like::
843
844    # ... usual tailor config ...
845    [project]
846    source = bzr:source
847    target = hg:target
848
849    # Here ends tailor config, and start the one for the logging
850    # module
851
852    [[logging]]
853
854    [logger_tailor.BzrRepository]
855    level = DEBUG
856    handlers = tailor.source
857
858    [handler_tailor.source]
859    class = SMTPHandler
860    args = ('localhost', 'from@abc', ['tailor@abc'], 'Tailor log')
861
[173]862Further help
863============
[172]864
[399]865See the output of ``tailor -h`` for some further tips.  There's
[310]866also a `wiki page`_ that may give you some other hints.  The
867development of Tailor is mainly driven by user requests at this point,
[745]868and the preferred comunication medium is the dedicated `mailing list`_
[310]869[#]_.
[177]870
871.. _wiki page:
[287]872   http://www.darcs.net/DarcsWiki/Tailor
[177]873
[288]874.. _mailing list:
875   http://lists.zooko.com/mailman/listinfo/tailor
876   
[177]877I will be more than happy to answer any doubt, question or suggestion
[745]878you may have on it. I'm usually hanging out as "lelit" on the IRC
879channel devoted to darcs on the `freenode.net` network. Do not
880hesitate to contact me either by email or chatting there.
[288]881
[310]882.. [#] I wish to say a big `Thank you` to `Zooko <zooko@zooko.com>`_,
883       for hosting the ML and for supporting Tailor in several ways,
884       from suggestions to bug reporting and fixing.
[173]885
886
[635]887Authors
888=======
[173]889
[172]890Lele Gaifax <lele@nautilus.homeip.net>
[261]891
[554]892Since I'm not currently using all the supported systems (so little
893time, so many VCSs...) I'm not in position to test them out properly,
894but I'll do my best to keep them in sync, maybe with your support :-)
895
896ArX support
897-----------
898
899ArX_ support was contributed by `Walter Landry <wlandry@ucsd.edu>`_.
[261]900
[635]901Bazaar-NG support
902-----------------
903
904`Bazaar-NG`_ support was contributed by `Johan Rydberg
905<jrydberg@gnu.org>`_.
[691]906
907Git support
908-----------
909
[787]910`Git`_ support was contributed by `Todd Mokros
[691]911<tmokros@tmokros.net>`_.
[635]912
[261]913Monotone support
914----------------
915
916Monotone_ support was kindly contributed by `Markus Schiltknecht
[308]917<markus@bluegap.ch>`_ and further developed by `rghetta
[686]918<birrachiara@tin.it>`_, that was able to linearize the multi-headed
919monotone history into something tailor groks. Kudos!
[554]920
921Tla support
922-----------
923
924Tla_ support was contributed by `Robin Farine
925<robin.farine@terminus.org>`_.
[261]926
[305]927
928License
929=======
930
931Tailor is distribuited under the `GNU General Public License`__.
932
933__ http://www.fsf.org/licensing/licenses/gpl.html
[177]934
[172]935
[176]936About this document
937===================
[177]938
939This document and most of the internal documention use the
940reStructuredText format so that it can be easily converted into other
941formats, such as HTML.  For more information about this, please see:
[172]942
[177]943  http://docutils.sourceforge.net/rst.html
[176]944
945
946.. vim:ft=rest
[174]947.. Local Variables:
948.. mode: rst
949.. End:
Note: See TracBrowser for help on using the repository browser.