hgext/convert/__init__.py
author Manuel Jacob <me@manueljacob.de>
Thu, 15 Sep 2022 01:48:38 +0200
changeset 49494 c96ed4029fda
parent 48875 6000f5b25c9b
permissions -rw-r--r--
templates: add filter to reverse list The filter supports only lists because for lists, it’s straightforward to implement. Reversing text doesn’t seem very useful and is hard to implement. Reversing the bytes would break multi-bytes encodings. Reversing the code points would break characters consisting of multiple code points. Reversing graphemes is non-trivial without using a library not included in the standard library.
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
#
46819
d4ba4d51f85f contributor: change mentions of mpm to olivia
Raphaël Gomès <rgomes@octobus.net>
parents: 46400
diff changeset
     3
# Copyright 2005-2007 Olivia Mackall <olivia@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
28414
4817c17a11a2 convert: __init__ use absolute_import
timeless <timeless@mozdev.org>
parents: 26370
diff changeset
    10
29205
a0939666b836 py3: move up symbol imports to enforce import-checker rules
Yuya Nishihara <yuya@tcha.org>
parents: 28540
diff changeset
    11
from mercurial.i18n import _
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    12
from mercurial import registrar
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
    13
28414
4817c17a11a2 convert: __init__ use absolute_import
timeless <timeless@mozdev.org>
parents: 26370
diff changeset
    14
from . import (
4817c17a11a2 convert: __init__ use absolute_import
timeless <timeless@mozdev.org>
parents: 26370
diff changeset
    15
    convcmd,
4817c17a11a2 convert: __init__ use absolute_import
timeless <timeless@mozdev.org>
parents: 26370
diff changeset
    16
    cvsps,
4817c17a11a2 convert: __init__ use absolute_import
timeless <timeless@mozdev.org>
parents: 26370
diff changeset
    17
    subversion,
4817c17a11a2 convert: __init__ use absolute_import
timeless <timeless@mozdev.org>
parents: 26370
diff changeset
    18
)
4817c17a11a2 convert: __init__ use absolute_import
timeless <timeless@mozdev.org>
parents: 26370
diff changeset
    19
21244
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
    20
cmdtable = {}
32337
46ba2cdda476 registrar: move cmdutil.command to registrar module (API)
Yuya Nishihara <yuya@tcha.org>
parents: 30815
diff changeset
    21
command = registrar.command(cmdtable)
29841
d5883fd055c6 extensions: change magic "shipped with hg" string
Augie Fackler <augie@google.com>
parents: 29205
diff changeset
    22
# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
25186
80c5b2666a96 extensions: document that `testedwith = 'internal'` is special
Augie Fackler <augie@google.com>
parents: 22512
diff changeset
    23
# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
80c5b2666a96 extensions: document that `testedwith = 'internal'` is special
Augie Fackler <augie@google.com>
parents: 22512
diff changeset
    24
# be specifying the version(s) of Mercurial they are tested with, or
80c5b2666a96 extensions: document that `testedwith = 'internal'` is special
Augie Fackler <augie@google.com>
parents: 22512
diff changeset
    25
# leave the attribute unspecified.
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    26
testedwith = b'ships-with-hg-core'
16743
38caf405d010 hgext: mark all first-party extensions as such
Augie Fackler <raf@durin42.com>
parents: 16683
diff changeset
    27
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
    28
