hgext/convert/__init__.py
author Mads Kiilerich <madski@unity3d.com>
Tue, 26 Aug 2014 22:03:32 +0200
changeset 22300 35ab037de989
parent 21769 4a54d9f1b6b6
child 22466 e1b68c0a9363
permissions -rw-r--r--
convert: introduce --full for converting all files Convert will normally only process files that were changed in a source revision, apply the filemap, and record it has a change in the target repository. (If it ends up not really changing anything, nothing changes.) That means that _if_ the filemap is changed before continuing an incremental convert, the change will only kick in when the files it affects are modified in a source revision and thus processed. With --full, convert will make a full conversion every time and process all files in the source repo and remove target repo files that shouldn't be there. Filemap changes will thus kick in on the first converted revision, no matter what is changed. This flag should in most cases not make any difference but will make convert significantly slower. Other names has been considered for this feature, such as "resync", "sync", "checkunmodified", "all" or "allfiles", but I found that they were less obvious and required more explanation than "full" and were harder to describe consistently.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
     1
# convert.py Foreign SCM converter
3917
645e1dd4b8ae convert-repo: update usage information
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3911
diff changeset
     2
#
4635
63b9d2deed48 Updated copyright notices and add "and others" to "hg version"
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4591
diff changeset
     3
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
     4
#
8225
46293a0c7e9f updated license to be explicit about GPL version 2
Martin Geisler <mg@lazybytes.net>
parents: 8222
diff changeset
     5
# This software may be used and distributed according to the terms of the
10263
25e572394f5c Update license to GPLv2+
Matt Mackall <mpm@selenic.com>
parents: 9634
diff changeset
     6
# GNU General Public License version 2 or any later version.
8228
eee2319c5895 add blank line after copyright notices and after header
Martin Geisler <mg@lazybytes.net>
parents: 8225
diff changeset
     7
8932
f87884329419 extensions: fix up description lines some more
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8894
diff changeset
     8
'''import revisions from foreign VCS repositories into Mercurial'''
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
     9
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
    10
import convcmd
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
    11
import cvsps
7873
4a4c7f6a5912 cleanup: drop unused imports
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 7823
diff changeset
    12
import subversion
21769
4a54d9f1b6b6 convert: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21244
diff changeset
    13
from mercurial import cmdutil, templatekw
6999
f1546aa94362 i18n, convert: mark command line options for translation
Martin Geisler <mg@daimi.au.dk>
parents: 6976
diff changeset
    14
from mercurial.i18n import _
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
    15
21244
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    16
cmdtable = {}
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    17
command = cmdutil.command(cmdtable)
16743
38caf405d010 hgext: mark all first-party extensions as such
Augie Fackler <raf@durin42.com>
parents: 16683
diff changeset
    18
testedwith = 'internal'
38caf405d010 hgext: mark all first-party extensions as such
Augie Fackler <raf@durin42.com>
parents: 16683
diff changeset
    19
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
    20
# Commands definition was moved elsewhere to ease demandload job.
694
51eb248d3348 Teach convert-repo about tags
mpm@selenic.com
parents: 692
diff changeset
    21
