tests/test-convert.out
author Bryan O'Sullivan <bos@serpentine.com>
Tue, 27 Nov 2007 09:44:09 -0800
changeset 5556 61fdf2558c0a
parent 5513 f0c58fd4b798
child 5761 07df2a5c02b2
permissions -rw-r--r--
convert: some tidyups, doc improvements, and test fixes The various back end options are now documented. The hg source can now be configured not to hand out a revision ID.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     1
hg convert [OPTION]... SOURCE [DEST [MAPFILE]]
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     2
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     3
Convert a foreign SCM repository to a Mercurial one.
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     4
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     5
    Accepted source formats:
5488
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
     6
    - Mercurial
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     7
    - CVS
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     8
    - Darcs
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
     9
    - git
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    10
    - Subversion
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    11
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    12
    Accepted destination formats:
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    13
    - Mercurial
5513
f0c58fd4b798 convert: add support for Subversion as a sink
Bryan O'Sullivan <bos@serpentine.com>
parents: 5488
diff changeset
    14
    - Subversion (history on branches is not preserved)
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    15
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    16
    If no revision is given, all revisions will be converted. Otherwise,
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    17
    convert will only import up to the named revision (given in a format
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    18
    understood by the source).
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    19
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    20
    If no destination directory name is specified, it defaults to the
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    21
    basename of the source with '-hg' appended.  If the destination
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    22
    repository doesn't exist, it will be created.
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    23
5488
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    24
    If <MAPFILE> isn't given, it will be put in a default location
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    25
    (<dest>/.hg/shamap by default).  The <MAPFILE> is a simple text
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    26
    file that maps each source commit ID to the destination ID for
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    27
    that revision, like so:
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    28
    <source ID> <destination ID>
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    29
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    30
    If the file doesn't exist, it's automatically created.  It's updated
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    31
    on each commit copied, so convert-repo can be interrupted and can
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    32
    be run repeatedly to copy new commits.
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    33
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    34
    The [username mapping] file is a simple text file that maps each source
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    35
    commit author to a destination commit author. It is handy for source SCMs
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    36
    that use unix logins to identify authors (eg: CVS). One line per author
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    37
    mapping and the line format is:
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    38
    srcauthor=whatever string you want
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    39
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    40
    The filemap is a file that allows filtering and remapping of files
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    41
    and directories.  Comment lines start with '#'.  Each line can
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    42
    contain one of the following directives:
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    43
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    44
      include path/to/file
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    45
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    46
      exclude path/to/file
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    47
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    48
      rename from/file to/file
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    49
    
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    50
    The 'include' directive causes a file, or all files under a
5488
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    51
    directory, to be included in the destination repository, and the
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    52
    exclusion of all other files and dirs not explicitely included.
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    53
    The 'exclude' directive causes files or directories to be omitted.
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    54
    The 'rename' directive renames a file or directory.  To rename from a
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    55
    subdirectory into the root of the repository, use '.' as the path to
247af577fe29 fix typo in convert help text, update test
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5441
diff changeset
    56
    rename to.
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    57
5556
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    58
    Back end options:
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    59
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    60
    --config convert.hg.clonebranches=False   (boolean)
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    61
        hg target: XXX not documented
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    62
    --config convert.hg.saverev=True          (boolean)
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    63
        hg source: allow target to preserve source revision ID
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    64
    --config convert.hg.tagsbranch=default    (branch name)
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    65
        hg target: XXX not documented
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    66
    --config convert.hg.usebranchnames=True   (boolean)
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    67
        hg target: preserve branch names
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    68
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    69
    --config convert.svn.branches=branches    (directory name)
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    70
        svn source: specify the directory containing branches
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    71
    --config convert.svn.tags=tags            (directory name)
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    72
        svn source: specify the directory containing tags
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    73
    --config convert.svn.trunk=trunk          (directory name)
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    74
        svn source: specify the name of the trunk branch
61fdf2558c0a convert: some tidyups, doc improvements, and test fixes
Bryan O'Sullivan <bos@serpentine.com>
parents: 5513
diff changeset
    75
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    76
options:
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    77
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    78
 -A --authors      username mapping filename
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    79
 -d --dest-type    destination repository type
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    80
    --filemap      remap file names using contents of file
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    81
 -r --rev          import up to target revision REV
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    82
 -s --source-type  source repository type
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    83
    --datesort     try to sort changesets by date
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    84
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    85
use "hg -v help convert" to show global options
5015
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    86
adding a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    87
assuming destination a-hg
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    88
initializing destination a-hg repository
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    89
scanning source...
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    90
sorting...
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    91
converting...
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    92
4 a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    93
3 b
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    94
2 c
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    95
1 d
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    96
0 e
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    97
pulling from ../a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    98
searching for changes
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    99
no changes found
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   100
% should fail
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   101
initializing destination bogusfile repository
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   102
abort: cannot create new bundle repository
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   103
% should fail
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   104
abort: Permission denied: bogusdir
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   105
% should succeed
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   106
initializing destination bogusdir repository
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   107
scanning source...
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   108
sorting...
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   109
converting...
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   110
4 a
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   111
3 b
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   112
2 c
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   113
1 d
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
   114
0 e