source: tailor/README @ 286

Revision 286, 7.8 KB checked in by lele@…, 8 years ago (diff)

Little correction to reST markup

Line 
1About
2=====
3
4tailor.py is a tool to migrate changesets between CVS, Subversion,
5darcs, monotone and Codeville 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 `CVS`, `Subversion` and `darcs`.
26
27
28Installation
29============
30
31tailor.py is written in Python, and thus Python must be installed on
32your system to use it.  It has been successfully used with Python 2.3
33and 2.4.
34
35Since it relays on external tools to do the real work such as `cvs`,
36`darcs` and `svn`, they need to be installed as well, although only
37those you will actually use.
38
39Make tailor.py executable::
40
41 $ chmod +x tailor.py
42
43You can either run tailor.py where it is currently located, or move it
44along with the vcpx directory to a location in your PATH.
45
46There's even a standard setup.py that you may use to install the
47script using Python conventional distutils.
48
49
50Examples
51========
52
531. Bootstrap a new tailored project, starting at upstream revision 10::
54
55    $ tailor.py -b -s svn -R http://svn.server/path/to/svnrepo \
56      --module /Product/trunk -r 10 --subdir Product ~/darcs/MyProduct
57
582. Bootstrap a new product, fetching from CVS and storing under SVN:
59   this will create the directory "~/svnwc/cmfcore"; "~/svnwc" must be
60   already under SVN::
61
62    $ tailor.py --source-kind cvs --target-kind svn --bootstrap \
63                --repository :pserver:cvs.zope.org:/cvs-repository \
64                --module CMF/CMFCore ~/svnwc/cmfcore
65
663. Showing each command bootstrap a new DARCS repos in
67   "~/darcs/cmftopic" under which the upstream module will be
68   extracted as "CMFTopic" (ie, the last component of the module
69   name)::
70
71    $ tailor.py -D -b -R :pserver:anonymous@cvs.zope.org:/cvs-repository/ \
72                -m CMF/CMFTopic ~/darcs/cmftopic
73             
744. Merge upstream changes since last update/bootstrap::
75
76    $ tailor.py ~/svnwc/MyProduct
77
785. Migrate a whole SVN repository, starting from the beginning::
79
80    $ tailor.py -b -s svn -R svn+ssh://caia/tmp/svn/repo --module / \
81      --subdir testsvn --revision 1 testdir
82
83.. warning:: When using --revision with a SVN source repository, be
84             sure that the path your are tracking was there at that
85             revision, otherwise svn will exit with an error.
86
876. Bootstrap from a CVS branch, starting from a given point in time::
88
89    $ tailor.py -b -s cvs -R :pserver:anonymous@server.org:/cvsroot/ \
90                --revision 'unstable-branch 2001-12-25 23:26:48 UTC' \
91                --module something new-darcs-repository
92
93
94Resolving conflicts
95===================
96
97Should one of the replayed changes generate any conflict, tailor.py
98will prompt the user to correct them. This is done after the upstream
99patch has been applied and before the final commit on the target
100system, so that manually tweaking the conflict can produce a clean
101patch.
102
103
104Shortcomings
105============
106
107Tailor currently suffers of the following reported problems:
108
109a) It does not handle "empty" CVS checkouts, in other words you cannot
110   bootstrap a project that has nothing in its CVS upstream
111   repository, or from a point in time where this condition was true.
112
113b) It does not work under Windows (no, that's not a feature :-). Maybe
114   replacing the shwrap machinery with something built on top of
115   subprocess_ that seems able to hide Windows crazyness...
116
117c) Monotone and Codeville are (currently) only supported as *target*
118
119This list will always be incomplete, but I'll do my best to keep it
120short :-)
121
122.. _subprocess: http://www.lysator.liu.se/~astrand/popen5/
123
124
125Tailor's metadata
126=================
127
128To do its work, tailor needs some information about your source tree,
129such as the upstream repository URL and the current revision of the
130sources on your harddisk.
131
132In the simpler case, tailor keeps this information in a file called
133`tailor.info`, one for each tailored project, that is a very simple
134text document, with the following information, one per line:
135
1361. Upstream repository kind (either "cvs", "darcs" or "svn)
1372. Target repository kind (the same as above)
1383. The name of the "module" that's been tailored
1394. The URL of the upstream repository (that may not be an URL, for cvs...)
1405. The current revision, from the upstream point of view, of the sources
1416. The subdirectory that contains the checked out upstream tree,
142   either that given with with the `--subdir` option or computed
143   taking the last part of the module name.
144
145This is everything tailor needs, to be able to keep going from where it
146left last time.
147
148
149Config file format
150------------------
151
152When your project is composed by multiple upstream modules, it is
153easier to collect such information in a single file. This is done by
154specifying the `--configfile` option with a file name as argument. In
155this case, tailor will read/write the above information from a
156standard Python dictionary stored in the given file.
157
158The dictionary is keyed on the relative position of each project, and
159each entry carries the same information described above.
160
161Here's an example config file entry::
162
163 {'plone/atcontenttypes': {'module': 'ATContentTypes',
164                           'source_kind': 'cvs',
165                           'subdir': 'ATContentTypes',
166                           'target_kind': 'darcs',
167                           'upstream_repos': ':ext:cvs.sourceforge.net:/cvsroot/collective',
168                           'upstream_revision': '2004-11-24 19:42:06 by ctheune'}}
169
170By convention, config files are named with the extension ".tailor",
171but this is not enforced.
172
173In the example above, 'plone/atcontenttypes' is a directory where the
174target source will be stored. The keys such 'module', 'source_kind',
175etc correspond to options of the same name.
176
177When using a config file, tailor will perform its job on each project
178contained in the dictionary.
179
180
181Further help
182============
183
184See the output of tailor.py -h for some further tips.  There's also a
185`wiki page`_ that may give you some other hints.
186
187.. _wiki page:
188   http://www.scannedinavian.org/DarcsWiki/Tailor
189
190I will be more than happy to answer any doubt, question or suggestion
191you may have on it. I'm usually hanging as "lelit" on the IRC channel
192devoted to darcs on the `freenode.net` network. Do not hesitate to
193contact me either by email or chatting there.
194
195
196Author
197======
198
199Lele Gaifax <lele@nautilus.homeip.net>
200
201
202Monotone support
203----------------
204
205Monotone_ support was kindly contributed by `Markus Schiltknecht
206<markus@bluegap.ch>`.  Since I'm not currently using monotone (so
207little time, so many VCSs...) I'm not in position to test it out
208properly, but I'll do my best to keep it in sync, maybe with your
209support :-)
210
211.. _monotone: http://www.venge.net/monotone/
212
213
214About this document
215===================
216
217This document and most of the internal documention use the
218reStructuredText format so that it can be easily converted into other
219formats, such as HTML.  For more information about this, please see:
220
221  http://docutils.sourceforge.net/rst.html
222
223
224.. vim:ft=rest
225.. Local Variables:
226.. mode: rst
227.. End:
Note: See TracBrowser for help on using the repository browser.