source: tailor/README @ 310

Revision 310, 9.4 KB checked in by lele@…, 8 years ago (diff)

Little touches, mention Baazar-NG support

Line 
1About
2=====
3
4Tailor is a tool to migrate changesets between CVS, Subversion_,
5darcs_, monotone_, Codeville_ and `Baazar-NG`_ [#]_ repositories.
6
7This script makes it easier to keep the upstream changes merged in
8a branch of a product, storing needed information such as the upstream
9URI and revision in special properties on the branched directory.
10
11The following ascii-art illustrates the usual scenario::
12
13                           +------------+            +------------+
14  +--------------+         | Immutable  |            | Working    |
15  | Upstream CVS |-------->| darcs      |----------->| darcs      |
16  | repository   | tailor  | repository | darcs pull | repository |
17  +--------------+         +------------+            +------------+
18                                                           |^         
19                                                           ||
20                                                           ||
21                                                           v|
22                                                          User
23
24Ideally you should be able to swap and replace "CVS server" and "darcs
25repository" with any combination of the supported systems.
26
27A more convoluted setup shows how brave people are using it to get a
28two way sync::
29
30  +----------+        +--------+        +--------+       +---------+
31  |          | -----> | hybrid | darcs  |        | ----> |   my    |
32  | upstream | tailor |  CVS   | -----> | master | darcs | working |
33  |   CVS    | <----- | darcs  | <----- | darcs  | <---- |  darcs  |
34  |          |        |  sync  | tailor |        |       |         |
35  +----------+        +--------+        +--------+       +---------+
36               (cron)            (cron)
37
38
39.. [#] Monotone, Codeville and Baazar-NG systems may be used only as
40       the `target` backend, since the `source` support isn't
41       coded yet.
42
43.. _subversion: http://subversion.tigris.org/
44.. _darcs: http://www.darcs.net/
45.. _codeville: http://www.codeville.org/
46.. _baazar-ng: http://www.bazaar-ng.org/
47
48Installation
49============
50
51tailor.py is written in Python, and thus Python must be installed on
52your system to use it.  It has been successfully used with Python 2.3
53and 2.4.
54
55Since it relays on external tools to do the real work such as `cvs`,
56`darcs` and `svn`, they need to be installed as well, although only
57those you will actually use.
58
59Make tailor.py executable::
60
61 $ chmod +x tailor.py
62
63You can either run tailor.py where it is currently located, or move it
64along with the vcpx directory to a location in your PATH.
65
66There's even a standard setup.py that you may use to install the
67script using Python conventional distutils.
68
69
70Examples
71========
72
731. Bootstrap a new tailored project, starting at upstream revision 10::
74
75    $ tailor.py -b -s svn -R http://svn.server/path/to/svnrepo \
76      --module /Product/trunk -r 10 --subdir Product ~/darcs/MyProduct
77
782. Bootstrap a new product, fetching from CVS and storing under SVN:
79   this will create the directory "~/svnwc/cmfcore"; "~/svnwc" must be
80   already under SVN::
81
82    $ tailor.py --source-kind cvs --target-kind svn --bootstrap \
83                --repository :pserver:cvs.zope.org:/cvs-repository \
84                --module CMF/CMFCore ~/svnwc/cmfcore
85
863. Showing each command bootstrap a new DARCS repos in
87   "~/darcs/cmftopic" under which the upstream module will be
88   extracted as "CMFTopic" (ie, the last component of the module
89   name)::
90
91    $ tailor.py -D -b -R :pserver:anonymous@cvs.zope.org:/cvs-repository/ \
92                -m CMF/CMFTopic ~/darcs/cmftopic
93             
944. Merge upstream changes since last update/bootstrap::
95
96    $ tailor.py ~/svnwc/MyProduct
97
985. Migrate a whole SVN repository, starting from the beginning::
99
100    $ tailor.py -b -s svn -R svn+ssh://caia/tmp/svn/repo --module / \
101      --subdir testsvn --revision 1 testdir
102
103   .. warning:: When using --revision with a SVN source repository, be
104                sure that the path your are tracking was there at that
105                revision, otherwise svn will exit with an error.
106
1076. Bootstrap from a CVS branch, starting from a given point in time::
108
109    $ tailor.py -b -s cvs -R :pserver:anonymous@server.org:/cvsroot/ \
110                --revision 'unstable-branch 2001-12-25 23:26:48 UTC' \
111                --module something new-darcs-repository
112
113
114Resolving conflicts
115===================
116
117Should one of the replayed changes generate any conflict, tailor.py
118will prompt the user to correct them. This is done after the upstream
119patch has been applied and before the final commit on the target
120system, so that manually tweaking the conflict can produce a clean
121patch.
122
123
124Shortcomings
125============
126
127Tailor currently suffers of the following reported problems:
128
129a) It does not handle "empty" CVS checkouts, in other words you cannot
130   bootstrap a project that has nothing in its CVS upstream
131   repository, or from a point in time where this condition was true.
132
133b) It does not work under Windows (no, that's not a feature :-). Maybe
134   replacing the shwrap machinery with something built on top of
135   subprocess_ that seems able to hide Windows crazyness...
136
137c) Monotone, Codeville and Baazar-NG are (currently) only supported as
138   *target*
139
140d) Specifying ``--subdir .`` may not work, in particular when dealing
141   with remote CVS repositories (it does when the CVS repository is
142   on local machine).
143   
144This list will always be incomplete, but I'll do my best to keep it
145short :-)
146
147.. _subprocess: http://www.lysator.liu.se/~astrand/popen5/
148
149
150Tailor's metadata
151=================
152
153To do its work, tailor needs some information about your source tree,
154such as the upstream repository URL and the current revision of the
155sources on your harddisk.
156
157In the simpler case, tailor keeps this information in a file called
158`tailor.info`, one for each tailored project, that is a very simple
159text document, with the following information, one per line:
160
1611. Upstream repository kind (either "cvs", "darcs" or "svn)
1622. Target repository kind (the same as above)
1633. The name of the "module" that's been tailored
1644. The URL of the upstream repository (that may not be an URL, for cvs...)
1655. The current revision, from the upstream point of view, of the sources
1666. The subdirectory that contains the checked out upstream tree,
167   either that given with with the `--subdir` option or computed
168   taking the last part of the module name.
169
170This is everything tailor needs, to be able to keep going from where it
171left last time.
172
173
174Config file format
175------------------
176
177When your project is composed by multiple upstream modules, it is
178easier to collect such information in a single file. This is done by
179specifying the `--configfile` option with a file name as argument. In
180this case, tailor will read/write the above information from a
181standard Python dictionary stored in the given file.
182
183The dictionary is keyed on the relative position of each project, and
184each entry carries the same information described above.
185
186Here's an example config file entry::
187
188 {'plone/atcontenttypes': {'module': 'ATContentTypes',
189                           'source_kind': 'cvs',
190                           'subdir': 'ATContentTypes',
191                           'target_kind': 'darcs',
192                           'upstream_repos': ':ext:cvs.sourceforge.net:/cvsroot/collective',
193                           'upstream_revision': '2004-11-24 19:42:06 by ctheune'}}
194
195By convention, config files are named with the extension ".tailor",
196but this is not enforced.
197
198In the example above, 'plone/atcontenttypes' is a directory where the
199target source will be stored. The keys such 'module', 'source_kind',
200etc correspond to options of the same name.
201
202When using a config file, tailor will perform its job on each project
203contained in the dictionary.
204
205
206Further help
207============
208
209See the output of ``tailor.py -h`` for some further tips.  There's
210also a `wiki page`_ that may give you some other hints.  The
211development of Tailor is mainly driven by user requests at this point,
212and the preferred comunication media is the dedicated `mailing list`_
213[#]_.
214
215.. _wiki page:
216   http://www.darcs.net/DarcsWiki/Tailor
217
218.. _mailing list:
219   http://lists.zooko.com/mailman/listinfo/tailor
220   
221I will be more than happy to answer any doubt, question or suggestion
222you may have on it. I'm usually hanging as "lelit" on the IRC channel
223devoted to darcs on the `freenode.net` network. Do not hesitate to
224contact me either by email or chatting there.
225
226.. [#] I wish to say a big `Thank you` to `Zooko <zooko@zooko.com>`_,
227       for hosting the ML and for supporting Tailor in several ways,
228       from suggestions to bug reporting and fixing.
229
230
231Author
232======
233
234Lele Gaifax <lele@nautilus.homeip.net>
235
236
237Monotone support
238----------------
239
240Monotone_ support was kindly contributed by `Markus Schiltknecht
241<markus@bluegap.ch>`_ and further developed by `rghetta
242<birrachiara@tin.it>`_.  Since I'm not currently using monotone (so
243little time, so many VCSs...) I'm not in position to test it out
244properly, but I'll do my best to keep it in sync, maybe with your
245support :-)
246
247.. _monotone: http://www.venge.net/monotone/
248
249
250License
251=======
252
253Tailor is distribuited under the `GNU General Public License`__.
254
255__ http://www.fsf.org/licensing/licenses/gpl.html
256
257
258About this document
259===================
260
261This document and most of the internal documention use the
262reStructuredText format so that it can be easily converted into other
263formats, such as HTML.  For more information about this, please see:
264
265  http://docutils.sourceforge.net/rst.html
266
267
268.. vim:ft=rest
269.. Local Variables:
270.. mode: rst
271.. End:
Note: See TracBrowser for help on using the repository browser.