hgext/convert/__init__.py
author Yuya Nishihara <yuya@tcha.org>
Thu, 11 Nov 2010 01:12:51 +0900
branchstable
changeset 12966 5f80f44d23c5
parent 12778 dce09f82f619
child 12922 58f0c60b7f40
permissions -rw-r--r--
win32: remove try-catch block of GetModuleFileNameEx (issue2480) According to the API document, GetModuleFileName is the preferred way to retrieve the filename of the current process. So we shouldn't try GetModuleFileName'Ex' first. Previously system_rcpath_win32() happened to return unicode paths due to GetModuleFileNameEx (issue2480). This problem is fixed as GetModuleFileName never return unicode.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
     1
# convert.py Foreign SCM converter
3917
645e1dd4b8ae convert-repo: update usage information
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3911
diff changeset
     2
#
4635
63b9d2deed48 Updated copyright notices and add "and others" to "hg version"
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4591
diff changeset
     3
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
     4
#
8225
46293a0c7e9f updated license to be explicit about GPL version 2
Martin Geisler <mg@lazybytes.net>
parents: 8222
diff changeset
     5
# This software may be used and distributed according to the terms of the
10263
25e572394f5c Update license to GPLv2+
Matt Mackall <mpm@selenic.com>
parents: 9634
diff changeset
     6
# GNU General Public License version 2 or any later version.
8228
eee2319c5895 add blank line after copyright notices and after header
Martin Geisler <mg@lazybytes.net>
parents: 8225
diff changeset
     7
8932
f87884329419 extensions: fix up description lines some more
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 8894
diff changeset
     8
'''import revisions from foreign VCS repositories into Mercurial'''
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
     9
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
    10
import convcmd
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
    11
import cvsps
7873
4a4c7f6a5912 cleanup: drop unused imports
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 7823
diff changeset
    12
import subversion
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
    13
from mercurial import commands
6999
f1546aa94362 i18n, convert: mark command line options for translation
Martin Geisler <mg@daimi.au.dk>
parents: 6976
diff changeset
    14
from mercurial.i18n import _
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
    15
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
    16
# Commands definition was moved elsewhere to ease demandload job.
694
51eb248d3348 Teach convert-repo about tags
mpm@selenic.com
parents: 692
diff changeset
    17
5281
a176f9c8b26e convert: rename a class and a function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5256
diff changeset
    18