21244
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    22
@command('convert',
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    23
    [('', 'authors', '',
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    24
      _('username mapping filename (DEPRECATED, use --authormap instead)'),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    25
      _('FILE')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    26
    ('s', 'source-type', '', _('source repository type'), _('TYPE')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    27
    ('d', 'dest-type', '', _('destination repository type'), _('TYPE')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    28
    ('r', 'rev', '', _('import up to source revision REV'), _('REV')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    29
    ('A', 'authormap', '', _('remap usernames using this file'), _('FILE')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    30
    ('', 'filemap', '', _('remap file names using contents of file'),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    31
     _('FILE')),
22300
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
    32
    ('', 'full', None,
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
    33
     _('apply filemap changes by converting all files again')),
21244
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    34
    ('', 'splicemap', '', _('splice synthesized history into place'),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    35
     _('FILE')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    36
    ('', 'branchmap', '', _('change branch names while converting'),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    37
     _('FILE')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    38
    ('', 'branchsort', None, _('try to sort changesets by branches')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    39
    ('', 'datesort', None, _('try to sort changesets by date')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    40
    ('', 'sourcesort', None, _('preserve source changesets order')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    41
    ('', 'closesort', None, _('try to reorder closed revisions'))],
21769
4a54d9f1b6b6 convert: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21244
diff changeset
    42
   _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]'),
4a54d9f1b6b6 convert: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21244
diff changeset
    43
   norepo=True)
5281
a176f9c8b26e convert: rename a class and a function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5256
diff changeset
    44
def convert(ui, src, dest=None, revmapfile=None, **opts):
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
    45
    """convert a foreign SCM repository to a Mercurial one.
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
    46
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    47
    Accepted source formats [identifiers]:
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    48
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    49
    - Mercurial [hg]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    50
    - CVS [cvs]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    51
    - Darcs [darcs]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    52
    - git [git]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    53
    - Subversion [svn]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    54
    - Monotone [mtn]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    55
    - GNU Arch [gnuarch]
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents: 6999
diff changeset
    56
    - Bazaar [bzr]
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
    57
    - Perforce [p4]
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
    58
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    59
    Accepted destination formats [identifiers]:
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    60
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    61
    - Mercurial [hg]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    62
    - Subversion [svn] (history on branches is not preserved)
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
    63
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    64
    If no revision is given, all revisions will be converted.
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    65
    Otherwise, convert will only import up to the named revision
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    66
    (given in a format understood by the source).
4760
07efcce17d28 convert: add -r argument specifying latest revision to convert
Brendan Cully <brendan@kublai.com>
parents: 4719
diff changeset
    67
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    68
    If no destination directory name is specified, it defaults to the
12185
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
    69
    basename of the source with ``-hg`` appended. If the destination
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    70
    repository doesn't exist, it will be created.
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
    71
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    72
    By default, all sources except Mercurial will use --branchsort.
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    73
    Mercurial uses --sourcesort to preserve original revision numbers
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    74
    order. Sort modes have the following effects:
9103
9c7a5d70e72f convert: fix inconsistent indentation in help text
Martin Geisler <mg@lazybytes.net>
parents: 9086
diff changeset
    75
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    76
    --branchsort  convert from parent to child revision when possible,
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    77
                  which means branches are usually converted one after
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    78
                  the other. It generates more compact repositories.
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    79
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    80
    --datesort    sort revisions by date. Converted repositories have
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    81
                  good-looking changelogs but are often an order of
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    82
                  magnitude larger than the same ones generated by
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    83
                  --branchsort.
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    84
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    85
    --sourcesort  try to preserve source revisions order, only
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    86
                  supported by Mercurial sources.
8692
827d4e807d57 convert: default revisions order depends on source
Patrick Mezard <pmezard@gmail.com>
parents: 8690
diff changeset
    87
18819
05acdf8e1f23 convert: add closesort algorithm to mercurial sources
Constantine Linnick <theaspect@gmail.com>
parents: 18324
diff changeset
    88
    --closesort   try to move closed revisions as close as possible
05acdf8e1f23 convert: add closesort algorithm to mercurial sources
Constantine Linnick <theaspect@gmail.com>
parents: 18324
diff changeset
    89
                  to parent branches, only supported by Mercurial
05acdf8e1f23 convert: add closesort algorithm to mercurial sources
Constantine Linnick <theaspect@gmail.com>
parents: 18324
diff changeset
    90
                  sources.
05acdf8e1f23 convert: add closesort algorithm to mercurial sources
Constantine Linnick <theaspect@gmail.com>
parents: 18324
diff changeset
    91
12924
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
    92
    If ``REVMAP`` isn't given, it will be put in a default location
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
    93
    (``<dest>/.hg/shamap`` by default). The ``REVMAP`` is a simple
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
    94
    text file that maps each source commit ID to the destination ID
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
    95
    for that revision, like so::
9058
b10cee4bd2c1 convert: wrapped docstrings at 78 characters
Martin Geisler <mg@lazybytes.net>
parents: 8932
diff changeset
    96
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    97
      <source ID> <destination ID>
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
    98
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    99
    If the file doesn't exist, it's automatically created. It's
12186
3417b3d95b05 convert: help string cleanups
Martin Geisler <mg@lazybytes.net>
parents: 12185
diff changeset
   100
    updated on each commit copied, so :hg:`convert` can be interrupted
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   101
    and can be run repeatedly to copy new commits.
4589
451e91ed535e convert extension: Add support for username mapping
Edouard Gomez <ed.gomez@free.fr>
parents: 4588
diff changeset
   102
12198
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
   103
    The authormap is a simple text file that maps each source commit
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
   104
    author to a destination commit author. It is handy for source SCMs
17424
e7cfe3587ea4 fix trivial spelling errors
Mads Kiilerich <mads@kiilerich.com>
parents: 17267
diff changeset
   105
    that use unix logins to identify authors (e.g.: CVS). One line per
12198
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
   106
    author mapping and the line format is::
12184
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   107
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   108
      source author = destination author
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   109
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   110
    Empty lines and lines starting with a ``#`` are ignored.
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
   111
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   112
    The filemap is a file that allows filtering and remapping of files
11523
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   113
    and directories. Each line can contain one of the following
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   114
    directives::
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   115
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   116
      include path/to/file-or-dir
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   117
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   118
      exclude path/to/file-or-dir
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
   119
11523
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   120
      rename path/to/source path/to/destination
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
   121
12188
6045d467abd7 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12187 12186
diff changeset
   122
    Comment lines start with ``#``. A specified path matches if it
11523
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   123
    equals the full relative name of a file or one of its parent
12185
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   124
    directories. The ``include`` or ``exclude`` directive with the
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   125
    longest matching path applies, so line order does not matter.
5760
0145f9afb0e7 Removed tabs and trailing whitespace in python files
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5632
diff changeset
   126
12185
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   127
    The ``include`` directive causes a file, or all files under a
20784
7f4cf938643d convert: more clear documentation of the 'include' default of a 'include .'
Mads Kiilerich <madski@unity3d.com>
parents: 19891
diff changeset
   128
    directory, to be included in the destination repository. The default
7f4cf938643d convert: more clear documentation of the 'include' default of a 'include .'
Mads Kiilerich <madski@unity3d.com>
parents: 19891
diff changeset
   129
    if there are no ``include`` statements is to include everything.
7f4cf938643d convert: more clear documentation of the 'include' default of a 'include .'
Mads Kiilerich <madski@unity3d.com>
parents: 19891
diff changeset
   130
    If there are any ``include`` statements, nothing else is included.
7f4cf938643d convert: more clear documentation of the 'include' default of a 'include .'
Mads Kiilerich <madski@unity3d.com>
parents: 19891
diff changeset
   131
    The ``exclude`` directive causes files or directories to
12185
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   132
    be omitted. The ``rename`` directive renames a file or directory if
11685
aade8f133d11 cleanup: typos
Patrick Mezard <pmezard@gmail.com>
parents: 11523
diff changeset
   133
    it is converted. To rename from a subdirectory into the root of
12188
6045d467abd7 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12187 12186
diff changeset
   134
    the repository, use ``.`` as the path to rename to.
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   135
22300
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   136
    ``--full`` will make sure the converted changesets contain exactly
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   137
    the right files with the right content. It will make a full
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   138
    conversion of all files, not just the ones that have
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   139
    changed. Files that already are correct will not be changed. This
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   140
    can be used to apply filemap changes when converting
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   141
    incrementally. This is currently only supported for Mercurial and
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   142
    Subversion.
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   143
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   144
    The splicemap is a file that allows insertion of synthetic
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   145
    history, letting you specify the parents of a revision. This is
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   146
    useful if you want to e.g. give a Subversion merge two parents, or
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   147
    graft two disconnected series of history together. Each entry
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   148
    contains a key, followed by a space, followed by one or two
12184
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   149
    comma-separated values::
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   150
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   151
      key parent1, parent2
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   152
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   153
    The key is the revision ID in the source
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   154
    revision control system whose parents should be modified (same
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   155
    format as a key in .hg/shamap). The values are the revision IDs
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   156
    (in either the source or destination revision control system) that
9634
fbde669564d8 convert: document parent order in splicemap help (issue1764)
Martin Geisler <mg@lazybytes.net>
parents: 9543
diff changeset
   157
    should be used as the new parents for that node. For example, if
fbde669564d8 convert: document parent order in splicemap help (issue1764)
Martin Geisler <mg@lazybytes.net>
parents: 9543
diff changeset
   158
    you have merged "release-1.0" into "trunk", then you should
fbde669564d8 convert: document parent order in splicemap help (issue1764)
Martin Geisler <mg@lazybytes.net>
parents: 9543
diff changeset
   159
    specify the revision on "trunk" as the first parent and the one on
fbde669564d8 convert: document parent order in splicemap help (issue1764)
Martin Geisler <mg@lazybytes.net>
parents: 9543
diff changeset
   160
    the "release-1.0" branch as the second.
6143
5b159ebb19cf convert: document splicemap, allow setting of multiple parents
Bryan O'Sullivan <bos@serpentine.com>
parents: 6035
diff changeset
   161
8377
29f4f0d66cd5 convert: adding branchmap functionality to convert extension
Michael J. Pedersen <m.pedersen@icelus.org>
parents: 8228
diff changeset
   162
    The branchmap is a file that allows you to rename a branch when it is
29f4f0d66cd5 convert: adding branchmap functionality to convert extension
Michael J. Pedersen <m.pedersen@icelus.org>
parents: 8228
diff changeset
   163
    being brought in from whatever external repository. When used in
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   164
    conjunction with a splicemap, it allows for a powerful combination
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   165
    to help fix even the most badly mismanaged repositories and turn them
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   166
    into nicely structured Mercurial repositories. The branchmap contains
12184
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   167
    lines of the form::
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   168
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   169
      original_branch_name new_branch_name
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   170
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   171
    where "original_branch_name" is the name of the branch in the
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   172
    source repository, and "new_branch_name" is the name of the branch
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   173
    is the destination repository. No whitespace is allowed in the
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   174
    branch names. This can be used to (for instance) move code in one
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   175
    repository from "default" to a named branch.
8377
29f4f0d66cd5 convert: adding branchmap functionality to convert extension
Michael J. Pedersen <m.pedersen@icelus.org>
parents: 8228
diff changeset
   176
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   177
    Mercurial Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   178
    ################
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   179
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   180
    The Mercurial source recognizes the following configuration
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   181
    options, which you can set on the command line with ``--config``:
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   182
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   183
    :convert.hg.ignoreerrors: ignore integrity errors when reading.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   184
        Use it to fix Mercurial repositories with missing revlogs, by
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   185
        converting from and to Mercurial. Default is False.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   186
13429
0079fb98e8d0 convert: fix typos in docstring
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 12924
diff changeset
   187
    :convert.hg.saverev: store original revision ID in changeset
15300
c2a75faf3b49 convert: fix typo
Eli Carter <eli.carter@tektronix.com>
parents: 13698
diff changeset
   188
        (forces target IDs to change). It takes a boolean argument and
c2a75faf3b49 convert: fix typo
Eli Carter <eli.carter@tektronix.com>
parents: 13698
diff changeset
   189
        defaults to False.
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   190
19891
e271970b9821 convert: introduce hg.revs to replace hg.startrev and --rev with a revset
Mads Kiilerich <madski@unity3d.com>
parents: 19864
diff changeset
   191
    :convert.hg.revs: revset specifying the source revisions to convert.
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   192
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   193
    CVS Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   194
    ##########
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   195
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   196
    CVS source will use a sandbox (i.e. a checked-out copy) from CVS
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   197
    to indicate the starting point of what will be converted. Direct
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   198
    access to the repository files is not needed, unless of course the
12924
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   199
    repository is ``:local:``. The conversion uses the top level
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   200
    directory in the sandbox to find the CVS repository, and then uses
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   201
    CVS rlog commands to find files to convert. This means that unless
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   202
    a filemap is given, all files under the starting directory will be
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   203
    converted, and that any directory reorganization in the CVS
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   204
    sandbox is ignored.
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   205
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   206
    The following options can be used with ``--config``:
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   207
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   208
    :convert.cvsps.cache: Set to False to disable remote log caching,
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   209
        for testing and debugging purposes. Default is True.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   210
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   211
    :convert.cvsps.fuzz: Specify the maximum time (in seconds) that is
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   212
        allowed between commits with identical user and log message in
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   213
        a single changeset. When very large files were checked in as
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   214
        part of a changeset then the default may not be long enough.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   215
        The default is 60.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   216
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   217
    :convert.cvsps.mergeto: Specify a regular expression to which
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   218
        commit log messages are matched. If a match occurs, then the
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   219
        conversion process will insert a dummy revision merging the
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   220
        branch on which this log message occurs to the branch
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   221
        indicated in the regex. Default is ``{{mergetobranch
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   222
        ([-\\w]+)}}``
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   223
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   224
    :convert.cvsps.mergefrom: Specify a regular expression to which
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   225
        commit log messages are matched. If a match occurs, then the
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   226
        conversion process will add the most recent revision on the
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   227
        branch indicated in the regex as the second parent of the
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   228
        changeset. Default is ``{{mergefrombranch ([-\\w]+)}}``
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   229
17974
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   230
    :convert.localtimezone: use local time (as determined by the TZ
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   231
        environment variable) for changeset date/times. The default
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   232
        is False (use UTC).
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   233
18321
c51d2bc7a5d7 convert: correct 'hooks' section name in online help
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17424
diff changeset
   234
    :hooks.cvslog: Specify a Python function to be called at the end of
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   235
        gathering the CVS log. The function is passed a list with the
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   236
        log entries, and can modify the entries in-place, or add or
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   237
        delete them.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   238
18321
c51d2bc7a5d7 convert: correct 'hooks' section name in online help
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17424
diff changeset
   239
    :hooks.cvschangesets: Specify a Python function to be called after
17251
98166640b356 help: fix some instances of 'the the'
Mads Kiilerich <mads@kiilerich.com>
parents: 16743
diff changeset
   240
        the changesets are calculated from the CVS log. The
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   241
        function is passed a list with the changeset entries, and can
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   242
        modify the changesets in-place, or add or delete them.
6923
ebf1462f2145 strip trailing whitespace, replace tabs by spaces
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 6885
diff changeset
   243
9472
a15813fae0a8 convert/cvs: update debugcvsps documentation
Patrick Mezard <pmezard@gmail.com>
parents: 9256
diff changeset
   244
    An additional "debugcvsps" Mercurial command allows the builtin
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   245
    changeset merging code to be run without doing a conversion. Its
9472
a15813fae0a8 convert/cvs: update debugcvsps documentation
Patrick Mezard <pmezard@gmail.com>
parents: 9256
diff changeset
   246
    parameters and output are similar to that of cvsps 2.1. Please see
a15813fae0a8 convert/cvs: update debugcvsps documentation
Patrick Mezard <pmezard@gmail.com>
parents: 9256
diff changeset
   247
    the command help for more details.
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   248
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   249
    Subversion Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   250
    #################
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   251
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   252
    Subversion source detects classical trunk/branches/tags layouts.
12924
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   253
    By default, the supplied ``svn://repo/path/`` source URL is
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   254
    converted as a single branch. If ``svn://repo/path/trunk`` exists
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   255
    it replaces the default branch. If ``svn://repo/path/branches``
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   256
    exists, its subdirectories are listed as possible branches. If
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   257
    ``svn://repo/path/tags`` exists, it is looked for tags referencing
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   258
    converted branches. Default ``trunk``, ``branches`` and ``tags``
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   259
    values can be overridden with following options. Set them to paths
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   260
    relative to the source URL, or leave them blank to disable auto
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   261
    detection.
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   262
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   263
    The following options can be set with ``--config``:
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   264
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   265
    :convert.svn.branches: specify the directory containing branches.
13494
3178aca36b0f convert.svn: branch name which equals trunk means `default' branch (issue2653)
Pavel Boldin <boldin.pavel@gmail.com>
parents: 13429
diff changeset
   266
        The default is ``branches``.
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   267
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   268
    :convert.svn.tags: specify the directory containing tags. The
12924
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   269
        default is ``tags``.
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   270
13494
3178aca36b0f convert.svn: branch name which equals trunk means `default' branch (issue2653)
Pavel Boldin <boldin.pavel@gmail.com>
parents: 13429
diff changeset
   271
    :convert.svn.trunk: specify the name of the trunk branch. The
3178aca36b0f convert.svn: branch name which equals trunk means `default' branch (issue2653)
Pavel Boldin <boldin.pavel@gmail.com>
parents: 13429
diff changeset
   272
        default is ``trunk``.
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   273
17974
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   274
    :convert.localtimezone: use local time (as determined by the TZ
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   275
        environment variable) for changeset date/times. The default
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   276
        is False (use UTC).
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   277
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   278
    Source history can be retrieved starting at a specific revision,
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   279
    instead of being integrally converted. Only single branch
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   280
    conversions are supported.
6173
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents: 6172
diff changeset
   281
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   282
    :convert.svn.startrev: specify start Subversion revision number.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   283
        The default is 0.
6173
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents: 6172
diff changeset
   284
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   285
    Perforce Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   286
    ###############
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   287
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   288
    The Perforce (P4) importer can be given a p4 depot path or a
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   289
    client specification as source. It will convert all files in the
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   290
    source to a flat Mercurial repository, ignoring labels, branches
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   291
    and integrations. Note that when a depot path is given you then
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   292
    usually should specify a target directory, because otherwise the
12924
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   293
    target may be named ``...-hg``.
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   294
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   295
    It is possible to limit the amount of source history to be
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   296
    converted by specifying an initial Perforce revision:
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   297
13429
0079fb98e8d0 convert: fix typos in docstring
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 12924
diff changeset
   298
    :convert.p4.startrev: specify initial Perforce revision (a
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   299
        Perforce changelist number).
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   300
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   301
    Mercurial Destination
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   302
    #####################
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   303
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   304
    The following options are supported:
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   305
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   306
    :convert.hg.clonebranches: dispatch source branches in separate
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   307
        clones. The default is False.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   308
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   309
    :convert.hg.tagsbranch: branch name for tag revisions, defaults to
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   310
        ``default``.
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   311
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   312
    :convert.hg.usebranchnames: preserve branch names. The default is
13429
0079fb98e8d0 convert: fix typos in docstring
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 12924
diff changeset
   313
        True.
4958
71fed370b7a7 Backout ad09ce1d393c and replace ''' with """ to make some highlighting happy.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4957
diff changeset
   314
    """
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
   315
    return convcmd.convert(ui, src, dest, revmapfile, **opts)
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
   316
21769
4a54d9f1b6b6 convert: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21244
diff changeset
   317
@command('debugsvnlog', [], 'hg debugsvnlog', norepo=True)
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
   318
def debugsvnlog(ui, **opts):
7873
4a4c7f6a5912 cleanup: drop unused imports
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 7823
diff changeset
   319
    return subversion.debugsvnlog(ui, **opts)
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
   320
21244
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   321
@command('debugcvsps',
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   322
    [
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   323
    # Main options shared with cvsps-2.1
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   324
    ('b', 'branches', [], _('only return changes on specified branches')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   325
    ('p', 'prefix', '', _('prefix to remove from file names')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   326
    ('r', 'revisions', [],
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   327
     _('only return changes after or between specified tags')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   328
    ('u', 'update-cache', None, _("update cvs log cache")),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   329
    ('x', 'new-cache', None, _("create new cvs log cache")),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   330
    ('z', 'fuzz', 60, _('set commit time fuzz in seconds')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   331
    ('', 'root', '', _('specify cvsroot')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   332
    # Options specific to builtin cvsps
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   333
    ('', 'parents', '', _('show parent changesets')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   334
    ('', 'ancestors', '', _('show current changeset in ancestor branches')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   335
    # Options that are ignored for compatibility with cvsps-2.1
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   336
    ('A', 'cvs-direct', None, _('ignored for compatibility')),
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   337
    ],
21769
4a54d9f1b6b6 convert: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21244
diff changeset
   338
    _('hg debugcvsps [OPTION]... [PATH]...'),
4a54d9f1b6b6 convert: define norepo in command decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21244
diff changeset
   339
    norepo=True)
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   340
def debugcvsps(ui, *args, **opts):
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   341
    '''create changeset information from CVS
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   342
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   343
    This command is intended as a debugging tool for the CVS to
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   344
    Mercurial converter, and can be used as a direct replacement for
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   345
    cvsps.
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   346
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   347
    Hg debugcvsps reads the CVS rlog for current directory (or any
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   348
    named directory) in the CVS repository, and converts the log to a
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   349
    series of changesets based on matching commit log entries and
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   350
    dates.'''
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   351
    return cvsps.debugcvsps(ui, *args, **opts)
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   352
13691
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   353
def kwconverted(ctx, name):
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   354
    rev = ctx.extra().get('convert_revision', '')
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   355
    if rev.startswith('svn:'):
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   356
        if name == 'svnrev':
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   357
            return str(subversion.revsplit(rev)[2])
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   358
        elif name == 'svnpath':
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   359
            return subversion.revsplit(rev)[1]
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   360
        elif name == 'svnuuid':
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   361
            return subversion.revsplit(rev)[0]
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   362
    return rev
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   363
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   364
def kwsvnrev(repo, ctx, **args):
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   365
    """:svnrev: String. Converted subversion revision number."""
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   366
    return kwconverted(ctx, 'svnrev')
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   367
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   368
def kwsvnpath(repo, ctx, **args):
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   369
    """:svnpath: String. Converted subversion revision project path."""
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   370
    return kwconverted(ctx, 'svnpath')
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   371
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   372
def kwsvnuuid(repo, ctx, **args):
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   373
    """:svnuuid: String. Converted subversion revision repository identifier."""
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   374
    return kwconverted(ctx, 'svnuuid')
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   375
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   376
def extsetup(ui):
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   377
    templatekw.keywords['svnrev'] = kwsvnrev
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   378
    templatekw.keywords['svnpath'] = kwsvnpath
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   379
    templatekw.keywords['svnuuid'] = kwsvnuuid
13698
f30ce5983896 i18n: register new template keywords for translation
Patrick Mezard <pmezard@gmail.com>
parents: 13691
diff changeset
   380
f30ce5983896 i18n: register new template keywords for translation
Patrick Mezard <pmezard@gmail.com>
parents: 13691
diff changeset
   381
# tell hggettext to extract docstrings from these functions:
f30ce5983896 i18n: register new template keywords for translation
Patrick Mezard <pmezard@gmail.com>
parents: 13691
diff changeset
   382
i18nfunctions = [kwsvnrev, kwsvnpath, kwsvnuuid]