Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > f8f827002023191ece30ceb268cd0169 > files > 164

cvs2svn-2.3.0-1mdv2010.0.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css"> /* <![CDATA[ */
  @import "tigris-branding/css/tigris.css";
  @import "tigris-branding/css/inst.css";
  /* ]]> */</style>
<link rel="stylesheet" type="text/css" media="print"
  href="tigris-branding/css/print.css"/>
<script type="text/javascript" src="tigris-branding/scripts/tigris.js"></script>
<title>cvs2svn Documentation</title>
</head>

<body id="bodycol">
<div class="app">

<h1>cvs2svn Documentation</h1>

<h2>Index</h2>

<ul>

  <li><a href="#intro">Introduction</a></li>

  <li><a href="#reqs">Requirements</a></li>

  <li><a href="#install">Installation</a></li>

  <li><a href="#convert">Deciding how much to convert</a></li>

  <li><a href="#prep">Prepping your repository</a></li>

  <li><a href="#cmd-vs-options">Command line vs. options file</a></li>

  <li><a href="#symbols">Symbol handling</a></li>

  <li><a href="#cmd-ref">Command line reference</a></li>

  <li><a href="#examples">A few examples</a></li>

</ul>

<hr />

<h1><a name="intro">Introduction</a></h1>

<p>cvs2svn is a program that can be used to migrate a CVS repository
to <a href="http://subversion.tigris.org/">Subversion</a> (otherwise
known as "SVN") or <a href="http://git.or.cz/">git</a>.
Documentation:</p>

<ul>

  <li>The <a href="features.html">list of cvs2svn features</a>
  explains briefly why converting a repository from CVS is nontrivial
  and gives a comprehensive list of cvs2svn's many features.</li>

  <li>The document you are currently reading contains a lot of general
  information about converting from CVS, and specifically how to use
  cvs2svn to convert your repository to Subversion.</li>

  <li><a href="cvs2git.html">cvs2git.html</a> describes how to use
  cvs2svn to convert your CVS repository to git.</li>

  <li>The <a href="faq.html">FAQ</a> provides frequently asked
  questions and answers, including important topics such as how to <a
  href="faq.html#onetoone">convert multiple project</a> within a
  single repository, how to <a href="faq.html#eol-fixup">fix problems
  with end-of-line translation</a>, how to <a
  href="faq.html#gettinghelp">get more help</a> and how to <a
  href="faq.html#reportingbugs">report bugs</a> including a <a
  href="faq.html#testcase">useful test case</a>.</li>

</ul>


<hr />

<h1><a name="reqs">Requirements</a></h1>

<p>cvs2svn requires the following:</p>

