| 1 | About |
|---|
| 2 | ===== |
|---|
| 3 | |
|---|
| 4 | tailor.py is a tool to migrate changesets between CVS, Subversion, and |
|---|
| 5 | darcs 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 `CVS`, `Subversion` and `darcs`. |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | Installation |
|---|
| 29 | ============ |
|---|
| 30 | |
|---|
| 31 | tailor.py is written in Python, and thus Python must be installed on |
|---|
| 32 | your system to use it. Since it relays on external tools to do the |
|---|
| 33 | real work such as `cvs`, `darcs` and `svn`, they need to be installed |
|---|
| 34 | as well. |
|---|
| 35 | |
|---|
| 36 | Make tailor.py executable:: |
|---|
| 37 | |
|---|
| 38 | $ chmod +x tailor.py |
|---|
| 39 | |
|---|
| 40 | You can either run tailor.py where it is currently located, or move it |
|---|
| 41 | along with the vcpx directory to a location in your PATH. |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | Examples |
|---|
| 45 | ======== |
|---|
| 46 | |
|---|
| 47 | 1. Bootstrap a new tailored project, starting at upstream revision 10:: |
|---|
| 48 | |
|---|
| 49 | $ tailor.py -b -s svn -R http://svn.server/Product -r 10 ~/darcs/MyProduct |
|---|
| 50 | |
|---|
| 51 | 2. Bootstrap a new product, fetching from CVS and storing under SVN: |
|---|
| 52 | this will create the directory "~/svnwc/cmfcore"; "~/svnwc" must be |
|---|
| 53 | already under SVN:: |
|---|
| 54 | |
|---|
| 55 | $ tailor.py --source-kind cvs --target-kind svn --bootstrap \ |
|---|
| 56 | --repository :pserver:cvs.zope.org:/cvs-repository \ |
|---|
| 57 | --module CMF/CMFCore ~/svnwc/cmfcore |
|---|
| 58 | |
|---|
| 59 | 3. Showing each command bootstrap a new DARCS repos in |
|---|
| 60 | "~/darcs/cmftopic" under which the upstream module will be |
|---|
| 61 | extracted as "CMFTopic" (ie, the last component of the module |
|---|
| 62 | name):: |
|---|
| 63 | |
|---|
| 64 | $ tailor.py -D -b -R :pserver:anonymous@cvs.zope.org:/cvs-repository/ \ |
|---|
| 65 | -m CMF/CMFTopic ~/darcs/cmftopic |
|---|
| 66 | |
|---|
| 67 | 4. Merge upstream changes since last update/bootstrap:: |
|---|
| 68 | |
|---|
| 69 | $ tailor.py ~/svnwc/MyProduct |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | Tailor's metadata |
|---|
| 73 | ================= |
|---|
| 74 | |
|---|
| 75 | To do its work, tailor needs some information about your source tree, |
|---|
| 76 | such as the upstream repository URL and the current revision of the |
|---|
| 77 | sources on your harddisk. |
|---|
| 78 | |
|---|
| 79 | In the simpler case, tailor keeps this information in a file called |
|---|
| 80 | `tailor.info`, one for each tailored project, that is a very simple |
|---|
| 81 | text document, with the following information, one per line: |
|---|
| 82 | |
|---|
| 83 | 1. Upstream repository kind (either "cvs", "darcs" or "svn) |
|---|
| 84 | 2. Target repository kind (the same as above) |
|---|
| 85 | 3. The name of the "module" that's been tailored |
|---|
| 86 | 4. The URL of the upstream repository (that may not be an URL, for cvs...) |
|---|
| 87 | 5. The current revision, from the upstream point of view, of the sources |
|---|
| 88 | 6. The subdirectory that contains the checked out upstream tree, |
|---|
| 89 | either that given with with the `--subdir` option or computed |
|---|
| 90 | taking the last part of the module name. |
|---|
| 91 | |
|---|
| 92 | This is everything tailor needs, to be able to keep going from where it |
|---|
| 93 | left last time. |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | Config file format |
|---|
| 97 | ------------------ |
|---|
| 98 | |
|---|
| 99 | When your project is composed by multiple upstream modules, it is |
|---|
| 100 | easier to collect such information in a single file. This is done by |
|---|
| 101 | specifying the `--configfile` option with a file name as argument. In |
|---|
| 102 | this case, tailor will read/write the above information from a |
|---|
| 103 | standard Python dictionary stored in the given file. |
|---|
| 104 | |
|---|
| 105 | The dictionary is keyed on the relative position of each project, and |
|---|
| 106 | each entry carries the same information described above. |
|---|
| 107 | |
|---|
| 108 | Here's an example config file entry:: |
|---|
| 109 | |
|---|
| 110 | {'plone/atcontenttypes': {'module': 'ATContentTypes', |
|---|
| 111 | 'source_kind': 'cvs', |
|---|
| 112 | 'subdir': 'ATContentTypes', |
|---|
| 113 | 'target_kind': 'darcs', |
|---|
| 114 | 'upstream_repos': ':ext:cvs.sourceforge.net:/cvsroot/collective', |
|---|
| 115 | 'upstream_revision': '2004-11-24 19:42:06 by ctheune'}} |
|---|
| 116 | |
|---|
| 117 | By convention, config files are named with the extension ".tailor", |
|---|
| 118 | but this is not enforced. |
|---|
| 119 | |
|---|
| 120 | In the example above, 'plone/atcontenttypes' is a directory where the |
|---|
| 121 | target source will be stored. The keys such 'module', 'source_kind', |
|---|
| 122 | etc correspond to options of the same name. |
|---|
| 123 | |
|---|
| 124 | When using a config file, tailor will perform its job on each project |
|---|
| 125 | contained in the dictionary. |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | Further help |
|---|
| 129 | ============ |
|---|
| 130 | |
|---|
| 131 | See the output of tailor.py -h for some further tips. There's also a |
|---|
| 132 | `wiki page`_ that may give you some other hints. |
|---|
| 133 | |
|---|
| 134 | .. _wiki page: |
|---|
| 135 | http://www.scannedinavian.org/DarcsWiki/ConvertingFromSubversion |
|---|
| 136 | |
|---|
| 137 | I will be more than happy to answer any doubt, question or suggestion |
|---|
| 138 | you may have on it. I'm usually hanging as "lelit" on the IRC channel |
|---|
| 139 | devoted to darcs on the `freenode.net` network. Do not hesitate to |
|---|
| 140 | contact me either by email or chatting there. |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | Author |
|---|
| 144 | ====== |
|---|
| 145 | |
|---|
| 146 | Lele Gaifax <lele@nautilus.homeip.net> |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | About this document |
|---|
| 150 | =================== |
|---|
| 151 | |
|---|
| 152 | This document and most of the internal documention use the |
|---|
| 153 | reStructuredText format so that it can be easily converted into other |
|---|
| 154 | formats, such as HTML. For more information about this, please see: |
|---|
| 155 | |
|---|
| 156 | http://docutils.sourceforge.net/rst.html |
|---|
| 157 | |
|---|
| 158 | |
|---|
| 159 | .. vim:ft=rest |
|---|
| 160 | .. Local Variables: |
|---|
| 161 | .. mode: rst |
|---|
| 162 | .. End: |
|---|