| 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 | |
|---|
| 12 | Installation |
|---|
| 13 | ============ |
|---|
| 14 | |
|---|
| 15 | tailor.py is written in Python, and thus Python must be installed on your |
|---|
| 16 | system to use it. |
|---|
| 17 | |
|---|
| 18 | Make tailor.py executable:: |
|---|
| 19 | |
|---|
| 20 | $ chmod +x tailor.py |
|---|
| 21 | |
|---|
| 22 | You can either run tailor.py where it is currently located, or move it |
|---|
| 23 | along with the vcpx directory to a location in your PATH. |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | Examples |
|---|
| 27 | ======== |
|---|
| 28 | |
|---|
| 29 | Bootstrap a new taylored project, starting at upstream revision 10:: |
|---|
| 30 | |
|---|
| 31 | $ tailor.py -b -s svn -R http://svn.server/Product -r 10 ~/darcs/MyProduct |
|---|
| 32 | |
|---|
| 33 | Bootstrap a new product, fetching from CVS and storing under SVN: this |
|---|
| 34 | will create the directory "~/svnwc/cmfcore"; "~/svnwc" must be already |
|---|
| 35 | under SVN:: |
|---|
| 36 | |
|---|
| 37 | $ tailor.py --source-kind cvs --target-kind svn --bootstrap \ |
|---|
| 38 | --repository :pserver:cvs.zope.org:/cvs-repository \ |
|---|
| 39 | --module CMF/CMFCore ~/svnwc/cmfcore |
|---|
| 40 | |
|---|
| 41 | Showing each command bootstrap a new DARCS repos in "~/darcs/cmftopic" |
|---|
| 42 | under which the upstream module will be extracted as "CMFTopic" (ie, the |
|---|
| 43 | last component of the module name):: |
|---|
| 44 | |
|---|
| 45 | $ tailor.py -D -b -R :pserver:anonymous@cvs.zope.org:/cvs-repository/ \ |
|---|
| 46 | -m CMF/CMFTopic ~/darcs/cmftopic |
|---|
| 47 | |
|---|
| 48 | Merge upstream changes since last update/bootstrap:: |
|---|
| 49 | |
|---|
| 50 | $ tailor.py ~/svnwc/MyProduct |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | Tailor's metadata |
|---|
| 54 | ================= |
|---|
| 55 | |
|---|
| 56 | To do its work, tailor needs some information about your source tree, |
|---|
| 57 | such as the upstream repository URL and the current revision of the |
|---|
| 58 | sources on your harddisk. |
|---|
| 59 | |
|---|
| 60 | In the simpler case, tailor keeps this information in a file called |
|---|
| 61 | `tailor.info`, one for each tailored project, that is a very simple |
|---|
| 62 | text document, with the following information, one per line: |
|---|
| 63 | |
|---|
| 64 | 1. Upstream repository kind (either "cvs", "darcs" or "svn) |
|---|
| 65 | 2. Target repository kind (the same as above) |
|---|
| 66 | 3. The name of the "module" that's been tailored |
|---|
| 67 | 4. The URL of the upstream repository (that may not be an URL, for cvs...) |
|---|
| 68 | 5. The current revision, from the upstream point of view, of the sources |
|---|
| 69 | |
|---|
| 70 | This is everything tailor needs, to be able to keep going from where it |
|---|
| 71 | left last time. |
|---|
| 72 | |
|---|
| 73 | Config file format |
|---|
| 74 | ------------------ |
|---|
| 75 | |
|---|
| 76 | When your project is composed by multiple upstream modules, it is |
|---|
| 77 | easier to collect such information in a single file. This is done by |
|---|
| 78 | specifying the `--configfile` option with a file name as argument. In |
|---|
| 79 | this case, tailor will read/write the above information from a |
|---|
| 80 | standard Python dictionary stored in the given file. |
|---|
| 81 | |
|---|
| 82 | The dictionary is keyed on the relative position of each project, and |
|---|
| 83 | each entry carries the same information described above. |
|---|
| 84 | |
|---|
| 85 | Here's an example config file entry:: |
|---|
| 86 | |
|---|
| 87 | {'plone/atcontenttypes': {'module': 'ATContentTypes', |
|---|
| 88 | 'source_kind': 'cvs', |
|---|
| 89 | 'subdir': 'ATContentTypes', |
|---|
| 90 | 'target_kind': 'darcs', |
|---|
| 91 | 'upstream_repos': ':ext:cvs.sourceforge.net:/cvsroot/collective', |
|---|
| 92 | 'upstream_revision': '2004-11-24 19:42:06 by ctheune'}} |
|---|
| 93 | |
|---|
| 94 | By convention, config files are named with the extension ".tailor", |
|---|
| 95 | but this is not enforced. |
|---|
| 96 | |
|---|
| 97 | In the example above, 'plone/atcontenttypes' is a directory where the |
|---|
| 98 | target source will be stored. The keys such 'module', 'source_kind', |
|---|
| 99 | etc correspond to options of the same name. |
|---|
| 100 | |
|---|
| 101 | When using a config file, tailor will perform its job on each project |
|---|
| 102 | contained in the dictionary. |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | Further help |
|---|
| 106 | ============ |
|---|
| 107 | |
|---|
| 108 | See the output of tailor.py -h for some further tips. I will be more |
|---|
| 109 | than happy to answer any doubt, question or suggestion you may have on |
|---|
| 110 | it. I'm usually hanging as "lelit" on the IRC channel devoted to darcs |
|---|
| 111 | on the freenode.net network. Do not hesitate to contact me either by |
|---|
| 112 | email or chatting there. |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | Author |
|---|
| 116 | ====== |
|---|
| 117 | |
|---|
| 118 | Lele Gaifax <lele@nautilus.homeip.net> |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | .. Local Variables: |
|---|
| 122 | .. mode: rst |
|---|
| 123 | .. End: |
|---|