<ul>

  <li>Direct (filesystem) access to a copy of the CVS repository that
    you want to convert.  cvs2svn parses the files in the CVS
    repository directly, so it is not enough to have remote CVS
    access.  See the <a href="faq.html#repoaccess">FAQ</a> for more
    information and a possible workaround.
  </li>
  <li>Python 2, version 2.4 or later.  See <a
    href="http://www.python.org/">http://www.python.org/</a>.
    (cvs2svn does <strong>not</strong> work with Python 3.x.)
  </li>
  <li>A compatible database library, usually gdbm, and the
    corresponding Python bindings.  Neither dumbdbm nor standard dbm
    is sufficient.
  </li>
  <li>If you use the <tt>--use-rcs</tt> option, then RCS's `co'
    program is required.  The RCS home page is
    <a href="http://www.cs.purdue.edu/homes/trinkle/RCS/"
            >http://www.cs.purdue.edu/homes/trinkle/RCS/</a>.
    See the <a href="#use-rcs"><tt>--use-rcs</tt> flag</a> for more
    details.
  </li>
  <li>If you use the <tt>--use-cvs</tt> option, then the `cvs' command
    is required.  The CVS home page is
    <a href="http://ccvs.cvshome.org/">http://ccvs.cvshome.org/</a>.
    See the <a href="#use-cvs"><tt>--use-cvs</tt> flag</a> for more
    details.
  </li>
  <li>GNU sort, which is part of the coreutils package, see <a
    href="http://www.gnu.org/software/coreutils/"
         >http://www.gnu.org/software/coreutils/</a>.  Binaries for
    Win32 can be found at <a href="http://unxutils.sourceforge.net/"
                                  >http://unxutils.sourceforge.net/</a>.
    Windows <tt>sort.exe</tt> is <b>not</b> adequate.
  </li>

</ul>

<h2>CVSNT repositories</h2>

<p>cvs2svn does not support conversion of <a
href="http://www.cvsnt.org/">CVSNT</a> repositories.  Some people have
indicated success with such conversions, while others have had
problems.  In other words, <em>such conversions, even if apparently
successful, should be checked carefully before use.</em> See the <a
href="faq.html#cvsnt">FAQ</a> for more information.</p>

<hr />

<h1><a name="install">Installation</a></h1>

<ul>
  <li>As root, run 'make install'.</li>

  <li>Or, if you do not wish to install cvs2svn on your system, you
    can simply run it out of this directory.  As long as it can find
    the 'cvs2svn_rcsparse' library, it should be happy.</li>

  <li>If you want to create Unix-style manpages for the main programs,
    run 'make man'.</li>

</ul>

<hr />

<h1><a name="convert">Deciding how much to convert</a></h1>

<p>If you're looking to switch an existing CVS repository to
Subversion, you have a number of choices for migrating your existing
CVS data to a Subversion repository, depending on your needs.</p>

<p>There are a few basic routes to choose when switching from CVS to
Subversion, and the one you choose will depend on how much historical
data you want in your Subversion repository.  You may be content to
refer to your existing (soon-to-be-converted-to-read-only) CVS
repository for "pre-Subversion" data and start working with a new
Subversion repository.  Maybe you prefer to squeeze every last drop of
data out of your CVS repository into your Subversion repository.  Then
again, perhaps you want a conversion somewhere in between these two.
Based on these needs, we've come up with these different recommended
paths for converting your CVS repository to a Subversion
repository.</p>

<ul>

  <li>Top-skim (Doesn't require cvs2svn!)</li>

  <li>Trunk only</li>

  <li>Pick and choose</li>

  <li>Full conversion</li>

  <li>Smorgasbord</li>

  <li>One project at a time</li>

</ul>

<p>If you decide that top-skimming doesn't meet your needs and you're
going to use cvs2svn (yay!), then be sure to read the section below on
<a href="#prep">prepping your repository</a> before you start your
conversion.</p>


<h2>Top-skimming</h2>

<p>This is the quickest and easiest way to get started in your new
repository.  You're basically going to export the latest revision of
your cvs repository, possibly do some rearranging, and then import the
resulting files into your Subversion repository.  Typically, if you
top-skim, that means you'll be either be keeping your old CVS
repository around as a read-only reference for older data or just
tossing that historical data outright (Note to you data packrats who
have just stopped breathing, please take a deep breath and put down
the letter opener.  You don't <i>have</i> to do this yourself--it's
just that some people don't feel the same way you do about historical
data.  They're really not <i>bad</i> people.  Really.).</p>

<blockquote>

  <p><b>Pros:</b> Quick, easy, convenient, results in a very compact and
  "neat" Subversion repository.</p>

  <p><b>Cons:</b> You've got no historical data, no branches, and no tags
  in your Subversion repository.  If you want any of this data, you'll
  have to go back into the CVS Repository and get it.</p>

</blockquote>


<h2>Trunk only</h2>

<p>If you decide that you'd like to have the main development line of
your historical data in your Subversion repository but don't need to
carry over the tags and branches, you may want to skip converting your
CVS tags and branches entirely and only convert the "trunk" of your
repository.  To do this, you'll use the <tt>--trunk-only</tt> switch
to cvs2svn.</p>

<blockquote>

  <p><b>Pros:</b>Saves disk space in your new Subversion repository.
  Attractive to neatniks.</p>

  <p><b>Cons:</b> You've got no branches and no tags in your
  Subversion repository.</p>

</blockquote>


<h2>Pick and choose</h2>

<p>Let's say, for example, that you want to convert your CVS repository's
historical data but you have no use for the myriad daily build tags
that you've got in your CVS repository.  In addition to that, you want
some branches but would prefer to ignore others.  In this case, you'll
want to use the <tt>--exclude</tt> switch to instruct cvs2svn which
branches and tags it should ignore. </p>

<blockquote>

  <p><b>Pros:</b>You only get what you want from your CVS repository.
  Saves a some space.</p>

  <p><b>Cons:</b>If you forgot something, you'll have to go to your
  CVS repository.</p>

</blockquote>


<h2>Full conversion</h2>

<p>If you want to convert your entire CVS repository, including all
tags and branches, you want a full conversion.  This is cvs2svn's
default behavior.</p>

<blockquote>

  <p><b>Pros:</b> Converts every last byte of your CVS repository.</p>

  <p><b>Cons:</b> Requires more disk space.</p>

</blockquote>


<h2>Smorgasbord</h2>

<p>You can convert your repository (or repositories) piece by piece
using a combination of the above .</p>

<blockquote>

  <p><b>Pros:</b> You get exactly what you want.</p>

  <p><b>Cons:</b> Importing converted repositories multiple times into
  a single Subversion repository will likely break date-based range
  commands (e.g. <tt>svn diff -r {2002-02-17:2002-03-18}</tt>) since
  Subversion does a binary search through the repository for dates.
  While this is not the end of the world, it can be a minor
  inconvenience.</p>

</blockquote>


<h2>One project at a time</h2>

<p>If you have many diverse projects in your CVS repository and you
don't want to move them all to Subversion at once, you may want to
convert to Subversion one project at a time.  This requires a few
extra steps, but it can make the conversion of a large CVS repository
much more manageable.  See <a href="faq.html#oneatatime">How can I
convert my CVS repository one module at a time?</a> on the cvs2svn FAQ
for a detailed example on converting your CVS repository one project
at a time.</p>

<blockquote>

  <p><b>Pros:</b>Allows multiple projects in a single repository to
  convert to Subversion according to a schedule that works best for
  them.</p>

  <p><b>Cons:</b>Requires some extra steps to accomplish the
  conversion.  Importing converted repositories multiple times into a
  single Subversion repository will likely break date-based range
  commands (e.g. <tt>svn diff -r {2002-02-17:2002-03-18}</tt>) since
  Subversion does a binary search through the repository for dates.
  While this is not the end of the world, it can be a minor
  inconvenience.</p>

</blockquote>

<hr />

<h1><a name="prep">Prepping your repository</a></h1>

<p>There are a number of reasons that you may need to prep your CVS
Repository.  If you decide that you need to change part of your CVS
repository, we <b>strongly</b> recommend working on a <b>copy</b> of
it instead of working on the real thing.  cvs2svn itself does not make
any changes to your CVS repository, but if you start moving things
around and deleting things in a CVS repository, it's all too easy to
shoot yourself in the foot.</p>

<h2>End-of-line translation</h2>

<p>One of the most important topics to consider when converting a
repository is the distinction between binary and text files.  If you
accidentally treat a binary file as text <strong>your repository
contents will be corrupted</strong>.</p>

<p>Text files are handled differently than binary files by both CVS
and Subversion.  When a text file is checked out, the character used
to denote the end of line ("EOL") is converted to the local computer's
format.  This is usually the most convenient behavior for text files.
Moreover, both CVS and Subversion allow "keywords" in text files (such
as <tt>$Id$</tt>), which are expanded with version control information
when the file is checked out.  However, if line-end translation or
keyword expansion is applied to a binary file, the file will usually
be corrupted.</p>

<p>CVS treats a file as text unless you specifically tell it that the
file is binary.  You can tell CVS that a file is binary by using the
command <tt>cvs admin -kb <i>filename</i></tt>.  But often CVS users
forget to specify which files are binary, and as long as the
repository is only used under Unix, they may never notice a problem,
because the internal format of CVS is the same as the Unix format.
But Subversion is not as forgiving as CVS if you tell it to treat a
binary file as text.</p>

<p>If you have been conscientious about marking files as binary in
CVS, then you should be able to use <tt>--default-eol=native</tt>.  If
you have been sloppy, then you have a few choices:</p>
<ul>
  <li>Convert your repository with cvs2svn's default options.  Your
    text files will be treated as binary, but that usually isn't very
    harmful (at least no information will be lost).</li>

  <li>Mend your slovenly ways by fixing your CVS repository
    <em>before</em> conversion: run <tt>cvs admin -kb
    <i>filename</i></tt> for each binary file in the repository.  Then
    you can use <tt>--default-eol=native</tt> along with the
    anal-retentive folks.</li>

  <li>Use cvs2svn options to help cvs2svn deduce which files are
    binary <em>during</em> the conversion.  The useful options are
    <tt>--eol-from-mime-type</tt>, <tt>--keywords-off</tt>,
    <tt>--auto-props</tt>, and <tt>--default-eol</tt>.  See the <a
    href="faq.html#eol-fixup">FAQ</a> for more information.</li>

</ul>

<h2>Converting part of repository</h2>

<p>If you want to convert a subdirectory in your repository, you can
just point cvs2svn at the subdirectory and go.  There is no need to
delete the unwanted directories from the CVS repository.</p>

<p>If the subdirectory that you are converting contains any files that
you <i>don't</i> want converted into your new Subversion repository,
you should delete them or move them aside.  Such files can be deleted
from HEAD after the conversion, but they will still be visible in the
repository history.</p>

<p>Lastly, even though you can move and copy files and directories
around in Subversion, you may want to do some rearranging of project
directories before running your conversion to get the desired
repository project organization.</p>

<hr />

<h1><a name="cmd-vs-options">Command line vs. options file</a></h1>

<p>There are two ways to specify the options that define a conversion:
via the cvs2svn command line, or via an options file.  The command
line is useful for simple conversions, but the options file method is
recommended for nontrivial conversions as it gives the user more
flexibility.</p>

<h2><a name="cmd-line-method">Command line method</a></h2>

<p>A command-line conversion allows the use of all of the command line
options listed <a href="#cmd-ref">below</a> (except for
<tt>--options</tt>).  This method allows almost all of the built-in
conversion options to be selected, with the primary limitation that it
does not support multiproject conversions.  However, it may require a
<em>long</em> command line to specify all of the options for a
complicated conversion.</p>


<h2><a name="options-file-method">Options file method</a></h2>

<p>The options file method allows full control of the conversion
process, including multiproject conversions.  It also allows expert
users to customize the conversion even more radically by writing
Python code.  Finally, the options file used in the conversion can be
retained as permanent record of the options used in a conversion.</p>

<p>To use the options file method, you need to create a file defining
all of the options that are to be used for the conversion.  A
heavily-commented sample options file,
<tt>cvs2svn-example.options</tt>, is included in the cvs2svn
distribution.  The easiest way to create your own options file is to
make a copy of the sample file and modify it as directed by the
comments in that file.</p>

<p><strong>Note:</strong> The options file format changes frequently.
Please be sure to base your options file on the
<tt>cvs2svn-example.options</tt> file from the version of cvs2svn that
you plan to use.</p>

<p>To start a conversion using an options file, invoke cvs2svn like
this:</p>

<pre>
   $ cvs2svn --options=OPTIONSFILE
</pre>

<p>Only the following options are allowed in combination with
<tt>--options</tt>: <tt>-h/--help</tt>, <tt>--help-passes</tt>,
<tt>--version</tt>, <tt>-v/--verbose</tt>, <tt>-q/--quiet</tt>,
<tt>-p/--pass/--passes</tt>, <tt>--dry-run</tt>, and
<tt>--profile</tt>.</p>

<hr />


<h1><a name="symbols">Symbol handling</a></h1>

<p>cvs2svn converts CVS tags and branches into Subversion tags and
branches.  This section discusses issues related to symbol
handling.</p>

<p><strong>HINT:</strong> If there are problems with symbol usage in
your repository, they are usually reported during
<tt>CollateSymbolsPass</tt> of the conversion, causing the conversion
to be interrupted.  However, it is not necessary to restart the whole
conversion to fix the problems.  Usually it is adequate to adjust the
symbol-handling options then re-start cvs2svn starting at
<tt>CollateSymbolsPass</tt>, by adding the option "<tt>-p
CollateSymbolsPass:</tt>".  This trick can save a lot of time if you
have a large repository, as it might take a few iterations before you
find the best set of options to convert your repository.</p>


<h2><a name="symbol-layout">Placement of trunk, branches, and tags
directories</a></h2>

<p>cvs2svn converts CVS branches and tags into Subversion branches and
tags following the <a
href="http://svnbook.red-bean.com/en/1.2/svn.branchmerge.maint.html#svn.branchmerge.maint.layout">standard
Subversion convention</a>.  For single-project conversions, the
default is to put the trunk, branches, and tags directories at the top
level of the repository tree, though this behavior can be changed by
using the <tt>--trunk</tt>, <tt>--branches</tt>, and <tt>--tags</tt>
options.  For multiproject conversions, you must specify the location
of each project's trunk, branches, and tags directory in the options
file; <a
href="http://svnbook.red-bean.com/en/1.4/svn.branchmerge.maint.html#svn.branchmerge.maint.layout">repository
layout strategies</a> are discussed in the <a
href="http://svnbook.red-bean.com/">Subversion book</a>.  For even
finer control over the conversion, you can use a
<tt>--symbol-hints</tt> file to specify the SVN path to be used for
each CVS tag and branch.</p>


<h2><a name="symbol-exclusion">Excluding tags and branches</a></h2>

<p>Often a CVS repository contains tags and branches that will not be
needed after the conversion to Subversion.  You can instruct cvs2svn
to exclude such symbols from the conversion, in which case they will
not be present in the resulting Subversion repository.  Please be
careful when doing this; excluding symbols causes information that was
present in CVS to be omitted in Subversion, thereby discarding
potentially useful historical information.  Also be aware that if you
exclude a branch, then all CVS revisions that were committed to that
branch will also be excluded.</p>

<p>To exclude a tag or branch, use the option
<tt>--exclude=SYMBOL</tt>.  You can also exclude a whole group of
symbols matching a specified regular expression; for example,
<tt>--exclude='RELEASE_0_.*'</tt>.  (The regular expression has to
match the <em>whole</em> symbol name for the rule to apply.)</p>

<p>However, please note the following restriction.  If a branch has a
subbranch or a tag on it, then the branch cannot be excluded unless
the dependent symbol is also excluded.  cvs2svn checks for this
situation; if it occurs then <tt>CollateSymbolsPass</tt> outputs an
error message like the following:</p>

<pre>
   ERROR: The branch 'BRANCH' cannot be excluded because the following symbols depend on it:
       'TAG'
       'SUBBRANCH'
</pre>

<p>In such a case you can either exclude the dependent symbol(s) (in
this case by using <tt>--exclude=TAG --exclude=SUBBRANCH</tt>) or
<em>not</em> exclude 'BRANCH'.</p>

<h3>Excluding vendor branches</h3>

<p>There is one more special case related to branch handling.  A <a
href="http://cvsbook.red-bean.com/cvsbook.html#Tracking%20Third-Party%20Sources%20(Vendor%20Branches)">vendor
branch</a> is a CVS branch that is used to track source code received
from an outside source.  A vendor branch typically has CVS branch
number <tt>1.1.1</tt> and revision numbers <tt>1.1.1.1</tt>,
<tt>1.1.1.2</tt>, etc.  Vendor branches are created automatically
whenever the <tt>cvs import</tt> command is used.  Vendor branches
have the strange property that, under certain circumstances, a file
that appears on a vendor branch also implicitly exists on trunk.
cvs2svn knows all about vendor branches and does its best to ensure
that a file that appears on a vendor branch is also copied to trunk,
to give Subversion behavior that is as close as possible to the CVS
behavior.</p>

<p>However, often vendor branches exist for reasons unrelated to
tracking outside sources.  Indeed, some CVS documentation recommends
using the <tt>cvs import</tt> command to import your own code into
your CVS repository (which is arguably a misuse of the <tt>cvs
import</tt> command).  Vendor branches created by this practice are
useless and would only serve to clutter up your Subversion repository.
Therefore, cvs2svn allows vendor branches to be excluded, in which
case the vendor branch revisions are grafted onto the history of
trunk.  This is allowed <em>even if</em> other branches or tags appear
to sprout from the vendor branch, in which case the dependent tags are
grafted to trunk as well.  Such branches can be recognized in the
<tt>--write-symbol-info</tt> by looking for a symbol that is a "pure
import" in the same number of files that it appears as a branch.  It
is typically advantageous to exclude such branches.</p>


<h2><a name="symbol-inconsistencies">Tag/branch inconsistencies</a></h2>

<p>In CVS, the same symbol can appear as a tag in some files (e.g.,
<tt>cvs tag SYMBOL file1.txt</tt>) and a branch in others (e.g.,
<tt>cvs tag -b SYMBOL file2.txt</tt>).  Subversion takes a more global
view of your repository, and therefore works better when each symbol
is used in a self-consistent way--either always as a branch or always
as a tag.  cvs2svn provides features to help you resolve these
ambiguities.</p>

<p>If your repository contains inconsistently-used symbols, then
<tt>CollateSymbolsPass</tt>, by default, uses heuristics to decide
which symbols to convert as branches and which as tags.  Often this
behavior will be adequate, and you don't have to do anything special.
You can use the <tt>--symbol-info=<i>filename</i></tt> option to cause
cvs2svn to list all of the symbols in your repository and how it chose
to convert them to <tt><i>filename</i></tt>.</p>

<p>However, if you want to take finer control over how symbols are
converted, you can do so.  The first step is probably to change the
default symbol handling style from <tt>heuristic</tt> (the default
value) to <tt>strict</tt> using the option
<tt>--symbol-default=strict</tt>.  With the <tt>strict</tt> setting,
cvs2svn prints error messages and aborts the conversion if there are
any ambiguous symbols.  The error messages look like this:</p>

<pre>
   ERROR: It is not clear how the following symbols should be converted.
   Use --symbol-hints, --force-tag, --force-branch, --exclude, and/or
   --symbol-default to resolve the ambiguity.
       'SYMBOL1' is a tag in 1 files, a branch in 2 files and has commits in 0 files
       'SYMBOL2' is a tag in 2 files, a branch in 1 files and has commits in 0 files
       'SYMBOL3' is a tag in 1 files, a branch in 2 files and has commits in 1 files
</pre>

<p>You have to tell cvs2svn how to fix the inconsistencies then
restart the conversion at <tt>CollateSymbolsPass</tt>.</p>

<p>There are three ways to deal with an inconsistent symbol: treat it
as a tag, treat it as a branch, or exclude it from the conversion
altogether.</p>

<p>In the example above, the symbol 'SYMBOL1' was used as a branch in
two files but used as a tag in only one file.  Therefore, it might
make sense to convert it as a branch, by using the option
<tt>--force-branch=SYMBOL1</tt>.  However, no revisions were committed
on this branch, so it would also be possible to convert it as a tag,
by using the option <tt>--force-tag=SYMBOL1</tt>.  If the symbol is
not needed at all, it can be excluded by using
<tt>--exclude=SYMBOL1</tt>.</p>

<p>Similarly, 'SYMBOL2' was used more often as a tag, but can still be
converted as a branch or a tag, or excluded.</p>

<p><tt>SYMBOL3</tt>, on the other hand, was sometimes used as a
branch, and at least one revision was committed on the branch.  It can
be converted as a branch, using <tt>--force-branch=SYMBOL3</tt>.  But
it cannot be converted as a tag (because tags are not allowed to have
revisions on them).  If it is excluded, using
<tt>--exclude=SYMBOL3</tt>, then both the branch and the revisions on
the branch will be left out of the Subversion repository.</p>

<p>If you are not so picky about which symbols are converted as tags
and which as branches, you can ask cvs2svn to decide by itself.  To do
this, specify the <tt>--symbol-default=OPTION</tt>, where
<tt>OPTION</tt> can be either "<tt>heuristic</tt>" (the default;
decide how to treat each ambiguous symbol based on whether it was used
more often as a branch or as a tag in CVS), "<tt>branch</tt>" (treat
every ambiguous symbol as a branch), or "<tt>tag</tt>" (treat every
ambiguous symbol as a tag).  You can use the <tt>--force-branch</tt>
and <tt>--force-tag</tt> options to specify the treatment of
particular symbols, in combination with <tt>--symbol-default</tt> to
specify the default to be used for other ambiguous symbols.</p>

<p>Finally, you can have cvs2svn write a text file showing how each
symbol was converted by using the <tt>--show-symbol-info</tt> option.
If you disagree with any of cvs2svn's choices, you can make a copy of
this file, edit it, then pass it to cvs2svn by using the
<tt>--symbol-hints</tt> option.  In this manner you can influence how
each symbol is converted and also the parent line of development of
each symbol (the line of development from which the symbol
sprouts).</p>

<hr />


<h1><a name="cmd-ref">Command line reference</a></h1>

<table border="1" cellpadding="10" cellspacing="3" width="80%">

  <tr>
    <td colspan="2">
      <strong>USAGE:</strong><br/>
      <tt>cvs2svn [OPTIONS]... [-s SVN-REPOS-PATH|--dumpfile=PATH|--dry-run]
      CVS-REPOS-PATH</tt><br/>
      <tt>cvs2svn [OPTIONS]... --options=PATH</tt><br/>
    </td>
  </tr>

  <tr>
    <td align="right"><tt>CVS-REPOS-PATH</tt></td>
    <td>The filesystem path of the part of the CVS repository that you
      want to convert.  It is not possible to convert a CVS repository
      to which you only have remote access; see <a
      href="faq.html#repoaccess">the FAQ</a> for details.  This
      doesn't have to be the top level directory of a CVS repository;
      it can point at a project within a repository, in which case
      only that project will be converted.  This path or one of its
      parent directories has to contain a subdirectory called CVSROOT
      (though the CVSROOT directory can be empty).</td>
  </tr>

  <tr>
    <th colspan="2">
      Configuration via options file
    </th>
  </tr>

  <tr>
    <td align="right"><tt>--options=PATH</tt></td>
    <td>Read the conversion options from the specified file.  See
      section <a href="#options-file-method">options file method</a>
      for more information.</td>
  </tr>

  <tr>
    <th colspan="2">
      Output options
    </th>
  </tr>

  <tr>
    <td align="right"><tt>-s PATH</tt><br/><tt>--svnrepos PATH</tt></td>
    <td>Write the output of the conversion into a Subversion
      repository located at PATH.  This option causes a new Subversion
      repository to be created at PATH unless the
      <tt>--existing-svnrepos</tt> option is also used.</td>
  </tr>

  <tr>
    <td align="right"><tt>--existing-svnrepos</tt></td>
    <td>Load the converted CVS repository into an existing Subversion
      repository, instead of creating a new repository.  (This option
      should be used in combination with
      <tt>-s</tt>/<tt>--svnrepos</tt>.)  The repository must either be
      empty or contain no paths that overlap with those that will
      result from the conversion.  Please note that you need write
      permission for the repository files.</td>
  </tr>

  <tr>
    <td align="right"><tt>--fs-type=TYPE</tt></td>
    <td>Pass the <tt>--fs-type=TYPE</tt> option to "svnadmin
      create" if creating a new Subversion repository.</td>
  </tr>

  <tr>
    <td align="right"><tt>--bdb-txn-nosync</tt></td>
    <td>Pass the <tt>--bdb-txn-nosync</tt> switch to "svnadmin
      create" if creating a new Subversion repository.</td>
  </tr>

  <tr>
    <td align="right"><tt>--create-option=OPT</tt></td>
    <td>Pass OPT to "svnadmin create" if creating a new Subversion
      repository (can be specified multiple times to pass multiple
      options).</td>
  </tr>

  <tr>
    <td align="right"><tt>--dumpfile=PATH</tt></td>
    <td>Output the converted CVS repository into a Subversion dumpfile
      instead of a Subversion repository (useful for importing a CVS
      repository into an existing Subversion repository).  PATH is the
      filename in which to store the dumpfile.</td>
  </tr>

  <tr>
    <td align="right"><tt>--dry-run</tt></td>
    <td>Do not create a repository or a dumpfile; just print the details
      of what cvs2svn would do if it were really converting your
      repository.</td>
  </tr>

  <tr>
    <th colspan="2">
      Conversion options
    </th>
  </tr>

  <tr>
    <td align="right"><tt>--trunk-only</tt></td>
    <td>Convert only the main line of development from the CVS
      repository (commonly referred to in Subversion parlance as
      "trunk"), ignoring all tags and branches.</td>
  </tr>

  <tr>
    <td align="right"><tt>--trunk=PATH</tt></td>
    <td>The top-level path to use for trunk in the Subversion
      repository.  The default value is "trunk".</td>
  </tr>

  <tr>
    <td align="right"><tt>--branches=PATH</tt></td>
    <td>The top-level path to use for branches in the Subversion
      repository.  The default value is "branches".</td>
  </tr>

  <tr>
    <td align="right"><tt>--tags=PATH</tt></td>
    <td>The top-level path to use for tags in the Subversion
      repository.  The default value is "tags".</td>
  </tr>

  <tr>
    <td align="right"><tt>--no-prune</tt></td>
    <td>When all files are deleted from a directory in the Subversion
      repository, don't delete the empty directory (the default is to
      delete any empty directories.</td>
  </tr>

  <tr>
    <td align="right"><tt>--encoding=ENC</tt></td>
    <td>Use ENC as the encoding for filenames, log messages, and
      author names in the CVS repos.  (By using an <tt>--options</tt>
      file, it is possible to specify one set of encodings to use for
      filenames and a second set for log messages and author names.)
      This option may be specified multiple times, in which case the
      encodings are tried in order until one succeeds.  Default:
      ascii.  Other possible values include the <a
      href="http://docs.python.org/lib/standard-encodings.html">standard
      Python encodings</a>.</td>
  </tr>

  <tr>
    <td align="right"><tt>--fallback-encoding=ENC</tt></td>
    <td>If none of the encodings specified with <tt>--encoding</tt>
      succeed in decoding an author name or log message, then fall
      back to using ENC in lossy 'replace' mode.  Use of this option
      may cause information to be lost, but at least it allows the
      conversion to run to completion.  This option only affects the
      encoding of log messages and author names; there is no fallback
      encoding for filenames.  (By using an <tt>--options</tt> file,
      it is possible to specify a fallback encoding for filenames.)
      Default: disabled.</td>
  </tr>

  <tr>
    <td align="right"><tt>--no-cross-branch-commits</tt></td>
    <td>Prevent the creation of SVN commits that affect multiple
      branches or trunk and a branch.  Instead, break such changesets
      into multiple commits, one per branch.</td>
  </tr>

  <tr>
    <td align="right"><tt>--retain-conflicting-attic-files</tt></td>
    <td>If a file appears both inside an outside of the CVS attic,
      retain the attic version in an SVN subdirectory called `Attic'.
      (Normally this situation is treated as a fatal error.)</td>
  </tr>

  <tr>
    <th colspan="2">
      Symbol handling
    </th>
  </tr>

  <tr>
    <td align="right"><tt>--symbol-transform=PAT:SUB</tt></td>
    <td><p>Transform RCS/CVS symbol names before entering them into
      Subversion.  PAT is a Python regular expression pattern that is
      matched against the entire symbol name.  If it matches, the
      symbol is replaced with SUB, which is a replacement pattern
      using Python's reference syntax.  You may specify any number of
      these options; they will be applied in the order given on the
      command line.</p>

      <p>This option can be useful if you're converting a repository in
      which the developer used directory-wide symbol names like 1_0, 1_1
      and 2_1 as a kludgy form of release tagging (the C-x v s command
      in Emacs VC mode encourages this practice).  A command like</p>