def convert(ui, src, dest=None, revmapfile=None, **opts):
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
    19
    """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
    20
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    21
    Accepted source formats [identifiers]:
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    22
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    23
    - Mercurial [hg]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    24
    - CVS [cvs]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    25
    - Darcs [darcs]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    26
    - git [git]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    27
    - Subversion [svn]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    28
    - Monotone [mtn]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    29
    - GNU Arch [gnuarch]
7053
209ef5f3534c convert: add bzr source
Marek Kubica <marek@xivilization.net>
parents: 6999
diff changeset
    30
    - Bazaar [bzr]
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
    31
    - Perforce [p4]
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
    32
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    33
    Accepted destination formats [identifiers]:
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    34
6976
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    35
    - Mercurial [hg]
b072266a83d1 convert: document source and sink identifiers, fix error message
Patrick Mezard <pmezard@gmail.com>
parents: 6923
diff changeset
    36
    - 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
    37
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    38
    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
    39
    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
    40
    (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
    41
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    42
    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
    43
    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
    44
    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
    45
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    46
    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
    47
    Mercurial uses --sourcesort to preserve original revision numbers
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    48
    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
    49
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    50
    --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
    51
                  which means branches are usually converted one after
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    52
                  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
    53
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    54
    --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
    55
                  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
    56
                  magnitude larger than the same ones generated by
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    57
                  --branchsort.
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    58
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    59
    --sourcesort  try to preserve source revisions order, only
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    60
                  supported by Mercurial sources.
8692
827d4e807d57 convert: default revisions order depends on source
Patrick Mezard <pmezard@gmail.com>
parents: 8690
diff changeset
    61
6238
aac270593ef7 convert: rename MAPFILE into REVMAP to disambiguate with filemap
Patrick Mezard <pmezard@gmail.com>
parents: 6173
diff changeset
    62
    If <REVMAP> isn't given, it will be put in a default location
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    63
    (<dest>/.hg/shamap by default). The <REVMAP> is a simple text file
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    64
    that maps each source commit ID to the destination ID for that
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    65
    revision, like so::
9058
b10cee4bd2c1 convert: wrapped docstrings at 78 characters
Martin Geisler <mg@lazybytes.net>
parents: 8932
diff changeset
    66
9157
9261667e9b82 commands: use minirst parser when displaying help
Martin Geisler <mg@lazybytes.net>
parents: 9103
diff changeset
    67
      <source ID> <destination ID>
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
    68
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    69
    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
    70
    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
    71
    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
    72
12198
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
    73
    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
    74
    author to a destination commit author. It is handy for source SCMs
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
    75
    that use unix logins to identify authors (eg: CVS). One line per
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
    76
    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
    77
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
    78
      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
    79
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
    80
    Empty lines and lines starting with a ``#`` are ignored.
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
    81
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    82
    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
    83
    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
    84
    directives::
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
    85
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
    86
      include path/to/file-or-dir
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
    87
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
    88
      exclude path/to/file-or-dir
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
    89
11523
dec57aa0f8ca convert: cleanup of filemap help text
Mads Kiilerich <mads@kiilerich.com>
parents: 11321
diff changeset
    90
      rename path/to/source path/to/destination
5256
0b0caffcf175 convert: document filemap.
Bryan O'Sullivan <bos@serpentine.com>
parents: 5204
diff changeset
    91
12188
6045d467abd7 merge with stable
Martin Geisler <mg@lazybytes.net>
parents: 12187 12186
diff changeset
    92
    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
    93
    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
    94
    directories. The ``include`` or ``exclude`` directive with the
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
    95
    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
    96
12185
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
    97
    The ``include`` directive causes a file, or all files under a
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    98
    directory, to be included in the destination repository, and the
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
    99
    exclusion of all other files and directories not explicitly
12185
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   100
    included. The ``exclude`` directive causes files or directories to
6a94459b7afa convert: better quoting in help text
Martin Geisler <mg@lazybytes.net>
parents: 12184
diff changeset
   101
    be omitted. The ``rename`` directive renames a file or directory if
11685
aade8f133d11 cleanup: typos
Patrick Mezard <pmezard@gmail.com>
parents: 11523
diff changeset
   102
    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
   103
    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
   104
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   105
    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
   106
    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
   107
    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
   108
    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
   109
    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
   110
    comma-separated values::
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   111
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   112
      key parent1, parent2
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   113
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   114
    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
   115
    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
   116
    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
   117
    (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
   118
    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
   119
    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
   120
    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
   121
    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
   122
8377
29f4f0d66cd5 convert: adding branchmap functionality to convert extension
Michael J. Pedersen <m.pedersen@icelus.org>
parents: 8228
diff changeset
   123
    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
   124
    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
   125
    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
   126
    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
   127
    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
   128
    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
   129
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   130
      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
   131
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   132
    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
   133
    source repository, and "new_branch_name" is the name of the branch
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   134
    is the destination repository. No whitespace is allowed in the
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   135
    branch names. This can be used to (for instance) move code in one
025ca07351ea convert: show example splice, author, and branch map entries in help
Martin Geisler <mg@lazybytes.net>
parents: 11523
diff changeset
   136
    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
   137
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   138
    Mercurial Source
12778
dce09f82f619 help: different section separators
Erik Zielke <ez@aragost.com>
parents: 12202
diff changeset
   139
    ''''''''''''''''
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   140
8010
58ba4b86ae13 convert: align option types in help text
Martin Geisler <mg@daimi.au.dk>
parents: 7989
diff changeset
   141
    --config convert.hg.ignoreerrors=False    (boolean)
7231
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 7170
diff changeset
   142
        ignore integrity errors when reading. Use it to fix Mercurial
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 7170
diff changeset
   143
        repositories with missing revlogs, by converting from and to
8e7130a10f3b convert: ignore hg source errors with hg.ignoreerrors (issue 1357)
Patrick Mezard <pmezard@gmail.com>
parents: 7170
diff changeset
   144
        Mercurial.
8010
58ba4b86ae13 convert: align option types in help text
Martin Geisler <mg@daimi.au.dk>
parents: 7989
diff changeset
   145
    --config convert.hg.saverev=False         (boolean)
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   146
        store original revision ID in changeset (forces target IDs to
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   147
        change)
6885
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents: 6798
diff changeset
   148
    --config convert.hg.startrev=0            (hg revision identifier)
6e253aa04ff7 convert: implement startrev for hg source
Patrick Mezard <pmezard@gmail.com>
parents: 6798
diff changeset
   149
        convert start revision and its descendants
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   150
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   151
    CVS Source
12778
dce09f82f619 help: different section separators
Erik Zielke <ez@aragost.com>
parents: 12202
diff changeset
   152
    ''''''''''
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   153
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   154
    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
   155
    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
   156
    access to the repository files is not needed, unless of course the
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   157
    repository is :local:. The conversion uses the top level directory
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   158
    in the sandbox to find the CVS repository, and then uses CVS rlog
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   159
    commands to find files to convert. This means that unless a
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   160
    filemap is given, all files under the starting directory will be
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   161
    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
   162
    sandbox is ignored.
6798
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   163
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   164
    The options shown are the defaults.
ceb28b67204e convert: add documentation for CVS source
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 6666
diff changeset
   165
9103
9c7a5d70e72f convert: fix inconsistent indentation in help text
Martin Geisler <mg@lazybytes.net>
parents: 9086
diff changeset
   166
    --config convert.cvsps.cache=True         (boolean)
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   167
        Set to False to disable remote log caching, for testing and
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   168
        debugging purposes.
9103
9c7a5d70e72f convert: fix inconsistent indentation in help text
Martin Geisler <mg@lazybytes.net>
parents: 9086
diff changeset
   169
    --config convert.cvsps.fuzz=60            (integer)
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   170
        Specify the maximum time (in seconds) that is allowed between
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   171
        commits with identical user and log message in a single
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   172
        changeset. When very large files were checked in as part of a
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   173
        changeset then the default may not be long enough.
9103
9c7a5d70e72f convert: fix inconsistent indentation in help text
Martin Geisler <mg@lazybytes.net>
parents: 9086
diff changeset
   174
    --config convert.cvsps.mergeto='{{mergetobranch ([-\\w]+)}}'
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   175
        Specify a regular expression to which commit log messages are
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   176
        matched. If a match occurs, then the conversion process will
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   177
        insert a dummy revision merging the branch on which this log
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   178
        message occurs to the branch indicated in the regex.
9103
9c7a5d70e72f convert: fix inconsistent indentation in help text
Martin Geisler <mg@lazybytes.net>
parents: 9086
diff changeset
   179
    --config convert.cvsps.mergefrom='{{mergefrombranch ([-\\w]+)}}'
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   180
        Specify a regular expression to which commit log messages are
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   181
        matched. If a match occurs, then the conversion process will
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   182
        add the most recent revision on the branch indicated in the
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   183
        regex as the second parent of the changeset.
10095
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   184
    --config hook.cvslog
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   185
        Specify a Python function to be called at the end of gathering
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   186
        the CVS log. The function is passed a list with the log entries,
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   187
        and can modify the entries in-place, or add or delete them.
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   188
    --config hook.cvschangesets
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   189
        Specify a Python function to be called after the changesets
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   190
        are calculated from the the CVS log. The function is passed
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   191
        a list with the changeset entries, and can modify the changesets
69ce7a10e593 convert: implement two hooks in builtin cvsps
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 9634
diff changeset
   192
        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
   193
9472
a15813fae0a8 convert/cvs: update debugcvsps documentation
Patrick Mezard <pmezard@gmail.com>
parents: 9256
diff changeset
   194
    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
   195
    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
   196
    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
   197
    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
   198
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   199
    Subversion Source
12778
dce09f82f619 help: different section separators
Erik Zielke <ez@aragost.com>
parents: 12202
diff changeset
   200
    '''''''''''''''''
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   201
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   202
    Subversion source detects classical trunk/branches/tags layouts.
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   203
    By default, the supplied "svn://repo/path/" source URL is
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   204
    converted as a single branch. If "svn://repo/path/trunk" exists it
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   205
    replaces the default branch. If "svn://repo/path/branches" exists,
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   206
    its subdirectories are listed as possible branches. If
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   207
    "svn://repo/path/tags" exists, it is looked for tags referencing
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   208
    converted branches. Default "trunk", "branches" and "tags" values
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   209
    can be overridden with following options. Set them to paths
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   210
    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
   211
    detection.
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   212
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   213
    --config convert.svn.branches=branches    (directory name)
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   214
        specify the directory containing branches
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   215
    --config convert.svn.tags=tags            (directory name)
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   216
        specify the directory containing tags
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   217
    --config convert.svn.trunk=trunk          (directory name)
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   218
        specify the name of the trunk branch
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   219
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   220
    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
   221
    instead of being integrally converted. Only single branch
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   222
    conversions are supported.
6173
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents: 6172
diff changeset
   223
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents: 6172
diff changeset
   224
    --config convert.svn.startrev=0           (svn revision number)
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents: 6172
diff changeset
   225
        specify start Subversion revision.
963000ed8cac convert: add shallow, single branch svn conversions via svn.startrev
Patrick Mezard <pmezard@gmail.com>
parents: 6172
diff changeset
   226
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   227
    Perforce Source
12778
dce09f82f619 help: different section separators
Erik Zielke <ez@aragost.com>
parents: 12202
diff changeset
   228
    '''''''''''''''
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   229
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   230
    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
   231
    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
   232
    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
   233
    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
   234
    usually should specify a target directory, because otherwise the
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   235
    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
   236
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   237
    It is possible to limit the amount of source history to be
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   238
    converted by specifying an initial Perforce revision.
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   239
8010
58ba4b86ae13 convert: align option types in help text
Martin Geisler <mg@daimi.au.dk>
parents: 7989
diff changeset
   240
    --config convert.p4.startrev=0            (perforce changelist number)
7823
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   241
        specify initial Perforce revision.
11efa41037e2 convert: Perforce source for conversion to Mercurial
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7815
diff changeset
   242
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   243
    Mercurial Destination
12778
dce09f82f619 help: different section separators
Erik Zielke <ez@aragost.com>
parents: 12202
diff changeset
   244
    '''''''''''''''''''''
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   245
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   246
    --config convert.hg.clonebranches=False   (boolean)
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   247
        dispatch source branches in separate clones.
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   248
    --config convert.hg.tagsbranch=default    (branch name)
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   249
        tag revisions branch name
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   250
    --config convert.hg.usebranchnames=True   (boolean)
6169
55455556f921 convert: improve subversion source documentation
Patrick Mezard <pmezard@gmail.com>
parents: 6143
diff changeset
   251
        preserve branch names
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5554
diff changeset
   252
4958
71fed370b7a7 Backout ad09ce1d393c and replace ''' with """ to make some highlighting happy.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4957
diff changeset
   253
    """
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
   254
    return convcmd.convert(ui, src, dest, revmapfile, **opts)
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
   255
5621
badbefa55972 convert: move commands definition to ease demandload job (issue 860)
Patrick Mezard <pmezard@gmail.com>
parents: 5521
diff changeset
   256
def debugsvnlog(ui, **opts):
7873
4a4c7f6a5912 cleanup: drop unused imports
Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
parents: 7823
diff changeset
   257
    return subversion.debugsvnlog(ui, **opts)
316
c48d069163d6 Add new convert-repo script
mpm@selenic.com
parents:
diff changeset
   258
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   259
def debugcvsps(ui, *args, **opts):
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   260
    '''create changeset information from CVS
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   261
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   262
    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
   263
    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
   264
    cvsps.
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   265
9256
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   266
    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
   267
    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
   268
    series of changesets based on matching commit log entries and
dd89dd090b47 convert: wrap docstrings at 70 characters
Martin Geisler <mg@lazybytes.net>
parents: 9157
diff changeset
   269
    dates.'''
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   270
    return cvsps.debugcvsps(ui, *args, **opts)
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   271
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   272
commands.norepo += " convert debugsvnlog debugcvsps"
5127
39b6eaee6fd7 convert: replace fork with subprocess call.
Patrick Mezard <pmezard@gmail.com>
parents: 5121
diff changeset
   273
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
   274
cmdtable = {
4532
c3a78a49d7f0 Some small cleanups for convert extension:
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4521
diff changeset
   275
    "convert":
5281
a176f9c8b26e convert: rename a class and a function
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5256
diff changeset
   276
        (convert,
12202
d346089095ac convert: move -A option to --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12198
diff changeset
   277
         [('', 'authors', '',
12198
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
   278
           _('username mapping filename (DEPRECATED, use --authormap instead)'),
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
   279
           _('FILE')),
12187
4a854122a1c7 convert: better grouping of command line flags in help
Martin Geisler <mg@lazybytes.net>
parents: 11685
diff changeset
   280
          ('s', 'source-type', '',
4a854122a1c7 convert: better grouping of command line flags in help
Martin Geisler <mg@lazybytes.net>
parents: 11685
diff changeset
   281
           _('source repository type'), _('TYPE')),
11321
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   282
          ('d', 'dest-type', '',
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   283
           _('destination repository type'), _('TYPE')),
12187
4a854122a1c7 convert: better grouping of command line flags in help
Martin Geisler <mg@lazybytes.net>
parents: 11685
diff changeset
   284
          ('r', 'rev', '',
4a854122a1c7 convert: better grouping of command line flags in help
Martin Geisler <mg@lazybytes.net>
parents: 11685
diff changeset
   285
           _('import up to target revision REV'), _('REV')),
12202
d346089095ac convert: move -A option to --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12198
diff changeset
   286
          ('A', 'authormap', '',
12198
0c67a58f0580 convert: deprecate --authors in preference for --authormap
Martin Geisler <mg@lazybytes.net>
parents: 12188
diff changeset
   287
           _('remap usernames using this file'), _('FILE')),
11321
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   288
          ('', 'filemap', '',
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   289
           _('remap file names using contents of file'), _('FILE')),
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   290
          ('', 'splicemap', '',
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   291
           _('splice synthesized history into place'), _('FILE')),
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   292
          ('', 'branchmap', '',
40c06bbf58be help: show value requirement and multiple occurrence of options
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 10282
diff changeset
   293
           _('change branch names while converting'), _('FILE')),
8692
827d4e807d57 convert: default revisions order depends on source
Patrick Mezard <pmezard@gmail.com>
parents: 8690
diff changeset
   294
          ('', 'branchsort', None, _('try to sort changesets by branches')),
8690
c5b4f662109f convert: add --sourcesort option for source specific sort
Patrick Mezard <pmezard@gmail.com>
parents: 8668
diff changeset
   295
          ('', 'datesort', None, _('try to sort changesets by date')),
c5b4f662109f convert: add --sourcesort option for source specific sort
Patrick Mezard <pmezard@gmail.com>
parents: 8668
diff changeset
   296
          ('', 'sourcesort', None, _('preserve source changesets order'))],
6999
f1546aa94362 i18n, convert: mark command line options for translation
Martin Geisler <mg@daimi.au.dk>
parents: 6976
diff changeset
   297
         _('hg convert [OPTION]... SOURCE [DEST [REVMAP]]')),
5138
9cda2315c7a9 convert: Use debugsvnlog instead of git-like debug-svn-log.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5134
diff changeset
   298
    "debugsvnlog":
5127
39b6eaee6fd7 convert: replace fork with subprocess call.
Patrick Mezard <pmezard@gmail.com>
parents: 5121
diff changeset
   299
        (debugsvnlog,
39b6eaee6fd7 convert: replace fork with subprocess call.
Patrick Mezard <pmezard@gmail.com>
parents: 5121
diff changeset
   300
         [],
5138
9cda2315c7a9 convert: Use debugsvnlog instead of git-like debug-svn-log.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5134
diff changeset
   301
         'hg debugsvnlog'),
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   302
    "debugcvsps":
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   303
        (debugcvsps,
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   304
         [
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   305
          # Main options shared with cvsps-2.1
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   306
          ('b', 'branches', [], _('only return changes on specified branches')),
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   307
          ('p', 'prefix', '', _('prefix to remove from file names')),
10282
08a0f04b56bd many, many trivial check-code fixups
Matt Mackall <mpm@selenic.com>
parents: 10264
diff changeset
   308
          ('r', 'revisions', [],
08a0f04b56bd many, many trivial check-code fixups
Matt Mackall <mpm@selenic.com>
parents: 10264
diff changeset
   309
           _('only return changes after or between specified tags')),
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   310
          ('u', 'update-cache', None, _("update cvs log cache")),
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   311
          ('x', 'new-cache', None, _("create new cvs log cache")),
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   312
          ('z', 'fuzz', 60, _('set commit time fuzz in seconds')),
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   313
          ('', 'root', '', _('specify cvsroot')),
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   314
          # Options specific to builtin cvsps
7598
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   315
          ('', 'parents', '', _('show parent changesets')),
26adfaccdf73 lowercase help output
Martin Geisler <mg@daimi.au.dk>
parents: 7502
diff changeset
   316
          ('', 'ancestors', '', _('show current changeset in ancestor branches')),
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   317
          # Options that are ignored for compatibility with cvsps-2.1
7735
2e48668b51f0 convert: marked string for translation
Martin Geisler <mg@daimi.au.dk>
parents: 7598
diff changeset
   318
          ('A', 'cvs-direct', None, _('ignored for compatibility')),
7502
16905fc2690f Add debugcvsps command, replacing cvsps script
Frank Kingswood <frank@kingswood-consulting.co.uk>
parents: 7236
diff changeset
   319
         ],
7735
2e48668b51f0 convert: marked string for translation
Martin Geisler <mg@daimi.au.dk>
parents: 7598
diff changeset
   320
         _('hg debugcvsps [OPTION]... [PATH]...')),
4513
ac2fe196ac9b Turns convert.py into a real extension
Edouard Gomez <ed.gomez@free.fr>
parents: 4512
diff changeset
   321
}