source: tailor/README @ 261

Revision 261, 7.4 KB checked in by lele@…, 8 years ago (diff)

Integrated monotone support, as contributed by Markus Schiltknecht
Tailor is now able to use monotone as a target repository, but not
yet as a source one.

Line 
1About
2=====
3
4tailor.py is a tool to migrate changesets between CVS, Subversion,
5darcs and monotone 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
87
88Resolving conflicts
89===================
90
91Should one of the replayed changes generate any conflict, tailor.py
92will prompt the user to correct them. This is done after the upstream
93patch has been applied and before the final commit on the target
94system, so that manually tweaking the conflict can produce a clean
95patch.
96
97
98Shortcomings
99============
100
101Tailor currently suffers of the following reported problems:
102
103a) It does not handle "empty" CVS checkouts, in other words you cannot
104   bootstrap a project that has nothing in its CVS upstream
105   repository, or from a point in time where this condition was true.
106
107b) It does not work under Windows (no, that's not a feature :-). Maybe
108   replacing the shwrap machinery with something built on top of
109   subprocess_ that seems able to hide Windows crazyness...
110
111This list will always be incomplete, but I'll do my best to keep it
112short :-)
113
114.. _subprocess: http://www.lysator.liu.se/~astrand/popen5/
115
116
117Tailor's metadata
118=================
119
120To do its work, tailor needs some information about your source tree,
121such as the upstream repository URL and the current revision of the
122sources on your harddisk.
123
124In the simpler case, tailor keeps this information in a file called
125`tailor.info`, one for each tailored project, that is a very simple
126text document, with the following information, one per line:
127
1281. Upstream repository kind (either "cvs", "darcs" or "svn)
1292. Target repository kind (the same as above)
1303. The name of the "module" that's been tailored
1314. The URL of the upstream repository (that may not be an URL, for cvs...)
1325. The current revision, from the upstream point of view, of the sources
1336. The subdirectory that contains the checked out upstream tree,
134   either that given with with the `--subdir` option or computed
135   taking the last part of the module name.
136
137This is everything tailor needs, to be able to keep going from where it
138left last time.
139
140
141Config file format
142------------------
143
144When your project is composed by multiple upstream modules, it is
145easier to collect such information in a single file. This is done by
146specifying the `--configfile` option with a file name as argument. In
147this case, tailor will read/write the above information from a
148standard Python dictionary stored in the given file.
149
150The dictionary is keyed on the relative position of each project, and
151each entry carries the same information described above.
152
153Here's an example config file entry::
154
155 {'plone/atcontenttypes': {'module': 'ATContentTypes',
156                           'source_kind': 'cvs',
157                           'subdir': 'ATContentTypes',
158                           'target_kind': 'darcs',
159                           'upstream_repos': ':ext:cvs.sourceforge.net:/cvsroot/collective',
160                           'upstream_revision': '2004-11-24 19:42:06 by ctheune'}}
161
162By convention, config files are named with the extension ".tailor",
163but this is not enforced.
164
165In the example above, 'plone/atcontenttypes' is a directory where the
166target source will be stored. The keys such 'module', 'source_kind',
167etc correspond to options of the same name.
168
169When using a config file, tailor will perform its job on each project
170contained in the dictionary.
171
172
173Further help
174============
175
176See the output of tailor.py -h for some further tips.  There's also a
177`wiki page`_ that may give you some other hints.
178
179.. _wiki page:
180   http://www.scannedinavian.org/DarcsWiki/Tailor
181
182I will be more than happy to answer any doubt, question or suggestion
183you may have on it. I'm usually hanging as "lelit" on the IRC channel
184devoted to darcs on the `freenode.net` network. Do not hesitate to
185contact me either by email or chatting there.
186
187
188Author
189======
190
191Lele Gaifax <lele@nautilus.homeip.net>
192
193
194Monotone support
195----------------
196
197Monotone_ support was kindly contributed by `Markus Schiltknecht
198<markus@bluegap.ch>`.  Since I'm not currently using monotone (so
199little time, so many VCSs...) I'm not in position to test it out
200properly, but I'll do my best to keep it in sync, maybe with your
201support :-)
202
203.. _monotone: http://www.venge.net/monotone/
204
205
206About this document
207===================
208
209This document and most of the internal documention use the
210reStructuredText format so that it can be easily converted into other
211formats, such as HTML.  For more information about this, please see:
212
213  http://docutils.sourceforge.net/rst.html
214
215
216.. vim:ft=rest
217.. Local Variables:
218.. mode: rst
219.. End:
Note: See TracBrowser for help on using the repository browser.