<pre>
cvs2svn --symbol-transform='([0-9])-(.*):release-\1.\2' -s SVN RCS
</pre>

      <p>will transform a local CVS repository into a local SVN repository,
      performing the following sort of mappings of RCS symbolic names to
      SVN tags:</p>

<pre>
1-0 &rarr; release-1.0
1-1 &rarr; release-1.1
2-0 &rarr; release-2.0
</pre>
    </td>
  </tr>

  <tr>
    <td align="right"><tt>--symbol-hints=PATH</tt></td>
    <td><p>Read symbol conversion hints from PATH.  The format of PATH is
      the same as the format output by <tt>--write-symbol-info</tt>,
      namely a text file with four whitespace-separated columns:</p>

<pre>
project-id symbol conversion svn-path parent-lod-name
</pre>

      <p><i>project-id</i> is the numerical ID of the project to which
      the symbol belongs, counting from 0.  <i>project-id</i> can be
      set to '.' if project-specificity is not needed.
      <i>symbol-name</i> is the name of the symbol being specified.
      <i>conversion</i> specifies how the symbol should be converted,
      and can be one of the values 'branch', 'tag', or 'exclude'.  If
      <i>conversion</i> is '.', then this rule does not affect how the
      symbol is converted.  <i>svn-path</i> is the name of the SVN
      path to which this line of development should be written.  If
      <i>svn-path</i> is omitted or '.', then this rule does not
      affect the SVN path of this symbol.  <i>parent-lod-name</i> is
      the name of the symbol from which this symbol should sprout, or
      '.trunk.' if the symbol should sprout from trunk.  If
      <i>parent-lod-name</i> is omitted or '.', then this rule does
      not affect the preferred parent of this symbol.  The file may
      contain blank lines or comment lines (lines whose first
      non-whitespace character is '#').</p>

      <p>The simplest way to use this option is to run the conversion
      through CollateSymbolsPass with <tt>--write-symbol-info</tt>
      option, copy the symbol info and edit it to create a hints file,
      then re-start the conversion at <tt>CollateSymbolsPass</tt> with
      this option enabled.</p></td>
  </tr>

  <tr>
    <td align="right"><tt>--symbol-default=OPT</tt></td>
    <td>Specify how to convert ambiguous symbols (i.e., those that
      appear in the CVS archive as both branches and tags).
      <tt>OPT</tt> is one of the following:<ul>

        <li>"<tt>heuristic</tt>": Decide how to treat each ambiguous
          symbol based on whether it was used more often as a branch
          or tag in CVS.  (This is the default behavior.)</li>

        <li>"<tt>strict</tt>": No default; every ambiguous symbol has
          to be resolved manually using <tt>--symbol-hints</tt>,
          <tt>--force-branch</tt>, <tt>--force-tag</tt>, or
          <tt>--exclude</tt>.</li>

        <li>"<tt>branch</tt>": Treat every ambiguous symbol as a
          branch.</li>

        <li>"<tt>tag</tt>": Treat every ambiguous symbols as a
          tag.</li>

      </ul>
    </td>
  </tr>

  <tr>
    <td align="right"><tt>--force-branch=REGEXP</tt></td>
    <td>Force symbols whose names match REGEXP to be branches.</td>
  </tr>

  <tr>
    <td align="right"><tt>--force-tag=REGEXP</tt></td>
    <td>Force symbols whose names match REGEXP to be tags.  This will
      cause an error if such a symbol has commits on it.</td>
  </tr>

  <tr>
    <td align="right"><tt>--exclude=REGEXP</tt></td>
    <td>Exclude branches and tags whose names match REGEXP from
      the conversion.</td>
  </tr>

  <tr>
    <td align="right"><tt>--keep-trivial-imports</tt></td>
    <td>Do not exclude branches that were only used for a single
      import.  (By default such branches are excluded because they
      are usually created by the inappropriate use of <tt>cvs
      import</tt>.)</td>
  </tr>

  <tr>
    <th colspan="2">
      Subversion properties
    </th>
  </tr>

  <tr>
    <td align="right"><tt>--username=NAME</tt></td>
    <td>Use NAME as the author for cvs2svn-synthesized commits (the
      default value is no author at all.</td>
  </tr>

  <tr>
    <td align="right"><tt>--auto-props=FILE</tt></td>
    <td>

      <p>Specify a file in the format of Subversion's config file,
        whose <tt>[auto-props]</tt> section can be used to set
        arbitrary properties on files in the Subversion repository
        based on their filenames.  (The <tt>[auto-props]</tt> section
        header must be present; other sections of the config file,
        including the <tt>enable-auto-props</tt> setting, are
        ignored.)  Filenames are matched to the filename patterns
        case-insensitively, consistent with Subversion's behavior.
        The auto-props file might have content like this:</p>

<pre>
[auto-props]
*.txt = svn:mime-type=text/plain;svn:eol-style=native
*.doc = svn:mime-type=application/msword;!svn:eol-style
</pre>

      <p>Please note that cvs2svn allows properties to be explicitly
        <em>unset</em>: if cvs2svn sees a setting like
        <tt>!svn:eol-style</tt> (with a leading exclamation point), it
        forces the property to remain <em>unset</em>, even if later
        rules would otherwise set the property.</p>

    </td>
  </tr>

  <tr>
    <td align="right"><tt>--mime-types=FILE</tt></td>
    <td>Specify an apache-style mime.types file for setting
      <tt>svn:mime-type</tt> properties on files in the Subversion
      repository.</td>
  </tr>

  <tr>
    <td align="right"><tt>--eol-from-mime-type</tt></td>
    <td>For files that don't have the <tt>kb</tt> expansion mode but
      have a known mime type, set the eol-style based on the mime
      type.  For such files, set the <tt>svn:eol-style</tt> property
      to "native" if the mime type begins with "text/", and leave it
      unset (i.e., no EOL translation) otherwise.  Files with unknown
      mime types are not affected by this option.  This option has no
      effect unless the <tt>--mime-types</tt> option is also
      specified.</td>
  </tr>

  <tr>
    <td align="right"><tt>--default-eol=STYLE</tt></td>
    <td>Set <tt>svn:eol-style</tt> to STYLE for files that don't have
      the <tt>kb</tt> expansion mode and whose end-of-line translation
      mode hasn't been determined by one of the other options.  STYLE
      can be "<tt>binary</tt>" (default), "<tt>native</tt>",
      "<tt>CRLF</tt>", "<tt>LF</tt>", or "<tt>CR</tt>".</td>
  </tr>

  <tr>
    <td align="right"><tt>--keywords-off</tt></td>
    <td>By default, cvs2svn sets <tt>svn:keywords</tt> on CVS files to
      "author id date" if the mode of the RCS file in question is
      either kv, kvl or <b>not</b> kb.  If you use the
      <tt>--keywords-off</tt> switch, cvs2svn will not set
      <tt>svn:keywords</tt> for any file.  While this will not touch
      the keywords in the contents of your files, Subversion will not
      expand them.</td>
  </tr>

  <tr>
    <td align="right"><tt>--keep-cvsignore</tt></td>
    <td>Include <tt>.cvsignore</tt> files in the output.  (Normally
      they are unneeded because cvs2svn sets the corresponding
      <tt>svn:ignore</tt> properties.)</td>
  </tr>

  <tr>
    <td align="right"><tt>--cvs-revnums</tt></td>
    <td>Record CVS revision numbers as file properties in the
      Subversion repository.  (Note that unless it is removed
      explicitly, the last CVS revision number will remain associated
      with the file even after the file is changed within
      Subversion.)</td>
  </tr>

  <tr>
    <th colspan="2">
      Extraction options
    </th>
  </tr>

  <tr>
    <td align="right">
      <a name="use-internal-co"><tt>--use-internal-co</tt></a>
    </td>
    <td>Use internal code to extract the contents of CVS revisions.
      This is the default extraction option.  This is up to 50% faster
      than <tt>--use-rcs</tt>, but needs a lot of disk space: roughly
      the size of your CVS repository plus the peak size of a complete
      checkout of the repository with all branches that existed and
      still had commits pending at a given time.  If this option is
      used, the <tt>$Log$</tt> keyword is not handled.
    </td>
  </tr>

  <tr>
    <td align="right"><a name="use-rcs"><tt>--use-rcs</tt></a></td>
    <td>Use RCS's <b><tt>co</tt></b> command to extract the contents
      of CVS revisions.  RCS is much faster than CVS, but in certain
      rare cases it has problems with data that CVS can handle.
      Specifically:
      <ul>
        <li>RCS can't handle spaces in author names:<br/>
          <a href="http://cvs2svn.tigris.org/issues/show_bug.cgi?id=4"
                  >http://cvs2svn.tigris.org/issues/show_bug.cgi?id=4</a>
        </li>
        <li>"Unterminated keyword" misread by RCS:<br/>
          <a href="http://cvs2svn.tigris.org/issues/show_bug.cgi?id=11"
                  >http://cvs2svn.tigris.org/issues/show_bug.cgi?id=11</a>
        </li>
        <li>RCS handles the "$Log$" keyword differently from CVS:<br/>
          <a href="http://cvs2svn.tigris.org/issues/show_bug.cgi?id=29"
                  >http://cvs2svn.tigris.org/issues/show_bug.cgi?id=29</a>
        </li>
      </ul>
      If you are having trouble in <tt>OutputPass</tt> of a
      conversion when using the <tt>--use-rcs</tt> option, the first
      thing to try is using the <tt>--use-cvs</tt> option instead.
    </td>
  </tr>

  <tr>
    <td align="right"><a name="use-cvs"><tt>--use-cvs</tt></a></td>
    <td>If RCS <b><tt>co</tt></b> is having trouble extracting CVS
      revisions, you may need to pass this flag, which causes cvs2svn
      to use CVS instead of RCS to read the repository.  See <a
      href="#use-rcs"><tt>--use-rcs</tt></a> for more information.
    </td>
  </tr>

  <tr>
    <th colspan="2">
      Environment options
    </th>
  </tr>

  <tr>
    <td align="right"><tt>--tmpdir=PATH</tt></td>
    <td>Use the directory PATH for all of cvs2svn's temporary data
      (which can be a <i>lot</i> of data).  The default value is
      <tt>cvs2svn-tmp</tt> in the current working directory.</td>
  </tr>

  <tr>
    <td align="right"><tt>--svnadmin=PATH</tt></td>
    <td>If the <tt>svnadmin</tt> program is not in your $PATH you
      should specify its absolute path with this switch.
      <tt>svnadmin</tt> is needed when the <tt>-s/--svnrepos</tt>
      output option is used</td>
  </tr>

  <tr>
    <td align="right"><tt>--co=PATH</tt></td>
    <td>If the <tt>co</tt> program (a part of RCS) is not in your
      $PATH you should specify its absolute path with this switch.
      (<tt>co</tt> is needed if the <tt>--use-rcs</tt> extraction
      option is used.)</td>
  </tr>

  <tr>
    <td align="right"><tt>--cvs=PATH</tt></td>
    <td>If the cvs program is not in your $PATH you should
      specify its absolute path with this switch.  (<tt>cvs</tt> is
      needed if the <tt>--use-cvs</tt> extraction option is
      used.)</td>
  </tr>

  <tr>
    <td align="right"><tt>--sort=PATH</tt></td>
    <td>If the GNU <tt>sort</tt> program is not in your $PATH you
      should specify its absolute path with this switch.  cvs2svn
      requires GNU <tt>sort</tt>; Windows <tt>sort.exe</tt> is
      <b>not</b> adequate.</td>
  </tr>

  <tr>
    <th colspan="2">
      Partial conversions
    </th>
  </tr>

  <tr>
    <td align="right"><tt>-p PASS</tt><br/><tt>--pass PASS</tt></td>
    <td>Execute only pass PASS of the conversion.  PASS can be
    specified by name or by number (see <tt>--help-passes</tt>)</td>
  </tr>

  <tr>
    <td align="right"><tt>-p [START]:[END]</tt><br/><tt>--passes [START]:[END]</tt></td>
    <td>Execute passes START through END of the conversion
    (inclusive).  START and END can be specified by name or by number
    (see <tt>--help-passes</tt>).  If START or END is missing, it
    defaults to the first or last pass, respectively.</td>
  </tr>

  <tr>
    <th colspan="2">
      Information options
    </th>
  </tr>

  <tr>
    <td align="right"><tt>--version</tt></td>
    <td>Print the version number.</td>
  </tr>

  <tr>
    <td align="right"><tt>--help</tt>, <tt>-h</tt></td>
    <td>Print the usage message and exit with success.</td>
  </tr>

  <tr>
    <td align="right"><tt>--help-passes</tt></td>
    <td>Print the numbers and names of the conversion passes and exit
    with success.</td>
  </tr>

  <tr>
    <td align="right"><tt>--man</tt></td>
    <td>Write the manpage for this program to standard output.</td>
  </tr>

  <tr>
    <td align="right"><tt>--verbose</tt>, <tt>-v</tt></td>
    <td>Tell cvs2svn to print lots of information about what
      it's doing to STDOUT.  This option can be specified twice to get
      debug-level output.</td>
  </tr>

  <tr>
    <td align="right"><tt>--quiet</tt>, <tt>-q</tt></td>
    <td>Tell cvs2svn to operate in quiet mode, printing little more
      than pass starts and stops to STDOUT.  This option may be
      specified twice to suppress all non-error output.</td>
  </tr>

  <tr>
    <td align="right"><tt>--write-symbol-info=PATH</tt></td>
    <td>Write symbol statistics and information about how symbols were
      converted to PATH during CollateSymbolsPass.  See
      <tt>--symbol-hints</tt> for a description of the output
      format.</td>
  </tr>

  <tr>
    <td align="right"><tt>--skip-cleanup</tt></td>
    <td>Prevent the deletion of the temporary files that cvs2svn
      creates in the process of conversion.</td>
  </tr>

  <tr>
    <td align="right"><tt>--profile</tt></td>
    <td>Dump Python <a href="http://docs.python.org/lib/module-hotshot.html"
        >Hotshot</a> profiling data to the file <tt>cvs2svn.hotshot</tt>.</td>
  </tr>

</table>

<hr />

<h1><a name="examples">A Few Examples</a></h1>

<p>To create a new Subversion repository by converting an existing CVS
repository, run the script like this:</p>

<pre>
   $ cvs2svn --svnrepos NEW_SVNREPOS CVSREPOS
</pre>

<p>To create a new Subversion repository containing only trunk commits,
and omitting all branches and tags from the CVS repository, do</p>

<pre>
   $ cvs2svn --trunk-only --svnrepos NEW_SVNREPOS CVSREPOS
</pre>

<p>To create a Subversion dumpfile (suitable for 'svnadmin load') from
a CVS repository, run it like this:</p>

<pre>
   $ cvs2svn --dumpfile DUMPFILE CVSREPOS
</pre>

<p>To use an options file to define all of the conversion parameters,
specify <tt>--options</tt>:</p>

<pre>
   $ cvs2svn --options OPTIONSFILE
</pre>

<p>As it works, cvs2svn will create many temporary files in a
temporary directory called "cvs2svn-tmp" (or the directory specified
with <tt>--tmpdir</tt>).  This is normal.  If the entire conversion is
successful, however, those tempfiles will be automatically removed.
If the conversion is not successful, or if you specify the
'--skip-cleanup' option, cvs2svn will leave the temporary files behind
for possible debugging.</p>

</div>
</body>
</html>