| [173] | 1 | About |
|---|
| 2 | ===== |
|---|
| [172] | 3 | |
|---|
| [261] | 4 | tailor.py is a tool to migrate changesets between CVS, Subversion, |
|---|
| [276] | 5 | darcs, monotone and Codeville repositories. |
|---|
| [173] | 6 | |
|---|
| [172] | 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 | |
|---|
| [180] | 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 | |
|---|
| [172] | 27 | |
|---|
| [173] | 28 | Installation |
|---|
| 29 | ============ |
|---|
| 30 | |
|---|
| [177] | 31 | tailor.py is written in Python, and thus Python must be installed on |
|---|
| [229] | 32 | your system to use it. It has been successfully used with Python 2.3 |
|---|
| 33 | and 2.4. |
|---|
| 34 | |
|---|
| 35 | Since it relays on external tools to do the real work such as `cvs`, |
|---|
| [261] | 36 | `darcs` and `svn`, they need to be installed as well, although only |
|---|
| 37 | those you will actually use. |
|---|
| [172] | 38 | |
|---|
| [174] | 39 | Make tailor.py executable:: |
|---|
| [172] | 40 | |
|---|
| 41 | $ chmod +x tailor.py |
|---|
| 42 | |
|---|
| 43 | You can either run tailor.py where it is currently located, or move it |
|---|
| 44 | along with the vcpx directory to a location in your PATH. |
|---|
| [261] | 45 | |
|---|
| 46 | There's even a standard setup.py that you may use to install the |
|---|
| 47 | script using Python conventional distutils. |
|---|
| [172] | 48 | |
|---|
| 49 | |
|---|
| [173] | 50 | Examples |
|---|
| 51 | ======== |
|---|
| [172] | 52 | |
|---|
| [185] | 53 | 1. Bootstrap a new tailored project, starting at upstream revision 10:: |
|---|
| [173] | 54 | |
|---|
| [286] | 55 | $ tailor.py -b -s svn -R http://svn.server/path/to/svnrepo \ |
|---|
| 56 | --module /Product/trunk -r 10 --subdir Product ~/darcs/MyProduct |
|---|
| [172] | 57 | |
|---|
| [177] | 58 | 2. 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:: |
|---|
| [173] | 61 | |
|---|
| [286] | 62 | $ tailor.py --source-kind cvs --target-kind svn --bootstrap \ |
|---|
| 63 | --repository :pserver:cvs.zope.org:/cvs-repository \ |
|---|
| 64 | --module CMF/CMFCore ~/svnwc/cmfcore |
|---|
| [212] | 65 | |
|---|
| [177] | 66 | 3. 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):: |
|---|
| [173] | 70 | |
|---|
| [286] | 71 | $ tailor.py -D -b -R :pserver:anonymous@cvs.zope.org:/cvs-repository/ \ |
|---|
| 72 | -m CMF/CMFTopic ~/darcs/cmftopic |
|---|
| [172] | 73 | |
|---|
| [177] | 74 | 4. Merge upstream changes since last update/bootstrap:: |
|---|
| [173] | 75 | |
|---|
| [286] | 76 | $ tailor.py ~/svnwc/MyProduct |
|---|
| [244] | 77 | |
|---|
| 78 | 5. Migrate a whole SVN repository, starting from the beginning:: |
|---|
| 79 | |
|---|
| [286] | 80 | $ tailor.py -b -s svn -R svn+ssh://caia/tmp/svn/repo --module / \ |
|---|
| 81 | --subdir testsvn --revision 1 testdir |
|---|
| [244] | 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. |
|---|
| [172] | 86 | |
|---|
| [274] | 87 | 6. Bootstrap from a CVS branch, starting from a given point in time:: |
|---|
| 88 | |
|---|
| [286] | 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 |
|---|
| [274] | 92 | |
|---|
| [198] | 93 | |
|---|
| 94 | Resolving conflicts |
|---|
| [196] | 95 | =================== |
|---|
| 96 | |
|---|
| [198] | 97 | Should one of the replayed changes generate any conflict, tailor.py |
|---|
| 98 | will prompt the user to correct them. This is done after the upstream |
|---|
| 99 | patch has been applied and before the final commit on the target |
|---|
| 100 | system, so that manually tweaking the conflict can produce a clean |
|---|
| 101 | patch. |
|---|
| [212] | 102 | |
|---|
| 103 | |
|---|
| 104 | Shortcomings |
|---|
| 105 | ============ |
|---|
| 106 | |
|---|
| 107 | Tailor currently suffers of the following reported problems: |
|---|
| 108 | |
|---|
| 109 | a) 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 | |
|---|
| [214] | 113 | b) 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... |
|---|
| [276] | 116 | |
|---|
| 117 | c) Monotone and Codeville are (currently) only supported as *target* |
|---|
| [212] | 118 | |
|---|
| 119 | This list will always be incomplete, but I'll do my best to keep it |
|---|
| 120 | short :-) |
|---|
| [214] | 121 | |
|---|
| 122 | .. _subprocess: http://www.lysator.liu.se/~astrand/popen5/ |
|---|
| [196] | 123 | |
|---|
| [172] | 124 | |
|---|
| [173] | 125 | Tailor's metadata |
|---|
| 126 | ================= |
|---|
| [172] | 127 | |
|---|
| [173] | 128 | To do its work, tailor needs some information about your source tree, |
|---|
| 129 | such as the upstream repository URL and the current revision of the |
|---|
| 130 | sources on your harddisk. |
|---|
| [172] | 131 | |
|---|
| [173] | 132 | In the simpler case, tailor keeps this information in a file called |
|---|
| 133 | `tailor.info`, one for each tailored project, that is a very simple |
|---|
| 134 | text document, with the following information, one per line: |
|---|
| [172] | 135 | |
|---|
| [173] | 136 | 1. Upstream repository kind (either "cvs", "darcs" or "svn) |
|---|
| 137 | 2. Target repository kind (the same as above) |
|---|
| 138 | 3. The name of the "module" that's been tailored |
|---|
| 139 | 4. The URL of the upstream repository (that may not be an URL, for cvs...) |
|---|
| 140 | 5. The current revision, from the upstream point of view, of the sources |
|---|
| [187] | 141 | 6. 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. |
|---|
| [172] | 144 | |
|---|
| [173] | 145 | This is everything tailor needs, to be able to keep going from where it |
|---|
| 146 | left last time. |
|---|
| 147 | |
|---|
| [177] | 148 | |
|---|
| [173] | 149 | Config file format |
|---|
| [177] | 150 | ------------------ |
|---|
| [173] | 151 | |
|---|
| 152 | When your project is composed by multiple upstream modules, it is |
|---|
| 153 | easier to collect such information in a single file. This is done by |
|---|
| 154 | specifying the `--configfile` option with a file name as argument. In |
|---|
| 155 | this case, tailor will read/write the above information from a |
|---|
| 156 | standard Python dictionary stored in the given file. |
|---|
| 157 | |
|---|
| 158 | The dictionary is keyed on the relative position of each project, and |
|---|
| 159 | each entry carries the same information described above. |
|---|
| 160 | |
|---|
| 161 | Here's an example config file entry:: |
|---|
| 162 | |
|---|
| [172] | 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', |
|---|
| [173] | 168 | 'upstream_revision': '2004-11-24 19:42:06 by ctheune'}} |
|---|
| [172] | 169 | |
|---|
| [174] | 170 | By convention, config files are named with the extension ".tailor", |
|---|
| 171 | but this is not enforced. |
|---|
| [172] | 172 | |
|---|
| [173] | 173 | In the example above, 'plone/atcontenttypes' is a directory where the |
|---|
| 174 | target source will be stored. The keys such 'module', 'source_kind', |
|---|
| 175 | etc correspond to options of the same name. |
|---|
| [172] | 176 | |
|---|
| [173] | 177 | When using a config file, tailor will perform its job on each project |
|---|
| 178 | contained in the dictionary. |
|---|
| [172] | 179 | |
|---|
| 180 | |
|---|
| [173] | 181 | Further help |
|---|
| 182 | ============ |
|---|
| [172] | 183 | |
|---|
| [177] | 184 | See the output of tailor.py -h for some further tips. There's also a |
|---|
| [288] | 185 | `wiki page`_ that may give you some other hints. The development of |
|---|
| 186 | Tailor is mainly driven by user requests at this point, and the |
|---|
| 187 | preferred comunication media is the dedicated `mailing list`_ [#]_. |
|---|
| [177] | 188 | |
|---|
| 189 | .. _wiki page: |
|---|
| [287] | 190 | http://www.darcs.net/DarcsWiki/Tailor |
|---|
| [177] | 191 | |
|---|
| [288] | 192 | .. _mailing list: |
|---|
| 193 | http://lists.zooko.com/mailman/listinfo/tailor |
|---|
| 194 | |
|---|
| [177] | 195 | I will be more than happy to answer any doubt, question or suggestion |
|---|
| 196 | you may have on it. I'm usually hanging as "lelit" on the IRC channel |
|---|
| 197 | devoted to darcs on the `freenode.net` network. Do not hesitate to |
|---|
| 198 | contact me either by email or chatting there. |
|---|
| [288] | 199 | |
|---|
| 200 | .. [#] I wish to say a big `Thank you` to Zooko, for hosting the ML |
|---|
| 201 | and for supporting Tailor in several ways, from suggestions to |
|---|
| 202 | bug reporting and fixing. |
|---|
| [173] | 203 | |
|---|
| 204 | |
|---|
| 205 | Author |
|---|
| 206 | ====== |
|---|
| 207 | |
|---|
| [172] | 208 | Lele Gaifax <lele@nautilus.homeip.net> |
|---|
| [261] | 209 | |
|---|
| 210 | |
|---|
| 211 | Monotone support |
|---|
| 212 | ---------------- |
|---|
| 213 | |
|---|
| 214 | Monotone_ support was kindly contributed by `Markus Schiltknecht |
|---|
| 215 | <markus@bluegap.ch>`. Since I'm not currently using monotone (so |
|---|
| 216 | little time, so many VCSs...) I'm not in position to test it out |
|---|
| 217 | properly, but I'll do my best to keep it in sync, maybe with your |
|---|
| 218 | support :-) |
|---|
| 219 | |
|---|
| 220 | .. _monotone: http://www.venge.net/monotone/ |
|---|
| [305] | 221 | |
|---|
| 222 | |
|---|
| 223 | License |
|---|
| 224 | ======= |
|---|
| 225 | |
|---|
| 226 | Tailor is distribuited under the `GNU General Public License`__. |
|---|
| 227 | |
|---|
| 228 | __ http://www.fsf.org/licensing/licenses/gpl.html |
|---|
| [177] | 229 | |
|---|
| [172] | 230 | |
|---|
| [176] | 231 | About this document |
|---|
| 232 | =================== |
|---|
| [177] | 233 | |
|---|
| 234 | This document and most of the internal documention use the |
|---|
| 235 | reStructuredText format so that it can be easily converted into other |
|---|
| 236 | formats, such as HTML. For more information about this, please see: |
|---|
| [172] | 237 | |
|---|
| [177] | 238 | http://docutils.sourceforge.net/rst.html |
|---|
| [176] | 239 | |
|---|
| 240 | |
|---|
| 241 | .. vim:ft=rest |
|---|
| [174] | 242 | .. Local Variables: |
|---|
| 243 | .. mode: rst |
|---|
| 244 | .. End: |
|---|