| 1 | About |
|---|
| 2 | ===== |
|---|
| 3 | |
|---|
| 4 | Tailor is a tool to migrate changesets between CVS, Subversion_, |
|---|
| 5 | darcs_, monotone_, Codeville_ and `Baazar-NG`_ [#]_ repositories. |
|---|
| 6 | |
|---|
| 7 | This script makes it easier to keep the upstream changes merged in |
|---|
| 8 | a branch of a product, storing needed information such as the upstream |
|---|
| 9 | URI and revision in special properties on the branched directory. |
|---|
| 10 | |
|---|
| 11 | The 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 | |
|---|
| 24 | Ideally you should be able to swap and replace "CVS server" and "darcs |
|---|
| 25 | repository" with any combination of the supported systems. |
|---|
| 26 | |
|---|
| 27 | A more convoluted setup shows how brave people are using it to get a |
|---|
| 28 | two 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 | |
|---|
| 48 | Installation |
|---|
| 49 | ============ |
|---|
| 50 | |
|---|
| 51 | tailor.py is written in Python, and thus Python must be installed on |
|---|
| 52 | your system to use it. It has been successfully used with Python 2.3 |
|---|
| 53 | and 2.4. |
|---|
| 54 | |
|---|
| 55 | Since 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 |
|---|
| 57 | those you will actually use. |
|---|
| 58 | |
|---|
| 59 | Make tailor.py executable:: |
|---|
| 60 | |
|---|
| 61 | $ chmod +x tailor.py |
|---|
| 62 | |
|---|
| 63 | You can either run tailor.py where it is currently located, or move it |
|---|
| 64 | along with the vcpx directory to a location in your PATH. |
|---|
| 65 | |
|---|
| 66 | There's even a standard setup.py that you may use to install the |
|---|
| 67 | script using Python conventional distutils. |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | Examples |
|---|
| 71 | ======== |
|---|
| 72 | |
|---|
| 73 | 1. 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 | |
|---|
| 78 | 2. 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 | |
|---|
| 86 | 3. 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 | |
|---|
| 94 | 4. Merge upstream changes since last update/bootstrap:: |
|---|
| 95 | |
|---|
| 96 | $ tailor.py ~/svnwc/MyProduct |
|---|
| 97 | |
|---|
| 98 | 5. 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 | |
|---|
| 107 | 6. 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 | |
|---|
| 114 | Resolving conflicts |
|---|
| 115 | =================== |
|---|
| 116 | |
|---|
| 117 | Should one of the replayed changes generate any conflict, tailor.py |
|---|
| 118 | will prompt the user to correct them. This is done after the upstream |
|---|
| 119 | patch has been applied and before the final commit on the target |
|---|
| 120 | system, so that manually tweaking the conflict can produce a clean |
|---|
| 121 | patch. |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | Shortcomings |
|---|
| 125 | ============ |
|---|
| 126 | |
|---|
| 127 | Tailor currently suffers of the following reported problems: |
|---|
| 128 | |
|---|
| 129 | a) 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 | |
|---|
| 133 | b) 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 | |
|---|
| 137 | c) Monotone, Codeville and Baazar-NG are (currently) only supported as |
|---|
| 138 | *target* |
|---|
| 139 | |
|---|
| 140 | d) 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 | |
|---|
| 144 | This list will always be incomplete, but I'll do my best to keep it |
|---|
| 145 | short :-) |
|---|
| 146 | |
|---|
| 147 | .. _subprocess: http://www.lysator.liu.se/~astrand/popen5/ |
|---|
| 148 | |
|---|
| 149 | |
|---|
| 150 | Tailor's metadata |
|---|
| 151 | ================= |
|---|
| 152 | |
|---|
| 153 | To do its work, tailor needs some information about your source tree, |
|---|
| 154 | such as the upstream repository URL and the current revision of the |
|---|
| 155 | sources on your harddisk. |
|---|
| 156 | |
|---|
| 157 | In the simpler case, tailor keeps this information in a file called |
|---|
| 158 | `tailor.info`, one for each tailored project, that is a very simple |
|---|
| 159 | text document, with the following information, one per line: |
|---|
| 160 | |
|---|
| 161 | 1. Upstream repository kind (either "cvs", "darcs" or "svn) |
|---|
| 162 | 2. Target repository kind (the same as above) |
|---|
| 163 | 3. The name of the "module" that's been tailored |
|---|
| 164 | 4. The URL of the upstream repository (that may not be an URL, for cvs...) |
|---|
| 165 | 5. The current revision, from the upstream point of view, of the sources |
|---|
| 166 | 6. 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 | |
|---|
| 170 | This is everything tailor needs, to be able to keep going from where it |
|---|
| 171 | left last time. |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | Config file format |
|---|
| 175 | ------------------ |
|---|
| 176 | |
|---|
| 177 | When your project is composed by multiple upstream modules, it is |
|---|
| 178 | easier to collect such information in a single file. This is done by |
|---|
| 179 | specifying the `--configfile` option with a file name as argument. In |
|---|
| 180 | this case, tailor will read/write the above information from a |
|---|
| 181 | standard Python dictionary stored in the given file. |
|---|
| 182 | |
|---|
| 183 | The dictionary is keyed on the relative position of each project, and |
|---|
| 184 | each entry carries the same information described above. |
|---|
| 185 | |
|---|
| 186 | Here'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 | |
|---|
| 195 | By convention, config files are named with the extension ".tailor", |
|---|
| 196 | but this is not enforced. |
|---|
| 197 | |
|---|
| 198 | In the example above, 'plone/atcontenttypes' is a directory where the |
|---|
| 199 | target source will be stored. The keys such 'module', 'source_kind', |
|---|
| 200 | etc correspond to options of the same name. |
|---|
| 201 | |
|---|
| 202 | When using a config file, tailor will perform its job on each project |
|---|
| 203 | contained in the dictionary. |
|---|
| 204 | |
|---|
| 205 | |
|---|
| 206 | Further help |
|---|
| 207 | ============ |
|---|
| 208 | |
|---|
| 209 | See the output of ``tailor.py -h`` for some further tips. There's |
|---|
| 210 | also a `wiki page`_ that may give you some other hints. The |
|---|
| 211 | development of Tailor is mainly driven by user requests at this point, |
|---|
| 212 | and 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 | |
|---|
| 221 | I will be more than happy to answer any doubt, question or suggestion |
|---|
| 222 | you may have on it. I'm usually hanging as "lelit" on the IRC channel |
|---|
| 223 | devoted to darcs on the `freenode.net` network. Do not hesitate to |
|---|
| 224 | contact 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 | |
|---|
| 231 | Author |
|---|
| 232 | ====== |
|---|
| 233 | |
|---|
| 234 | Lele Gaifax <lele@nautilus.homeip.net> |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | Monotone support |
|---|
| 238 | ---------------- |
|---|
| 239 | |
|---|
| 240 | Monotone_ 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 |
|---|
| 243 | little time, so many VCSs...) I'm not in position to test it out |
|---|
| 244 | properly, but I'll do my best to keep it in sync, maybe with your |
|---|
| 245 | support :-) |
|---|
| 246 | |
|---|
| 247 | .. _monotone: http://www.venge.net/monotone/ |
|---|
| 248 | |
|---|
| 249 | |
|---|
| 250 | License |
|---|
| 251 | ======= |
|---|
| 252 | |
|---|
| 253 | Tailor is distribuited under the `GNU General Public License`__. |
|---|
| 254 | |
|---|
| 255 | __ http://www.fsf.org/licensing/licenses/gpl.html |
|---|
| 256 | |
|---|
| 257 | |
|---|
| 258 | About this document |
|---|
| 259 | =================== |
|---|
| 260 | |
|---|
| 261 | This document and most of the internal documention use the |
|---|
| 262 | reStructuredText format so that it can be easily converted into other |
|---|
| 263 | formats, 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: |
|---|