Handle --force-branch via optparse.
[cvs2svn.git] / cvs2svn.1
blob945813bcd5a87274336efd740140d3fe7ab7626e
1 .\" Process this file with
2 .\" groff -man -Tascii cvs2svn.1
3 .TH CVS2SVN "1" "Oct 24, 2004" "Subversion" "User Commands"
4 .SH NAME
5 cvs2svn \- convert a cvs repository into a subversion repository
6 .SH SYNOPSIS
7 .B cvs2svn
8 [\fIOPTION\fR]... \fIOUTPUT-OPTION CVS-REPOS-PATH\fR
9 .br
10 .B cvs2svn
11 [\fIOPTION\fR]... \fI--options=PATH\fR
12 .SH DESCRIPTION
13 Create a new Subversion repository based on the version history stored in a
14 CVS repository. Each CVS commit will be mirrored in the Subversion
15 repository, including such information as date of commit and id of the
16 committer.
18 \fICVS-REPOS-PATH\fR is the filesystem path of the part of the CVS
19 repository that you want to convert.  It is not possible to convert a
20 CVS repository to which you only have remote access; see the FAQ for
21 more information.  This path doesn't have to be the top level
22 directory of a CVS repository; it can point at a project within a
23 repository, in which case only that project will be converted.  This
24 path or one of its parent directories has to contain a subdirectory
25 called CVSROOT (though the CVSROOT directory can be empty).
27 Multiple CVS repositories can be converted into a single Subversion
28 repository in a single run of cvs2svn, but only by using an
29 \fB--options\fR file.
30 .SH "OPTIONS FILE"
31 .TP
32 \fB--options\fR=\fIpath\fR
33 Read the conversion options from \fIpath\fR instead of from the
34 command line.  This option allows far more conversion flexibility than
35 can be achieved using the command-line alone.  See the documentation
36 for more information.  Only the following command-line options are
37 allowed in combination with \fB--options\fR: \fB-h\fR/\fB--help\fR,
38 \fB--help-passes\fR, \fB--version\fR, \fB-v\fR/\fB--verbose\fR,
39 \fB-q\fR/\fB--quiet\fR, \fB-p\fR/\fB--pass\fR/\fB--passes\fR,
40 \fB--dry-run\fR, and \fB--profile\fR.
41 .SH "OUTPUT OPTIONS"
42 .TP
43 \fB-s\fR, \fB--svnrepos\fR \fIpath\fR
44 Write the output of the conversion into a Subversion repository
45 located at \fIpath\fR.  This option causes a new Subversion repository
46 to be created at \fIpath\fR unless the \fB--existing-svnrepos\fR
47 option is also used.
48 .TP
49 \fB--existing-svnrepos\fR
50 Load the converted CVS repository into an existing Subversion
51 repository, instead of creating a new repository.  (This option should
52 be used in combination with \fB-s\fR/\fB--svnrepos\fR.)  The
53 repository must either be empty or contain no paths that overlap with
54 those that will result from the conversion.  Please note that you need
55 write permission for the repository files.
56 .TP
57 \fB--fs-type\fR
58 Pass \fI--fs-type\fR=\fItype\fR to "svnadmin create" when creating a
59 new repository.
60 .TP
61 \fB--bdb-txn-nosync\fR
62 Pass \fI--bdb-txn-nosync\fR to "svnadmin create" when creating a new
63 BDB-style Subversion repository.
64 .TP
65 \fB--create-option\fR=\fIopt\fR
66 Pass \fIopt\fR to "svnadmin create" when creating a new Subversion
67 repository (can be specified multiple times to pass multiple options).
68 .TP
69 \fB--dumpfile\fR=\fIpath\fR
70 Just produce a dumpfile; don't commit to an SVN repository.  Write the
71 dumpfile to \fIpath\fR.
72 .TP
73 \fB--dry-run\fR
74 Do not create a repository or a dumpfile; just print the details of what
75 cvs2svn would do if it were really converting your repository.
76 .SH "CONVERSION OPTIONS"
77 .TP
78 \fB--trunk-only\fR
79 Convert only trunk commits, not tags nor branches.
80 .TP
81 \fB--trunk\fR=\fIpath\fR
82 Set the top-level path to use for trunk in the Subversion repository.
83 The default is \fItrunk\fR.
84 .TP
85 \fB--branches\fR=\fIpath\fR
86 Set the top-level path to use for branches in the Subversion
87 repository.  The default is \fIbranches\fR.
88 .TP
89 \fB--tags\fR=\fIpath\fR
90 Set the top-level path to use for tags in the Subversion repository.
91 The default is \fItags\fR.
92 .TP
93 \fB--no-prune\fR
94 When all files are deleted from a directory in the Subversion
95 repository, don't delete the empty directory (the default is to delete
96 any empty directories.
97 .TP
98 \fB--encoding\fR=\fIencoding\fR
99 Use \fIencoding\fR as the encoding for filenames, log messages, and
100 author names in the CVS repos.  This option may be specified
101 multiple times, in which case the encodings are tried in order
102 until one succeeds.  Default: ascii.  See
103 http://docs.python.org/lib/standard-encodings.html for a list of other
104 standard encodings.
106 \fB--fallback-encoding\fR=\fIencoding\fR
107 If none of the encodings specified with \fB--encoding\fR succeed in
108 decoding an author name or log message, then fall back to using
109 \fIencoding\fR in lossy 'replace' mode.  Use of this option may cause
110 information to be lost, but at least it allows the conversion to run
111 to completion.  This option only affects the encoding of log messages
112 and author names; there is no fallback encoding for filenames.  (By
113 using an \fB--options\fR file, it is possible to specify a fallback
114 encoding for filenames.)  Default: disabled.
116 \fB--symbol-transform\fR=\fIpattern\fR:\fIreplacement\fR
117 Transform RCS/CVS symbol names before entering them into Subversion.
118 \fIpattern\fR is a Python regexp pattern that is matches against the
119 entire symbol name; \fIreplacement\fR is a replacement using Python's
120 regexp reference syntax.  You may specify any number of these options;
121 they will be applied in the order given on the command line.
123 \fB--symbol-hints\fR=\fIpath\fR
124 Read symbol conversion hints from \fIpath\fR.  The format of
125 \fIpath\fR is the same as the format output by
126 \fB--write-symbol-info\fR, namely a text file with four
127 whitespace-separated columns: \fIproject-id\fR, \fIsymbol\fR,
128 \fIconversion\fR, and \fIparent-lod-name\fR.  \fIproject-id\fR is
129 the numerical ID of the project to which the symbol belongs, counting
130 from 0.  \fIproject-id\fR can be set to '.' if project-specificity is
131 not needed.  \fIsymbol-name\fR is the name of the symbol being
132 specified.  \fIconversion\fR specifies how the symbol should be
133 converted, and can be one of the values 'branch', 'tag', or 'exclude'.
134 If \fIconversion\fR is '.', then this rule does not affect how the
135 symbol is converted.  \fIparent-lod-name\fR is the name of the symbol
136 from which this symbol should sprout, or '.trunk.' if the symbol
137 should sprout from trunk.  If \fIparent-lod-name\fR is omitted or '.',
138 then this rule does not affect the preferred parent of this symbol.
139 The file may contain blank lines or comment lines (lines whose first
140 non-whitespace character is '#').
142 \fB--force-branch\fR=\fIregexp\fR
143 Force symbols whose names match \fIregexp\fR to be branches.
144 \fIregexp\fR must match the whole symbol name.
146 \fB--force-tag\fR=\fIregexp\fR
147 Force symbols whose names match \fIregexp\fR to be tags.  \fIregexp\fR
148 must match the whole symbol name.
150 \fB--exclude\fR=\fIregexp\fR
151 Exclude branches and tags whose names match \fIregexp\fR from the
152 conversion.  \fIregexp\fR must match the whole symbol name.
154 \fB--keep-trivial-imports\fR
155 Do not exclude branches that were only used for a single import.  (By
156 default such branches are excluded because they are usually created by
157 the inappropriate use of \fBcvs import\fR.)
159 \fB--symbol-default\fR=\fIopt\fR
160 Specify how to convert ambiguous symbols (those that appear in the CVS
161 archive as both branches and tags).  \fIopt\fR must be `heuristic'
162 (decide how to treat each ambiguous symbol based on whether it was
163 used more often as a branch/tag in CVS), `strict' (no default; every
164 ambiguous symbol has to be resolved manually using
165 \fB--force-branch\fR, \fB--force-tag\fR, or \fB--exclude\fR), `branch'
166 (treat every ambiguous symbol as a branch), or `tag' (treat every
167 ambiguous symbol as a tag).  The default is `heuristic'.
169 \fB--keep-cvsignore\fR
170 Include \fI.cvsignore\fR files in the output.  (Normally they are
171 unneeded because cvs2svn sets the corresponding \fIsvn:ignore\fR
172 properties.)
174 \fB--retain-conflicting-attic-files\fR
175 If a file appears both inside an outside of the CVS attic, retain the
176 attic version in an SVN subdirectory called `Attic'.  (Normally this
177 situation is treated as a fatal error.)
179 \fB--username\fR=\fIname\fR
180 Set the default username to \fIname\fR when cvs2svn needs to generate
181 a commit for which CVS does not record the original username.  This
182 happens when a branch or tag is created.  The default is to use no
183 author at all for such commits.
185 \fB--cvs-revnums\fR
186 Record CVS revision numbers as file properties in the Subversion
187 repository.  (Note that unless it is removed explicitly, the last CVS
188 revision number will remain associated with the file even after the
189 file is changed within Subversion.)
191 \fB--mime-types\fR=\fIfile\fR
192 Specify an apache-style mime.types \fIfile\fR for setting
193 svn:mime-type.
195 \fB--eol-from-mime-type\fR
196 For files that don't have the kb expansion mode but have a known mime
197 type, set the eol-style based on the mime type.  For such files, set
198 svn:eol-style to "native" if the mime type begins with "text/", and
199 leave it unset (i.e., no EOL translation) otherwise.  Files with
200 unknown mime types are not affected by this option.  This option has
201 no effect unless the \fB--mime-types\fR option is also specified.
203 \fB--auto-props\fR=\fIfile\fR
204 Specify a file in the format of Subversion's config file, whose
205 [auto-props] section can be used to set arbitrary properties on files
206 in the Subversion repository based on their filenames.  (The
207 [auto-props] section header must be present; other sections of the
208 config file, including the enable-auto-props setting, are ignored.)
209 Filenames are matched to the filename patterns case-insensitively.
211 \fB--default-eol\fR=\fIstyle\fR
212 Set svn:eol-style to \fIstyle\fR for files that don't have the CVS
213 `kb' expansion mode and whose end-of-line translation mode hasn't been
214 determined by one of the other options.  \fIstyle\fR must be `binary'
215 (default), `native', `CRLF', `LF', or `CR'.
217 \fB--keywords-off\fR
218 By default, cvs2svn sets svn:keywords on CVS files to "author id date"
219 if the mode of the RCS file in question is either kv, kvl or unset.
220 If you use the --keywords-off switch, cvs2svn will not set
221 svn:keywords for any file.  While this will not touch the keywords in
222 the contents of your files, Subversion will not expand them.
223 .SH "EXTRACTION OPTIONS"
225 \fB--use-internal-co\fR
226 Use internal code to extract revision contents.  This is up to 50%
227 faster than using \fB--use-rcs\fR, but needs a lot of disk space:
228 Roughly the size of your CVS repository plus the peak size of a
229 complete checkout of the repository with all branches that existed and
230 still had commits pending at a given time.  This option is the
231 default.
233 \fB--use-rcs\fR
234 Use RCS 'co' to extract revision contents.
236 \fB--use-cvs\fR
237 Use CVS to extract revision contents (only use this if having
238 problems with \fB--use-internal-co\fR or \fB--use-rcs\fR, as those
239 options are much faster).
240 .SH "ENVIRONMENT OPTIONS"
242 \fB--tmpdir\fR=\fIpath\fR
243 Set the \fIpath\fR to use for temporary data.  Default is a directory
244 called \fIcvs2svn-tmp\fR under the current directory.
246 \fB--svnadmin\fR=\fIpath\fR
247 Path to the \fIsvnadmin\fR program.  (\fIsvnadmin\fR is needed when
248 the \fB-s\fR/\fB--svnrepos\fR output option is used.)
250 \fB--co\fR=\fIpath\fR
251 Path to the \fIco\fR program.  (\fIco\fR is needed if the
252 \fB--use-rcs\fR option is used.)
254 \fB--cvs\fR=\fIpath\fR
255 Path to the \fIcvs\fR program.  (\fIcvs\fR is needed if the
256 \fB--use-cvs\fR option is used.)
258 \fB--sort\fR=\fIpath\fR
259 Path to the GNU \fIsort\fR program.  (cvs2svn requires GNU sort.)
260 .SH "PARTIAL CONVERSIONS"
262 \fB-p\fR, \fB--pass\fR \fIpass\fR
263 Execute only pass \fIpass\fR of the conversion.  \fIpass\fR can be
264 specified by name or by number (see \fB--help-passes\fR).
266 \fB-p\fR, \fB--passes\fR [\fIstart\fR]:[\fIend\fR]
267 Execute passes \fIstart\fR through \fIend\fR of the conversion
268 (inclusive).  \fIstart\fR and \fIend\fR can be specified by name or by
269 number (see \fB--help-passes\fR).  If \fIstart\fR or \fIend\fR is
270 missing, it defaults to the first or last pass, respectively.  For
271 this to work the earlier passes must have been completed before on the
272 same CVS repository, and the generated data files must be in the
273 temporary directory (see \fB--tmpdir\fR).
274 .SH "INFORMATION OPTIONS"
276 \fB--version\fR
277 Print the version number.
279 \fB-h\fR, \fB--help\fR
280 Print the usage message and exit with success.
282 \fB--help-passes\fR
283 Print the numbers and names of the conversion passes and exit with
284 success.
286 \fB-v\fR, \fB--verbose\fR
287 Print more information while running.  This option may be specified
288 twice to output voluminous debugging information.
290 \fB-q\fR, \fB--quiet\fR
291 Print less information while running.  This option may be specified
292 twice to suppress all non-error output.
294 \fB--write-symbol-info\fR=\fIpath\fR
295 Write symbol statistics and information about how symbols were
296 converted to \fIpath\fR during CollateSymbolsPass.
298 \fB--skip-cleanup\fR
299 Prevent the deletion of temporary files.
301 \fB--profile\fR
302 Profile with 'hotshot' (into file \fIcvs2svn.hotshot\fR).
303 .SH FILES
304 A directory called \fIcvs2svn-tmp\fR (or the directory specified by
305 \fB--tmpdir\fR) is used as scratch space for temporary data files.
306 .SH AUTHORS
307 Main authors are:
309 C. Michael Pilato <cmpilato@collab.net>
311 Greg Stein <gstein@lyra.org>
313 Branko Čibej <brane@xbc.nu>
315 Blair Zajac <blair@orcaware.com>
317 Max Bowsher <maxb@ukf.net>
319 Brian Fitzpatrick <fitz@red-bean.com>
321 Tobias Ringström <tobias@ringstrom.mine.nu>
323 Karl Fogel <kfogel@collab.net>
325 Erik Hülsmann <e.huelsmann@gmx.net>
327 David Summers <david@summersoft.fay.ar.us>
329 Michael Haggerty <mhagger@alum.mit.edu>
331 Manpage was written for the Debian GNU/Linux system by
332 Laszlo 'GCS' Boszormenyi <gcs@lsc.hu> (but may be used by others).
333 .SH SEE ALSO
334 cvs(1), svn(1), svnadmin(1)