tests/test-convert.out
author Bryan O'Sullivan <bos@serpentine.com>
Wed, 07 Nov 2007 18:26:59 -0800
changeset 5513 f0c58fd4b798
parent 5488 247af577fe29
child 5556 61fdf2558c0a
permissions -rw-r--r--
convert: add support for Subversion as a sink
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
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    58
options:
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    59
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    60
 -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
    61
 -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
    62
    --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
    63
 -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
    64
 -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
    65
    --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
    66
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    67
use "hg -v help convert" to show global options
5015
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    68
adding a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    69
assuming destination a-hg
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    70
initializing destination a-hg repository
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    71
scanning source...
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    72
sorting...
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    73
converting...
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    74
4 a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    75
3 b
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    76
2 c
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    77
1 d
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    78
0 e
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    79
pulling from ../a
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    80
searching for changes
cb100605a516 convert: add test
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    81
no changes found
5441
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    82
% should fail
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    83
initializing destination bogusfile repository
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    84
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
    85
% should fail
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    86
abort: Permission denied: bogusdir
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    87
% should succeed
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    88
initializing destination bogusdir repository
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    89
scanning source...
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    90
sorting...
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    91
converting...
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    92
4 a
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    93
3 b
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    94
2 c
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    95
1 d
71e7c86adcb7 convert: refactor sink initialisation, to remove hardcoding of hg
Bryan O'Sullivan <bos@serpentine.com>
parents: 5015
diff changeset
    96
0 e