# Commands definition was moved elsewhere to ease demandload job.
694
51eb248d3348 Teach convert-repo about tags
mpm@selenic.com
parents: 692
diff changeset
    29
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    30
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    31
@command(
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    32
    b'convert',
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    33
    [
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    34
        (
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    35
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    36
            b'authors',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    37
            b'',
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    38
            _(
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    39
                b'username mapping filename (DEPRECATED) (use --authormap instead)'
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    40
            ),
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    41
            _(b'FILE'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    42
        ),
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    43
        (b's', b'source-type', b'', _(b'source repository type'), _(b'TYPE')),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    44
        (
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    45
            b'd',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    46
            b'dest-type',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    47
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    48
            _(b'destination repository type'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    49
            _(b'TYPE'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    50
        ),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    51
        (b'r', b'rev', [], _(b'import up to source revision REV'), _(b'REV')),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    52
        (
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    53
            b'A',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    54
            b'authormap',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    55
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    56
            _(b'remap usernames using this file'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    57
            _(b'FILE'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    58
        ),
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    59
        (
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    60
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    61
            b'filemap',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    62
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    63
            _(b'remap file names using contents of file'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    64
            _(b'FILE'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    65
        ),
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    66
        (
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    67
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    68
            b'full',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    69
            None,
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    70
            _(b'apply filemap changes by converting all files again'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    71
        ),
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    72
        (
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    73
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    74
            b'splicemap',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    75
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    76
            _(b'splice synthesized history into place'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    77
            _(b'FILE'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    78
        ),
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    79
        (
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    80
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    81
            b'branchmap',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    82
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    83
            _(b'change branch names while converting'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    84
            _(b'FILE'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    85
        ),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    86
        (b'', b'branchsort', None, _(b'try to sort changesets by branches')),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    87
        (b'', b'datesort', None, _(b'try to sort changesets by date')),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    88
        (b'', b'sourcesort', None, _(b'preserve source changesets order')),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    89
        (b'', b'closesort', None, _(b'try to reorder closed revisions')),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    90
    ],
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
    91
    _(b'hg convert [OPTION]... SOURCE [DEST [REVMAP]]'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    92
    norepo=True,
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
    93
)
5281
a176f9c8b26e convert: rename a class and a function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5256
diff changeset
    94
def convert(ui, src, dest=None, revmapfile=None, **opts):
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
    95
    """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
    96
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    97
    Accepted source formats [identifiers]:
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    98
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    99
    - Mercurial [hg]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   100
    - CVS [cvs]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   101
    - Darcs [darcs]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   102
    - git [git]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   103
    - Subversion [svn]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   104
    - Monotone [mtn]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   105
    - GNU Arch [gnuarch]
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents: 6999
diff changeset
   106
    - Bazaar [bzr]
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   107
    - Perforce [p4]
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
   108
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   109
    Accepted destination formats [identifiers]:
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
   110
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   111
    - Mercurial [hg]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
   112
    - 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
   113
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   114
    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
   115
    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
   116
    (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
   117
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   118
    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
   119
    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
   120
    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
   121
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   122
    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
   123
    Mercurial uses --sourcesort to preserve original revision numbers
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   124
    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
   125
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   126
    --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
   127
                  which means branches are usually converted one after
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   128
                  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
   129
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
   130
    --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
   131
                  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
   132
                  magnitude larger than the same ones generated by
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   133
                  --branchsort.
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
   134
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   135
    --sourcesort  try to preserve source revisions order, only
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   136
                  supported by Mercurial sources.
8692
827d4e807d57 convert: default revisions order depends on source
Patrick Mezard <pmezard@gmail.com>
parents: 8690
diff changeset
   137
18819
05acdf8e1f23 convert: add closesort algorithm to mercurial sources
Constantine Linnick <theaspect@gmail.com>
parents: 18324
diff changeset
   138
    --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
   139
                  to parent branches, only supported by Mercurial
05acdf8e1f23 convert: add closesort algorithm to mercurial sources
Constantine Linnick <theaspect@gmail.com>
parents: 18324
diff changeset
   140
                  sources.
05acdf8e1f23 convert: add closesort algorithm to mercurial sources
Constantine Linnick <theaspect@gmail.com>
parents: 18324
diff changeset
   141
12924
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   142
    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
   143
    (``<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
   144
    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
   145
    for that revision, like so::
9058
b10cee4bd2c1 convert: wrapped docstrings at 78 characters
Martin Geisler <mg@lazybytes.net>
parents: 8932
diff changeset
   146
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
   147
      <source ID> <destination ID>
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
   148
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   149
    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
   150
    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
   151
    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
   152
12198
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
   153
    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
   154
    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
   155
    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
   156
    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
   157
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   158
      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
   159
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   160
    Empty lines and lines starting with a ``#`` are ignored.
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
   161
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   162
    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
   163
    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
   164
    directives::
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   165
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   166
      include path/to/file-or-dir
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   167
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   168
      exclude path/to/file-or-dir
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
   169
11523
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
   170
      rename path/to/source path/to/destination
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
   171
12188
6045d467abd7 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12187 12186
diff changeset
   172
    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
   173
    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
   174
    directories. The ``include`` or ``exclude`` directive with the
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   175
    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
   176
12185
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   177
    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
   178
    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
   179
    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
   180
    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
   181
    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
   182
    be omitted. The ``rename`` directive renames a file or directory if
11685
aade8f133d11 cleanup: typos
Patrick Mezard <pmezard@gmail.com>
parents: 11523
diff changeset
   183
    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
   184
    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
   185
22300
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   186
    ``--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
   187
    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
   188
    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
   189
    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
   190
    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
   191
    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
   192
    Subversion.
35ab037de989 convert: introduce --full for converting all files
Mads Kiilerich <madski@unity3d.com>
parents: 21769
diff changeset
   193
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   194
    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
   195
    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
   196
    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
   197
    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
   198
    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
   199
    comma-separated values::
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   200
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   201
      key parent1, parent2
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   202
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   203
    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
   204
    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
   205
    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
   206
    (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
   207
    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
   208
    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
   209
    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
   210
    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
   211
8377
29f4f0d66cd5 convert: adding branchmap functionality to convert extension
Michael J. Pedersen <m.pedersen@icelus.org>
parents: 8228
diff changeset
   212
    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
   213
    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
   214
    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
   215
    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
   216
    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
   217
    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
   218
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   219
      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
   220
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   221
    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
   222
    source repository, and "new_branch_name" is the name of the branch
32755
3a57bfd369d4 convert: correct the documentation about whitespace in branchmap branches
Matt Harbison <matt_harbison@yahoo.com>
parents: 32337
diff changeset
   223
    is the destination repository. No whitespace is allowed in the new
3a57bfd369d4 convert: correct the documentation about whitespace in branchmap branches
Matt Harbison <matt_harbison@yahoo.com>
parents: 32337
diff changeset
   224
    branch name. This can be used to (for instance) move code in one
12184
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   225
    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
   226
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   227
    Mercurial Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   228
    ################
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   229
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   230
    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
   231
    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
   232
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   233
    :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
   234
        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
   235
        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
   236
13429
0079fb98e8d0 convert: fix typos in docstring
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 12924
diff changeset
   237
    :convert.hg.saverev: store original revision ID in changeset
15300
c2a75faf3b49 convert: fix typo
Eli Carter <eli.carter@tektronix.com>
parents: 13698
diff changeset
   238
        (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
   239
        defaults to False.
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   240
25880
6fb55c6c6562 convert: document convert.hg.startrev
Matt Harbison <matt_harbison@yahoo.com>
parents: 25787
diff changeset
   241
    :convert.hg.startrev: specify the initial Mercurial revision.
6fb55c6c6562 convert: document convert.hg.startrev
Matt Harbison <matt_harbison@yahoo.com>
parents: 25787
diff changeset
   242
        The default is 0.
6fb55c6c6562 convert: document convert.hg.startrev
Matt Harbison <matt_harbison@yahoo.com>
parents: 25787
diff changeset
   243
19891
e271970b9821 convert: introduce hg.revs to replace hg.startrev and --rev with a revset
Mads Kiilerich <madski@unity3d.com>
parents: 19864
diff changeset
   244
    :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
   245
38572
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   246
    Bazaar Source
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   247
    #############
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   248
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   249
    The following options can be used with ``--config``:
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   250
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   251
    :convert.bzr.saverev: whether to store the original Bazaar commit ID in
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   252
        the metadata of the destination commit. The default is True.
85da230c316a convert: add a config knob for not saving the bzr revision
Matt Harbison <matt_harbison@yahoo.com>
parents: 37658
diff changeset
   253
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   254
    CVS Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   255
    ##########
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   256
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   257
    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
   258
    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
   259
    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
   260
    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
   261
    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
   262
    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
   263
    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
   264
    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
   265
    sandbox is ignored.
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   266
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   267
    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
   268
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   269
    :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
   270
        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
   271
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   272
    :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
   273
        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
   274
        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
   275
        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
   276
        The default is 60.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   277
33388
0823f0983eaa convert: transcode CVS log messages by specified encoding (issue5597)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32755
diff changeset
   278
    :convert.cvsps.logencoding: Specify encoding name to be used for
0823f0983eaa convert: transcode CVS log messages by specified encoding (issue5597)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32755
diff changeset
   279
        transcoding CVS log messages. Multiple encoding names can be
0823f0983eaa convert: transcode CVS log messages by specified encoding (issue5597)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32755
diff changeset
   280
        specified as a list (see :hg:`help config.Syntax`), but only
0823f0983eaa convert: transcode CVS log messages by specified encoding (issue5597)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32755
diff changeset
   281
        the first acceptable encoding in the list is used per CVS log
0823f0983eaa convert: transcode CVS log messages by specified encoding (issue5597)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32755
diff changeset
   282
        entries. This transcoding is executed before cvslog hook below.
0823f0983eaa convert: transcode CVS log messages by specified encoding (issue5597)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 32755
diff changeset
   283
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   284
    :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
   285
        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
   286
        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
   287
        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
   288
        indicated in the regex. Default is ``{{mergetobranch
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   289
        ([-\\w]+)}}``
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   290
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   291
    :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
   292
        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
   293
        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
   294
        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
   295
        changeset. Default is ``{{mergefrombranch ([-\\w]+)}}``
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   296
17974
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   297
    :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
   298
        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
   299
        is False (use UTC).
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   300
18321
c51d2bc7a5d7 convert: correct 'hooks' section name in online help
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17424
diff changeset
   301
    :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
   302
        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
   303
        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
   304
        delete them.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   305
18321
c51d2bc7a5d7 convert: correct 'hooks' section name in online help
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17424
diff changeset
   306
    :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
   307
        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
   308
        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
   309
        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
   310
9472
a15813fae0a8 convert/cvs: update debugcvsps documentation
Patrick Mezard <pmezard@gmail.com>
parents: 9256
diff changeset
   311
    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
   312
    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
   313
    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
   314
    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
   315
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   316
    Subversion Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   317
    #################
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   318
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   319
    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
   320
    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
   321
    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
   322
    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
   323
    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
   324
    ``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
   325
    converted branches. Default ``trunk``, ``branches`` and ``tags``
2f1174b2c4fa convert: better ReST markup in docstring
Martin Geisler <mg@aragost.com>
parents: 12923
diff changeset
   326
    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
   327
    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
   328
    detection.
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   329
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   330
    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
   331
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   332
    :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
   333
        The default is ``branches``.
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   334
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   335
    :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
   336
        default is ``tags``.
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   337
13494
3178aca36b0f convert.svn: branch name which equals trunk means `default' branch (issue2653)
Pavel Boldin <boldin.pavel@gmail.com>
parents: 13429
diff changeset
   338
    :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
   339
        default is ``trunk``.
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   340
17974
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   341
    :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
   342
        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
   343
        is False (use UTC).
337d728e644f convert: add config option to use the local time zone
Julian Cowley <julian@lava.net>
parents: 17424
diff changeset
   344
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   345
    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
   346
    instead of being integrally converted. Only single branch
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   347
    conversions are supported.
6173
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents: 6172
diff changeset
   348
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   349
    :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
   350
        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
   351
22466
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   352
    Git Source
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   353
    ##########
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   354
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   355
    The Git importer converts commits from all reachable branches (refs
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   356
    in refs/heads) and remotes (refs in refs/remotes) to Mercurial.
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   357
    Branches are converted to bookmarks with the same name, with the
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   358
    leading 'refs/heads' stripped. Git submodules are converted to Git
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   359
    subrepos in Mercurial.
e1b68c0a9363 convert: add initial docs for git sources
Siddharth Agarwal <sid0@fb.com>
parents: 22300
diff changeset
   360
22470
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   361
    The following options can be set with ``--config``:
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   362
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   363
    :convert.git.similarity: specify how similar files modified in a
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   364
        commit must be to be imported as renames or copies, as a
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   365
        percentage between ``0`` (disabled) and ``100`` (files must be
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   366
        identical). For example, ``90`` means that a delete/add pair will
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   367
        be imported as a rename if more than 90% of the file hasn't
22512
6b6da715cb96 convert: change default for git rename detection to 50%
Siddharth Agarwal <sid0@fb.com>
parents: 22471
diff changeset
   368
        changed. The default is ``50``.
22470
8e0c4df28eec convert: add support to detect git renames and copies
Siddharth Agarwal <sid0@fb.com>
parents: 22466
diff changeset
   369
22471
cc5f94db672b convert: add support to find git copies from all files in the working copy
Siddharth Agarwal <sid0@fb.com>
parents: 22470
diff changeset
   370
    :convert.git.findcopiesharder: while detecting copies, look at all
cc5f94db672b convert: add support to find git copies from all files in the working copy
Siddharth Agarwal <sid0@fb.com>
parents: 22470
diff changeset
   371
        files in the working copy instead of just changed ones. This
cc5f94db672b convert: add support to find git copies from all files in the working copy
Siddharth Agarwal <sid0@fb.com>
parents: 22470
diff changeset
   372
        is very expensive for large projects, and is only effective when
cc5f94db672b convert: add support to find git copies from all files in the working copy
Siddharth Agarwal <sid0@fb.com>
parents: 22470
diff changeset
   373
        ``convert.git.similarity`` is greater than 0. The default is False.
cc5f94db672b convert: add support to find git copies from all files in the working copy
Siddharth Agarwal <sid0@fb.com>
parents: 22470
diff changeset
   374
30646
ea3540e66fd8 convert: config option for git rename limit
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29841
diff changeset
   375
    :convert.git.renamelimit: perform rename and copy detection up to this
ea3540e66fd8 convert: config option for git rename limit
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29841
diff changeset
   376
        many changed files in a commit. Increasing this will make rename
ea3540e66fd8 convert: config option for git rename limit
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29841
diff changeset
   377
        and copy detection more accurate but will significantly slow down
ea3540e66fd8 convert: config option for git rename limit
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29841
diff changeset
   378
        computation on large projects. The option is only relevant if
ea3540e66fd8 convert: config option for git rename limit
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29841
diff changeset
   379
        ``convert.git.similarity`` is greater than 0. The default is
ea3540e66fd8 convert: config option for git rename limit
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29841
diff changeset
   380
        ``400``.
ea3540e66fd8 convert: config option for git rename limit
Gregory Szorc <gregory.szorc@gmail.com>
parents: 29841
diff changeset
   381
30813
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   382
    :convert.git.committeractions: list of actions to take when processing
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   383
        author and committer values.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   384
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   385
        Git commits have separate author (who wrote the commit) and committer
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   386
        (who applied the commit) fields. Not all destinations support separate
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   387
        author and committer fields (including Mercurial). This config option
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   388
        controls what to do with these author and committer fields during
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   389
        conversion.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   390
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   391
        A value of ``messagedifferent`` will append a ``committer: ...``
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   392
        line to the commit message if the Git committer is different from the
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   393
        author. The prefix of that line can be specified using the syntax
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   394
        ``messagedifferent=<prefix>``. e.g. ``messagedifferent=git-committer:``.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   395
        When a prefix is specified, a space will always be inserted between the
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   396
        prefix and the value.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   397
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   398
        ``messagealways`` behaves like ``messagedifferent`` except it will
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   399
        always result in a ``committer: ...`` line being appended to the commit
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   400
        message. This value is mutually exclusive with ``messagedifferent``.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   401
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   402
        ``dropcommitter`` will remove references to the committer. Only
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   403
        references to the author will remain. Actions that add references
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   404
        to the committer will have no effect when this is set.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   405
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   406
        ``replaceauthor`` will replace the value of the author field with
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   407
        the committer. Other actions that add references to the committer
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   408
        will still take effect when this is set.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   409
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   410
        The default is ``messagedifferent``.
2cbbd4622ab0 convert: config option to control Git committer actions
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30661
diff changeset
   411
30660
1f21a6835604 convert: add config option to copy extra keys from Git commits
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30646
diff changeset
   412
    :convert.git.extrakeys: list of extra keys from commit metadata to copy to
1f21a6835604 convert: add config option to copy extra keys from Git commits
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30646
diff changeset
   413
        the destination. Some Git repositories store extra metadata in commits.
1f21a6835604 convert: add config option to copy extra keys from Git commits
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30646
diff changeset
   414
        By default, this non-default metadata will be lost during conversion.
1f21a6835604 convert: add config option to copy extra keys from Git commits
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30646
diff changeset
   415
        Setting this config option can retain that metadata. Some built-in
1f21a6835604 convert: add config option to copy extra keys from Git commits
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30646
diff changeset
   416
        keys such as ``parent`` and ``branch`` are not allowed to be copied.
1f21a6835604 convert: add config option to copy extra keys from Git commits
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30646
diff changeset
   417
25787
d9133e89d39d convert: allow customizing git remote prefix
Durham Goode <durham@fb.com>
parents: 25750
diff changeset
   418
    :convert.git.remoteprefix: remote refs are converted as bookmarks with
d9133e89d39d convert: allow customizing git remote prefix
Durham Goode <durham@fb.com>
parents: 25750
diff changeset
   419
        ``convert.git.remoteprefix`` as a prefix followed by a /. The default
d9133e89d39d convert: allow customizing git remote prefix
Durham Goode <durham@fb.com>
parents: 25750
diff changeset
   420
        is 'remote'.
d9133e89d39d convert: allow customizing git remote prefix
Durham Goode <durham@fb.com>
parents: 25750
diff changeset
   421
30661
ced0d686ecb3 convert: add config option to control storing original revision
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30660
diff changeset
   422
    :convert.git.saverev: whether to store the original Git commit ID in the
ced0d686ecb3 convert: add config option to control storing original revision
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30660
diff changeset
   423
        metadata of the destination commit. The default is True.
ced0d686ecb3 convert: add config option to control storing original revision
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30660
diff changeset
   424
26077
e63d05fbae84 convert: add convert.git.skipsubmodules option
Durham Goode <durham@fb.com>
parents: 25884
diff changeset
   425
    :convert.git.skipsubmodules: does not convert root level .gitmodules files
e63d05fbae84 convert: add convert.git.skipsubmodules option
Durham Goode <durham@fb.com>
parents: 25884
diff changeset
   426
        or files with 160000 mode indicating a submodule. Default is False.
e63d05fbae84 convert: add convert.git.skipsubmodules option
Durham Goode <durham@fb.com>
parents: 25884
diff changeset
   427
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   428
    Perforce Source
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   429
    ###############
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   430
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   431
    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
   432
    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
   433
    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
   434
    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
   435
    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
   436
    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
   437
25884
b810b59eca62 convert: when converting from Perforce use original local encoding by default
Eugene Baranov <eug.baranov@gmail.com>
parents: 25880
diff changeset
   438
    The following options can be set with ``--config``:
b810b59eca62 convert: when converting from Perforce use original local encoding by default
Eugene Baranov <eug.baranov@gmail.com>
parents: 25880
diff changeset
   439
b810b59eca62 convert: when converting from Perforce use original local encoding by default
Eugene Baranov <eug.baranov@gmail.com>
parents: 25880
diff changeset
   440
    :convert.p4.encoding: specify the encoding to use when decoding standard
b810b59eca62 convert: when converting from Perforce use original local encoding by default
Eugene Baranov <eug.baranov@gmail.com>
parents: 25880
diff changeset
   441
        output of the Perforce command line tool. The default is default system
b810b59eca62 convert: when converting from Perforce use original local encoding by default
Eugene Baranov <eug.baranov@gmail.com>
parents: 25880
diff changeset
   442
        encoding.
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   443
13429
0079fb98e8d0 convert: fix typos in docstring
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 12924
diff changeset
   444
    :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
   445
        Perforce changelist number).
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   446
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   447
    Mercurial Destination
17267
979b107eaea2 doc: unify section level between help topics
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17251
diff changeset
   448
    #####################
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   449
25558
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   450
    The Mercurial destination will recognize Mercurial subrepositories in the
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   451
    destination directory, and update the .hgsubstate file automatically if the
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   452
    destination subrepositories contain the <dest>/<sub>/.hg/shamap file.
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   453
    Converting a repository with subrepositories requires converting a single
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   454
    repository at a time, from the bottom up.
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   455
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   456
    .. container:: verbose
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   457
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   458
       An example showing how to convert a repository with subrepositories::
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   459
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   460
         # so convert knows the type when it sees a non empty destination
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   461
         $ hg init converted
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   462
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   463
         $ hg convert orig/sub1 converted/sub1
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   464
         $ hg convert orig/sub2 converted/sub2
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   465
         $ hg convert orig converted
daf9f7ee2a5c convert: support incremental conversion with hg subrepos
Matt Harbison <matt_harbison@yahoo.com>
parents: 25186
diff changeset
   466
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   467
    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
   468
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   469
    :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
   470
        clones. The default is False.
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   471
12922
58f0c60b7f40 convert: use field list instead of option list in help
Erik Zielke <ez@aragost.com>
parents: 12778
diff changeset
   472
    :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
   473
        ``default``.
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   474
12923
7d384a372ce8 convert: split docstring lists for easier translation
Martin Geisler <mg@aragost.com>
parents: 12922
diff changeset
   475
    :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
   476
        True.
25741
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   477
25750
c9093d4d1ff6 convert: add config for recording the source name
Durham Goode <durham@fb.com>
parents: 25748
diff changeset
   478
    :convert.hg.sourcename: records the given string as a 'convert_source' extra
c9093d4d1ff6 convert: add config for recording the source name
Durham Goode <durham@fb.com>
parents: 25748
diff changeset
   479
        value on each commit made in the target repository. The default is None.
c9093d4d1ff6 convert: add config for recording the source name
Durham Goode <durham@fb.com>
parents: 25748
diff changeset
   480
42620
d98ec36be808 convert: add a config option to help doing identity hg->hg conversion
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 38572
diff changeset
   481
    :convert.hg.preserve-hash: only works with mercurial sources. Make convert
d98ec36be808 convert: add a config option to help doing identity hg->hg conversion
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 38572
diff changeset
   482
        prevent performance improvement to the list of modified files in commits
d98ec36be808 convert: add a config option to help doing identity hg->hg conversion
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 38572
diff changeset
   483
        when such an improvement would cause the hash of a commit to change.
d98ec36be808 convert: add a config option to help doing identity hg->hg conversion
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 38572
diff changeset
   484
        The default is False.
d98ec36be808 convert: add a config option to help doing identity hg->hg conversion
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents: 38572
diff changeset
   485
25741
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   486
    All Destinations
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   487
    ################
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   488
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   489
    All destination types accept the following options:
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   490
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   491
    :convert.skiptags: does not convert tags from the source repo to the target
86fe3c404c1e convert: add config to not convert tags
Durham Goode <durham@fb.com>
parents: 25558
diff changeset
   492
        repo. The default is False.
46400
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   493
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   494
    Subversion Destination
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   495
    ######################
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   496
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   497
    Original commit dates are not preserved by default.
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   498
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   499
    :convert.svn.dangerous-set-commit-dates: preserve original commit dates,
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   500
        forcefully setting ``svn:date`` revision properties. This option is
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   501
        DANGEROUS and may break some subversion functionality for the resulting
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   502
        repository (e.g. filtering revisions with date ranges in ``svn log``),
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   503
        as original commit dates are not guaranteed to be monotonically
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   504
        increasing.
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   505
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   506
    For commit dates setting to work destination repository must have
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   507
    ``pre-revprop-change`` hook configured to allow setting of ``svn:date``
7525e77b5eac convert: option to set date and time for svn commits
Nikita Slyusarev <nslus@yandex-team.com>
parents: 45942
diff changeset
   508
    revision properties. See Subversion documentation for more details.
4958
71fed370b7a7 Backout ad09ce1d393c and replace ''' with """ to make some highlighting happy.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4957
diff changeset
   509
    """
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
   510
    return convcmd.convert(ui, src, dest, revmapfile, **opts)
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
   511
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   512
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   513
@command(b'debugsvnlog', [], b'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
   514
def debugsvnlog(ui, **opts):
7873
4a4c7f6a5912 cleanup: drop unused imports
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 7823
diff changeset
   515
    return subversion.debugsvnlog(ui, **opts)
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
   516
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   517
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   518
@command(
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   519
    b'debugcvsps',
21244
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   520
    [
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   521
        # Main options shared with cvsps-2.1
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   522
        (
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   523
            b'b',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   524
            b'branches',
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   525
            [],
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   526
            _(b'only return changes on specified branches'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   527
        ),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   528
        (b'p', b'prefix', b'', _(b'prefix to remove from file names')),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   529
        (
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   530
            b'r',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   531
            b'revisions',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   532
            [],
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   533
            _(b'only return changes after or between specified tags'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   534
        ),
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   535
        (b'u', b'update-cache', None, _(b"update cvs log cache")),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   536
        (b'x', b'new-cache', None, _(b"create new cvs log cache")),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   537
        (b'z', b'fuzz', 60, _(b'set commit time fuzz in seconds')),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   538
        (b'', b'root', b'', _(b'specify cvsroot')),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   539
        # Options specific to builtin cvsps
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   540
        (b'', b'parents', b'', _(b'show parent changesets')),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   541
        (
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   542
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   543
            b'ancestors',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   544
            b'',
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   545
            _(b'show current changeset in ancestor branches'),
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   546
        ),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   547
        # Options that are ignored for compatibility with cvsps-2.1
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   548
        (b'A', b'cvs-direct', None, _(b'ignored for compatibility')),
21244
f0dbafceeb9a convert: declare commands using decorator
Gregory Szorc <gregory.szorc@gmail.com>
parents: 21077
diff changeset
   549
    ],
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   550
    _(b'hg debugcvsps [OPTION]... [PATH]...'),
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   551
    norepo=True,
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   552
)
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   553
def debugcvsps(ui, *args, **opts):
45942
89a2afe31e82 formating: upgrade to black 20.8b1
Augie Fackler <raf@durin42.com>
parents: 43077
diff changeset
   554
    """create changeset information from CVS
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   555
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   556
    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
   557
    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
   558
    cvsps.
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   559
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   560
    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
   561
    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
   562
    series of changesets based on matching commit log entries and
45942
89a2afe31e82 formating: upgrade to black 20.8b1
Augie Fackler <raf@durin42.com>
parents: 43077
diff changeset
   563
    dates."""
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   564
    return cvsps.debugcvsps(ui, *args, **opts)
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   565
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   566
36514
7b74afec6772 templatekw: switch non-showlist template keywords to new API
Yuya Nishihara <yuya@tcha.org>
parents: 35036
diff changeset
   567
def kwconverted(context, mapping, name):
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   568
    ctx = context.resource(mapping, b'ctx')
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   569
    rev = ctx.extra().get(b'convert_revision', b'')
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   570
    if rev.startswith(b'svn:'):
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   571
        if name == b'svnrev':
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   572
            return b"%d" % subversion.revsplit(rev)[2]
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   573
        elif name == b'svnpath':
13691
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   574
            return subversion.revsplit(rev)[1]
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   575
        elif name == b'svnuuid':
13691
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   576
            return subversion.revsplit(rev)[0]
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   577
    return rev
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   578
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   579
28540
012411b9940d hgext: use templatekeyword to mark a function as template keyword
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28414
diff changeset
   580
templatekeyword = registrar.templatekeyword()
012411b9940d hgext: use templatekeyword to mark a function as template keyword
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28414
diff changeset
   581
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   582
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   583
@templatekeyword(b'svnrev', requires={b'ctx'})
36514
7b74afec6772 templatekw: switch non-showlist template keywords to new API
Yuya Nishihara <yuya@tcha.org>
parents: 35036
diff changeset
   584
def kwsvnrev(context, mapping):
28540
012411b9940d hgext: use templatekeyword to mark a function as template keyword
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28414
diff changeset
   585
    """String. Converted subversion revision number."""
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   586
    return kwconverted(context, mapping, b'svnrev')
13691
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   587
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   588
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   589
@templatekeyword(b'svnpath', requires={b'ctx'})
36514
7b74afec6772 templatekw: switch non-showlist template keywords to new API
Yuya Nishihara <yuya@tcha.org>
parents: 35036
diff changeset
   590
def kwsvnpath(context, mapping):
28540
012411b9940d hgext: use templatekeyword to mark a function as template keyword
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28414
diff changeset
   591
    """String. Converted subversion revision project path."""
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   592
    return kwconverted(context, mapping, b'svnpath')
13691
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   593
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   594
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   595
@templatekeyword(b'svnuuid', requires={b'ctx'})
36514
7b74afec6772 templatekw: switch non-showlist template keywords to new API
Yuya Nishihara <yuya@tcha.org>
parents: 35036
diff changeset
   596
def kwsvnuuid(context, mapping):
28540
012411b9940d hgext: use templatekeyword to mark a function as template keyword
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 28414
diff changeset
   597
    """String. Converted subversion revision repository identifier."""
43077
687b865b95ad formatting: byteify all mercurial/ and hgext/ string literals
Augie Fackler <augie@google.com>
parents: 43076
diff changeset
   598
    return kwconverted(context, mapping, b'svnuuid')
13691
ad02eba55459 convert: add svnrev, svnpath and svnuuid template keywords
Patrick Mezard <pmezard@gmail.com>
parents: 13494
diff changeset
   599
43076
2372284d9457 formatting: blacken the codebase
Augie Fackler <augie@google.com>
parents: 42620
diff changeset
   600
13698
f30ce5983896 i18n: register new template keywords for translation
Patrick Mezard <pmezard@gmail.com>
parents: 13691
diff changeset
   601
# 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
   602
i18nfunctions = [kwsvnrev, kwsvnpath, kwsvnuuid]