1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
<title>convert</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="convert">
<span id="ext-convert"></span>
<h1 class="title">convert</h1>
<div class="contents htmlonly topic" id="contents">
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p>
<ul class="simple">
<li><a class="reference internal" href="#commands" id="toc-entry-1">Commands</a><ul>
<li><a class="reference internal" href="#uncategorized-commands" id="toc-entry-2">Uncategorized commands</a></li>
</ul>
</li>
</ul>
</div>
<p>import revisions from foreign VCS repositories into Mercurial</p>
<div class="section" id="commands">
<h1><a class="toc-backref" href="#contents">Commands</a></h1>
<div class="section" id="uncategorized-commands">
<h2><a class="toc-backref" href="#contents">Uncategorized commands</a></h2>
<div class="section" id="convert-1">
<h3>convert</h3>
<p>convert a foreign SCM repository to a Mercurial one.:</p>
<pre class="literal-block">
hg convert [OPTION]... SOURCE [DEST [REVMAP]]
</pre>
<p>Accepted source formats [identifiers]:</p>
<ul class="simple">
<li>Mercurial [hg]</li>
<li>CVS [cvs]</li>
<li>Darcs [darcs]</li>
<li>git [git]</li>
<li>Subversion [svn]</li>
<li>Monotone [mtn]</li>
<li>GNU Arch [gnuarch]</li>
<li>Bazaar [bzr]</li>
<li>Perforce [p4]</li>
</ul>
<p>Accepted destination formats [identifiers]:</p>
<ul class="simple">
<li>Mercurial [hg]</li>
<li>Subversion [svn] (history on branches is not preserved)</li>
</ul>
<p>If no revision is given, all revisions will be converted.
Otherwise, convert will only import up to the named revision
(given in a format understood by the source).</p>
<p>If no destination directory name is specified, it defaults to the
basename of the source with <tt class="docutils literal"><span class="pre">-hg</span></tt> appended. If the destination
repository doesn't exist, it will be created.</p>
<p>By default, all sources except Mercurial will use --branchsort.
Mercurial uses --sourcesort to preserve original revision numbers
order. Sort modes have the following effects:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group">
<kbd><span class="option">--branchsort</span></kbd></td>
<td>convert from parent to child revision when possible,
which means branches are usually converted one after
the other. It generates more compact repositories.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--datesort</span></kbd></td>
<td>sort revisions by date. Converted repositories have
good-looking changelogs but are often an order of
magnitude larger than the same ones generated by
--branchsort.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--sourcesort</span></kbd></td>
<td>try to preserve source revisions order, only
supported by Mercurial sources.</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--closesort</span></kbd></td>
<td>try to move closed revisions as close as possible
to parent branches, only supported by Mercurial
sources.</td></tr>
</tbody>
</table>
<p>If <tt class="docutils literal">REVMAP</tt> isn't given, it will be put in a default location
(<tt class="docutils literal"><span class="pre"><dest>/.hg/shamap</span></tt> by default). The <tt class="docutils literal">REVMAP</tt> is a simple
text file that maps each source commit ID to the destination ID
for that revision, like so:</p>
<pre class="literal-block">
<source ID> <destination ID>
</pre>
<p>If the file doesn't exist, it's automatically created. It's
updated on each commit copied, so <a class="reference external" href="hg-convert.html"><tt class="docutils literal">hg convert</tt></a> can be interrupted
and can be run repeatedly to copy new commits.</p>
<p>The authormap is a simple text file that maps each source commit
author to a destination commit author. It is handy for source SCMs
that use unix logins to identify authors (e.g.: CVS). One line per
author mapping and the line format is:</p>
<pre class="literal-block">
source author = destination author
</pre>
<p>Empty lines and lines starting with a <tt class="docutils literal">#</tt> are ignored.</p>
<p>The filemap is a file that allows filtering and remapping of files
and directories. Each line can contain one of the following
directives:</p>
<pre class="literal-block">
include path/to/file-or-dir
exclude path/to/file-or-dir
rename path/to/source path/to/destination
</pre>
<p>Comment lines start with <tt class="docutils literal">#</tt>. A specified path matches if it
equals the full relative name of a file or one of its parent
directories. The <tt class="docutils literal">include</tt> or <tt class="docutils literal">exclude</tt> directive with the
longest matching path applies, so line order does not matter.</p>
<p>The <tt class="docutils literal">include</tt> directive causes a file, or all files under a
directory, to be included in the destination repository. The default
if there are no <tt class="docutils literal">include</tt> statements is to include everything.
If there are any <tt class="docutils literal">include</tt> statements, nothing else is included.
The <tt class="docutils literal">exclude</tt> directive causes files or directories to
be omitted. The <tt class="docutils literal">rename</tt> directive renames a file or directory if
it is converted. To rename from a subdirectory into the root of
the repository, use <tt class="docutils literal">.</tt> as the path to rename to.</p>
<p><tt class="docutils literal"><span class="pre">--full</span></tt> will make sure the converted changesets contain exactly
the right files with the right content. It will make a full
conversion of all files, not just the ones that have
changed. Files that already are correct will not be changed. This
can be used to apply filemap changes when converting
incrementally. This is currently only supported for Mercurial and
Subversion.</p>
<p>The splicemap is a file that allows insertion of synthetic
history, letting you specify the parents of a revision. This is
useful if you want to e.g. give a Subversion merge two parents, or
graft two disconnected series of history together. Each entry
contains a key, followed by a space, followed by one or two
comma-separated values:</p>
<pre class="literal-block">
key parent1, parent2
</pre>
<p>The key is the revision ID in the source
revision control system whose parents should be modified (same
format as a key in .hg/shamap). The values are the revision IDs
(in either the source or destination revision control system) that
should be used as the new parents for that node. For example, if
you have merged "release-1.0" into "trunk", then you should
specify the revision on "trunk" as the first parent and the one on
the "release-1.0" branch as the second.</p>
<p>The branchmap is a file that allows you to rename a branch when it is
being brought in from whatever external repository. When used in
conjunction with a splicemap, it allows for a powerful combination
to help fix even the most badly mismanaged repositories and turn them
into nicely structured Mercurial repositories. The branchmap contains
lines of the form:</p>
<pre class="literal-block">
original_branch_name new_branch_name
</pre>
<p>where "original_branch_name" is the name of the branch in the
source repository, and "new_branch_name" is the name of the branch
is the destination repository. No whitespace is allowed in the new
branch name. This can be used to (for instance) move code in one
repository from "default" to a named branch.</p>
<div class="section" id="mercurial-source">
<h4>Mercurial Source</h4>
<p>The Mercurial source recognizes the following configuration
options, which you can set on the command line with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.hg.ignoreerrors:</th></tr>
<tr class="field"><td> </td><td class="field-body">ignore integrity errors when reading.
Use it to fix Mercurial repositories with missing revlogs, by
converting from and to Mercurial. Default is False.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.saverev:</th></tr>
<tr class="field"><td> </td><td class="field-body">store original revision ID in changeset
(forces target IDs to change). It takes a boolean argument and
defaults to False.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.startrev:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the initial Mercurial revision.
The default is 0.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.revs:</th></tr>
<tr class="field"><td> </td><td class="field-body">revset specifying the source revisions to convert.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="bazaar-source">
<h4>Bazaar Source</h4>
<p>The following options can be used with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.bzr.saverev:</th></tr>
<tr class="field"><td> </td><td class="field-body">whether to store the original Bazaar commit ID in
the metadata of the destination commit. The default is True.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="cvs-source">
<h4>CVS Source</h4>
<p>CVS source will use a sandbox (i.e. a checked-out copy) from CVS
to indicate the starting point of what will be converted. Direct
access to the repository files is not needed, unless of course the
repository is <tt class="docutils literal">:local:</tt>. The conversion uses the top level
directory in the sandbox to find the CVS repository, and then uses
CVS rlog commands to find files to convert. This means that unless
a filemap is given, all files under the starting directory will be
converted, and that any directory reorganization in the CVS
sandbox is ignored.</p>
<p>The following options can be used with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.cache:</th></tr>
<tr class="field"><td> </td><td class="field-body">Set to False to disable remote log caching,
for testing and debugging purposes. Default is True.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.fuzz:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify the maximum time (in seconds) that is
allowed between commits with identical user and log message in
a single changeset. When very large files were checked in as
part of a changeset then the default may not be long enough.
The default is 60.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.logencoding:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify encoding name to be used for
transcoding CVS log messages. Multiple encoding names can be
specified as a list (see <a class="reference external" href="hgrc.5.html#Syntax"><tt class="docutils literal">hg help config.Syntax</tt></a>), but only
the first acceptable encoding in the list is used per CVS log
entries. This transcoding is executed before cvslog hook below.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.mergeto:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify a regular expression to which
commit log messages are matched. If a match occurs, then the
conversion process will insert a dummy revision merging the
branch on which this log message occurs to the branch
indicated in the regex. Default is <tt class="docutils literal">{{mergetobranch
<span class="pre">([-\w]+)}}</span></tt></td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.cvsps.mergefrom:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify a regular expression to which
commit log messages are matched. If a match occurs, then the
conversion process will add the most recent revision on the
branch indicated in the regex as the second parent of the
changeset. Default is <tt class="docutils literal">{{mergefrombranch <span class="pre">([-\w]+)}}</span></tt></td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.localtimezone:</th></tr>
<tr class="field"><td> </td><td class="field-body">use local time (as determined by the TZ
environment variable) for changeset date/times. The default
is False (use UTC).</td>
</tr>
<tr class="field"><th class="field-name">hooks.cvslog:</th><td class="field-body">Specify a Python function to be called at the end of
gathering the CVS log. The function is passed a list with the
log entries, and can modify the entries in-place, or add or
delete them.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">hooks.cvschangesets:</th></tr>
<tr class="field"><td> </td><td class="field-body">Specify a Python function to be called after
the changesets are calculated from the CVS log. The
function is passed a list with the changeset entries, and can
modify the changesets in-place, or add or delete them.</td>
</tr>
</tbody>
</table>
<p>An additional "debugcvsps" Mercurial command allows the builtin
changeset merging code to be run without doing a conversion. Its
parameters and output are similar to that of cvsps 2.1. Please see
the command help for more details.</p>
</div>
<div class="section" id="subversion-source">
<h4>Subversion Source</h4>
<p>Subversion source detects classical trunk/branches/tags layouts.
By default, the supplied <tt class="docutils literal"><span class="pre">svn://repo/path/</span></tt> source URL is
converted as a single branch. If <tt class="docutils literal"><span class="pre">svn://repo/path/trunk</span></tt> exists
it replaces the default branch. If <tt class="docutils literal"><span class="pre">svn://repo/path/branches</span></tt>
exists, its subdirectories are listed as possible branches. If
<tt class="docutils literal"><span class="pre">svn://repo/path/tags</span></tt> exists, it is looked for tags referencing
converted branches. Default <tt class="docutils literal">trunk</tt>, <tt class="docutils literal">branches</tt> and <tt class="docutils literal">tags</tt>
values can be overridden with following options. Set them to paths
relative to the source URL, or leave them blank to disable auto
detection.</p>
<p>The following options can be set with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.svn.branches:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the directory containing branches.
The default is <tt class="docutils literal">branches</tt>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.svn.tags:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the directory containing tags. The
default is <tt class="docutils literal">tags</tt>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.svn.trunk:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the name of the trunk branch. The
default is <tt class="docutils literal">trunk</tt>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.localtimezone:</th></tr>
<tr class="field"><td> </td><td class="field-body">use local time (as determined by the TZ
environment variable) for changeset date/times. The default
is False (use UTC).</td>
</tr>
</tbody>
</table>
<p>Source history can be retrieved starting at a specific revision,
instead of being integrally converted. Only single branch
conversions are supported.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.svn.startrev:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify start Subversion revision number.
The default is 0.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="git-source">
<h4>Git Source</h4>
<p>The Git importer converts commits from all reachable branches (refs
in refs/heads) and remotes (refs in refs/remotes) to Mercurial.
Branches are converted to bookmarks with the same name, with the
leading 'refs/heads' stripped. Git submodules are converted to Git
subrepos in Mercurial.</p>
<p>The following options can be set with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.git.similarity:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first">specify how similar files modified in a
commit must be to be imported as renames or copies, as a
percentage between <tt class="docutils literal">0</tt> (disabled) and <tt class="docutils literal">100</tt> (files must be
identical). For example, <tt class="docutils literal">90</tt> means that a delete/add pair will
be imported as a rename if more than 90% of the file hasn't
changed. The default is <tt class="docutils literal">50</tt>.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.git.findcopiesharder:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first">while detecting copies, look at all
files in the working copy instead of just changed ones. This
is very expensive for large projects, and is only effective when
<tt class="docutils literal">convert.git.similarity</tt> is greater than 0. The default is False.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.git.renamelimit:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first">perform rename and copy detection up to this
many changed files in a commit. Increasing this will make rename
and copy detection more accurate but will significantly slow down
computation on large projects. The option is only relevant if
<tt class="docutils literal">convert.git.similarity</tt> is greater than 0. The default is
<tt class="docutils literal">400</tt>.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.git.committeractions:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first">list of actions to take when processing
author and committer values.</p>
<p>Git commits have separate author (who wrote the commit) and committer
(who applied the commit) fields. Not all destinations support separate
author and committer fields (including Mercurial). This config option
controls what to do with these author and committer fields during
conversion.</p>
<p>A value of <tt class="docutils literal">messagedifferent</tt> will append a <tt class="docutils literal">committer: ...</tt>
line to the commit message if the Git committer is different from the
author. The prefix of that line can be specified using the syntax
<tt class="docutils literal"><span class="pre">messagedifferent=<prefix></span></tt>. e.g. <tt class="docutils literal"><span class="pre">messagedifferent=git-committer:</span></tt>.
When a prefix is specified, a space will always be inserted between the
prefix and the value.</p>
<p><tt class="docutils literal">messagealways</tt> behaves like <tt class="docutils literal">messagedifferent</tt> except it will
always result in a <tt class="docutils literal">committer: ...</tt> line being appended to the commit
message. This value is mutually exclusive with <tt class="docutils literal">messagedifferent</tt>.</p>
<p><tt class="docutils literal">dropcommitter</tt> will remove references to the committer. Only
references to the author will remain. Actions that add references
to the committer will have no effect when this is set.</p>
<p><tt class="docutils literal">replaceauthor</tt> will replace the value of the author field with
the committer. Other actions that add references to the committer
will still take effect when this is set.</p>
<p>The default is <tt class="docutils literal">messagedifferent</tt>.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.git.extrakeys:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first">list of extra keys from commit metadata to copy to
the destination. Some Git repositories store extra metadata in commits.
By default, this non-default metadata will be lost during conversion.
Setting this config option can retain that metadata. Some built-in
keys such as <tt class="docutils literal">parent</tt> and <tt class="docutils literal">branch</tt> are not allowed to be copied.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.git.remoteprefix:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first">remote refs are converted as bookmarks with
<tt class="docutils literal">convert.git.remoteprefix</tt> as a prefix followed by a /. The default
is 'remote'.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.git.saverev:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first">whether to store the original Git commit ID in the
metadata of the destination commit. The default is True.</p>
</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.git.skipsubmodules:</th></tr>
<tr class="field"><td> </td><td class="field-body"><p class="first last">does not convert root level .gitmodules files
or files with 160000 mode indicating a submodule. Default is False.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="perforce-source">
<h4>Perforce Source</h4>
<p>The Perforce (P4) importer can be given a p4 depot path or a
client specification as source. It will convert all files in the
source to a flat Mercurial repository, ignoring labels, branches
and integrations. Note that when a depot path is given you then
usually should specify a target directory, because otherwise the
target may be named <tt class="docutils literal"><span class="pre">...-hg</span></tt>.</p>
<p>The following options can be set with <tt class="docutils literal"><span class="pre">--config</span></tt>:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.p4.encoding:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify the encoding to use when decoding standard
output of the Perforce command line tool. The default is default system
encoding.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.p4.startrev:</th></tr>
<tr class="field"><td> </td><td class="field-body">specify initial Perforce revision (a
Perforce changelist number).</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="mercurial-destination">
<h4>Mercurial Destination</h4>
<p>The Mercurial destination will recognize Mercurial subrepositories in the
destination directory, and update the .hgsubstate file automatically if the
destination subrepositories contain the <dest>/<sub>/.hg/shamap file.
Converting a repository with subrepositories requires converting a single
repository at a time, from the bottom up.</p>
<div class="verbose docutils container">
<p>An example showing how to convert a repository with subrepositories:</p>
<pre class="literal-block">
# so convert knows the type when it sees a non empty destination
$ hg init converted
$ hg convert orig/sub1 converted/sub1
$ hg convert orig/sub2 converted/sub2
$ hg convert orig converted
</pre>
</div>
<p>The following options are supported:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.hg.clonebranches:</th></tr>
<tr class="field"><td> </td><td class="field-body">dispatch source branches in separate
clones. The default is False.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.tagsbranch:</th></tr>
<tr class="field"><td> </td><td class="field-body">branch name for tag revisions, defaults to
<tt class="docutils literal">default</tt>.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.usebranchnames:</th></tr>
<tr class="field"><td> </td><td class="field-body">preserve branch names. The default is
True.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.sourcename:</th></tr>
<tr class="field"><td> </td><td class="field-body">records the given string as a 'convert_source' extra
value on each commit made in the target repository. The default is None.</td>
</tr>
<tr class="field"><th class="field-name" colspan="2">convert.hg.preserve-hash:</th></tr>
<tr class="field"><td> </td><td class="field-body">only works with mercurial sources. Make convert
prevent performance improvement to the list of modified files in commits
when such an improvement would cause the hash of a commit to change.
The default is False.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="all-destinations">
<h4>All Destinations</h4>
<p>All destination types accept the following options:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.skiptags:</th></tr>
<tr class="field"><td> </td><td class="field-body">does not convert tags from the source repo to the target
repo. The default is False.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="subversion-destination">
<h4>Subversion Destination</h4>
<p>Original commit dates are not preserved by default.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name" colspan="2">convert.svn.dangerous-set-commit-dates:</th></tr>
<tr class="field"><td> </td><td class="field-body">preserve original commit dates,
forcefully setting <tt class="docutils literal">svn:date</tt> revision properties. This option is
DANGEROUS and may break some subversion functionality for the resulting
repository (e.g. filtering revisions with date ranges in <tt class="docutils literal">svn log</tt>),
as original commit dates are not guaranteed to be monotonically
increasing.</td>
</tr>
</tbody>
</table>
<p>For commit dates setting to work destination repository must have
<tt class="docutils literal"><span class="pre">pre-revprop-change</span></tt> hook configured to allow setting of <tt class="docutils literal">svn:date</tt>
revision properties. See Subversion documentation for more details.</p>
<p>Options:</p>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--authors <var><FILE></var></span></kbd></td>
</tr>
<tr><td> </td><td>username mapping filename (DEPRECATED) (use --authormap instead)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-s</span>, <span class="option">--source-type <var><TYPE></var></span></kbd></td>
</tr>
<tr><td> </td><td>source repository type</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-d</span>, <span class="option">--dest-type <var><TYPE></var></span></kbd></td>
</tr>
<tr><td> </td><td>destination repository type</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>import up to source revision REV</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--authormap <var><FILE></var></span></kbd></td>
</tr>
<tr><td> </td><td>remap usernames using this file</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--filemap <var><FILE></var></span></kbd></td>
</tr>
<tr><td> </td><td>remap file names using contents of file</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--full</span></kbd></td>
<td>apply filemap changes by converting all files again</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--splicemap <var><FILE></var></span></kbd></td>
</tr>
<tr><td> </td><td>splice synthesized history into place</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--branchmap <var><FILE></var></span></kbd></td>
</tr>
<tr><td> </td><td>change branch names while converting</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--branchsort</span></kbd></td>
<td>try to sort changesets by branches</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--datesort</span></kbd></td>
<td>try to sort changesets by date</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--sourcesort</span></kbd></td>
<td>preserve source changesets order</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--closesort</span></kbd></td>
<td>try to reorder closed revisions</td></tr>
</tbody>
</table>
<p>[+] marked option can be specified multiple times</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
|