tests/test-convert-splicemap.t
author Siddharth Agarwal <sid0@fb.com>
Sat, 16 Nov 2013 13:19:06 -0800
changeset 20043 88bd8df008f2
parent 19120 58e782f076e7
child 20117 aa9385f983fa
permissions -rw-r--r--
scmutil: rename filecacheentry to filecachesubentry Upcoming patches will allow the file cache to watch over multiple files, and call the decorated function again if any of the files change. The particular use case for this is the bookmark store, which needs to be invalidated if either .hg/bookmarks or .hg/bookmarks.current changes. (This doesn't currently happen, which is a bug. This bug will also be fixed in upcoming patches.)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8047
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
     2
  $ echo "[extensions]" >> $HGRCPATH
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
     3
  $ echo "convert=" >> $HGRCPATH
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
     4
  $ echo 'graphlog =' >> $HGRCPATH
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
     5
  $ glog()
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
     6
  > {
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
     7
  >     hg glog --template '{rev}:{node|short} "{desc|firstline}"\
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
     8
  >  files: {files}\n' "$@"
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
     9
  > }
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    10
  $ hg init repo1
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    11
  $ cd repo1
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    12
  $ echo a > a
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    13
  $ hg ci -Am adda
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    14
  adding a
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    15
  $ echo b > b
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    16
  $ echo a >> a
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    17
  $ hg ci -Am addb
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    18
  adding b
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    19
  $ PARENTID1=`hg id --debug -i`
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    20
  $ echo c > c
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    21
  $ hg ci -Am addc
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    22
  adding c
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    23
  $ PARENTID2=`hg id --debug -i`
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    24
  $ cd ..
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    25
  $ glog -R repo1
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    26
  @  2:e55c719b85b6 "addc" files: c
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    27
  |
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    28
  o  1:6d4c2037ddc2 "addb" files: a b
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    29
  |
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    30
  o  0:07f494440405 "adda" files: a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    31
  
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    32
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    33
  $ hg init repo2
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    34
  $ cd repo2
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    35
  $ echo b > a
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    36
  $ echo d > d
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    37
  $ hg ci -Am addaandd
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    38
  adding a
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    39
  adding d
19120
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    40
  $ INVALIDID1=afd12345af
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    41
  $ INVALIDID2=28173x36ddd1e67bf7098d541130558ef5534a86
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    42
  $ CHILDID1=`hg id --debug -i`
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    43
  $ echo d >> d
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    44
  $ hg ci -Am changed
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    45
  $ CHILDID2=`hg id --debug -i`
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    46
  $ echo e > e
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    47
  $ hg ci -Am adde
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    48
  adding e
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    49
  $ cd ..
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    50
  $ glog -R repo2
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    51
  @  2:a39b65753b0a "adde" files: e
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    52
  |
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    53
  o  1:e4ea00df9189 "changed" files: d
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    54
  |
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    55
  o  0:527cdedf31fb "addaandd" files: a d
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    56
  
8047
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
19120
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    58
test invalid splicemap1
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    59
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    60
  $ cat > splicemap <<EOF
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    61
  > $CHILDID2
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    62
  > EOF
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    63
  $ hg convert --splicemap splicemap repo2 repo1
16105
ebaa0aa749e2 convert: turn splicemap into a simple dictionary
Patrick Mezard <patrick@mezard.eu>
parents: 15608
diff changeset
    64
  abort: syntax error in splicemap(1): child parent1[,parent2] expected
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    65
  [255]
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    66
19120
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    67
test invalid splicemap2
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    68
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    69
  $ cat > splicemap <<EOF
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    70
  > $CHILDID2 $PARENTID1, $PARENTID2, $PARENTID2
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    71
  > EOF
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    72
  $ hg convert --splicemap splicemap repo2 repo1
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    73
  abort: syntax error in splicemap(1): child parent1[,parent2] expected
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    74
  [255]
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    75
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    76
test invalid splicemap3
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    77
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    78
  $ cat > splicemap <<EOF
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    79
  > $INVALIDID1 $INVALIDID2
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    80
  > EOF
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    81
  $ hg convert --splicemap splicemap repo2 repo1
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    82
  abort: splicemap entry afd12345af is not a valid revision identifier
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    83
  [255]
58e782f076e7 splicemap: improve error handling when source is hg (issue2084)
Ben Goswami <bengoswami@fb.com>
parents: 16480
diff changeset
    84
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    85
splice repo2 on repo1
8047
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    86
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    87
  $ cat > splicemap <<EOF
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    88
  > $CHILDID1 $PARENTID1
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    89
  > $CHILDID2 $PARENTID2,$CHILDID1
16190
9479c28a22bf convert: ignore blank lines in mapfiles (issue3286)
Patrick Mezard <patrick@mezard.eu>
parents: 16162
diff changeset
    90
  > 
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    91
  > EOF
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    92
  $ cat splicemap
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    93
  527cdedf31fbd5ea708aa14eeecf53d4676f38db 6d4c2037ddc2cb2627ac3a244ecce35283268f8e
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
    94
  e4ea00df91897da3079a10fab658c1eddba6617b e55c719b85b60e5102fac26110ba626e7cb6b7dc,527cdedf31fbd5ea708aa14eeecf53d4676f38db
16190
9479c28a22bf convert: ignore blank lines in mapfiles (issue3286)
Patrick Mezard <patrick@mezard.eu>
parents: 16162
diff changeset
    95
  
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    96
  $ hg clone repo1 target1
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    97
  updating to branch default
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    98
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
    99
  $ hg convert --splicemap splicemap repo2 target1
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   100
  scanning source...
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   101
  sorting...
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   102
  converting...
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   103
  2 addaandd
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   104
  spliced in ['6d4c2037ddc2cb2627ac3a244ecce35283268f8e'] as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   105
  1 changed
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   106
  spliced in ['e55c719b85b60e5102fac26110ba626e7cb6b7dc', '527cdedf31fbd5ea708aa14eeecf53d4676f38db'] as parents of e4ea00df91897da3079a10fab658c1eddba6617b
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   107
  0 adde
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   108
  $ glog -R target1
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   109
  o  5:16bc847b02aa "adde" files: e
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   110
  |
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   111
  o    4:e30e4fee3418 "changed" files: d
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   112
  |\
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   113
  | o  3:e673348c3a3c "addaandd" files: a d
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   114
  | |
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   115
  @ |  2:e55c719b85b6 "addc" files: c
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   116
  |/
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   117
  o  1:6d4c2037ddc2 "addb" files: a b
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   118
  |
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   119
  o  0:07f494440405 "adda" files: a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   120
  
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   121
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   122
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   123
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   124
Test splicemap and conversion order
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   125
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   126
  $ hg init ordered
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   127
  $ cd ordered
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   128
  $ echo a > a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   129
  $ hg ci -Am adda
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   130
  adding a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   131
  $ hg branch branch
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   132
  marked working directory as branch branch
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   133
  (branches are permanent and global, did you want a bookmark?)
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   134
  $ echo a >> a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   135
  $ hg ci -Am changea
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   136
  $ echo a >> a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   137
  $ hg ci -Am changeaagain
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   138
  $ hg up 0
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   139
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   140
  $ echo b > b
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   141
  $ hg ci -Am addb
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   142
  adding b
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   143
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   144
We want 2 to depend on 1 and 3. Since 3 is always converted after 2,
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   145
the bug should be exhibited with all conversion orders.
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   146
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   147
  $ cat > ../splicemap <<EOF
16480
123f96c4d454 tests: fix bashism in test-convert-splicemap.t
Mads Kiilerich <mads@kiilerich.com>
parents: 16190
diff changeset
   148
  > `(hg id -r 2 -i --debug)` `(hg id -r 1 -i --debug)`, `(hg id -r 3 -i --debug)`
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   149
  > EOF
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   150
  $ cd ..
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   151
  $ cat splicemap
16118
d554a3dcae5a convert: tolerate spaces between splicemap parent ids (issue3203)
Patrick Mezard <patrick@mezard.eu>
parents: 16106
diff changeset
   152
  7c364e7fa7d70ae525610c016317ed717b519d97 717d54d67e6c31fd75ffef2ff3042bdd98418437, 102a90ea7b4a3361e4082ed620918c261189a36a
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   153
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   154
Test regular conversion
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   155
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   156
  $ hg convert --splicemap splicemap ordered ordered-hg1
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   157
  initializing destination ordered-hg1 repository
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   158
  scanning source...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   159
  sorting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   160
  converting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   161
  3 adda
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   162
  2 changea
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   163
  1 addb
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   164
  0 changeaagain
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   165
  spliced in ['717d54d67e6c31fd75ffef2ff3042bdd98418437', '102a90ea7b4a3361e4082ed620918c261189a36a'] as parents of 7c364e7fa7d70ae525610c016317ed717b519d97
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   166
  $ glog -R ordered-hg1
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   167
  o    3:4cb04b9afbf2 "changeaagain" files: a
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   168
  |\
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   169
  | o  2:102a90ea7b4a "addb" files: b
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   170
  | |
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   171
  o |  1:717d54d67e6c "changea" files: a
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   172
  |/
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   173
  o  0:07f494440405 "adda" files: a
12531
a1cbcc1a21f6 tests: unify test-convert-splicemap
Matt Mackall <mpm@selenic.com>
parents: 10119
diff changeset
   174
  
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   175
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   176
Test conversion with parent revisions already in dest, using source
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   177
and destination identifiers. Test unknown splicemap target.
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   178
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   179
  $ hg convert -r1 ordered ordered-hg2
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   180
  initializing destination ordered-hg2 repository
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   181
  scanning source...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   182
  sorting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   183
  converting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   184
  1 adda
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   185
  0 changea
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   186
  $ hg convert -r3 ordered ordered-hg2
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   187
  scanning source...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   188
  sorting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   189
  converting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   190
  0 addb
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   191
  $ cat > splicemap <<EOF
16480
123f96c4d454 tests: fix bashism in test-convert-splicemap.t
Mads Kiilerich <mads@kiilerich.com>
parents: 16190
diff changeset
   192
  > `(hg -R ordered id -r 2 -i --debug)` \
123f96c4d454 tests: fix bashism in test-convert-splicemap.t
Mads Kiilerich <mads@kiilerich.com>
parents: 16190
diff changeset
   193
  > `(hg -R ordered-hg2 id -r 1 -i --debug)`,\
123f96c4d454 tests: fix bashism in test-convert-splicemap.t
Mads Kiilerich <mads@kiilerich.com>
parents: 16190
diff changeset
   194
  > `(hg -R ordered-hg2 id -r 2 -i --debug)`
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   195
  > deadbeef102a90ea7b4a3361e4082ed620918c26 deadbeef102a90ea7b4a3361e4082ed620918c27
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   196
  > EOF
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   197
  $ hg convert --splicemap splicemap ordered ordered-hg2
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   198
  scanning source...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   199
  splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   200
  sorting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   201
  converting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   202
  0 changeaagain
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   203
  spliced in ['717d54d67e6c31fd75ffef2ff3042bdd98418437', '102a90ea7b4a3361e4082ed620918c261189a36a'] as parents of 7c364e7fa7d70ae525610c016317ed717b519d97
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   204
  $ glog -R ordered-hg2
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   205
  o    3:4cb04b9afbf2 "changeaagain" files: a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   206
  |\
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   207
  | o  2:102a90ea7b4a "addb" files: b
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   208
  | |
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   209
  o |  1:717d54d67e6c "changea" files: a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   210
  |/
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   211
  o  0:07f494440405 "adda" files: a
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   212
  
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   213
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   214
Test empty conversion
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   215
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   216
  $ hg convert --splicemap splicemap ordered ordered-hg2
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   217
  scanning source...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   218
  splice map revision deadbeef102a90ea7b4a3361e4082ed620918c26 is not being converted, ignoring
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   219
  sorting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   220
  converting...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   221
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   222
Test clonebranches
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   223
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   224
  $ hg --config convert.hg.clonebranches=true convert \
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   225
  >   --splicemap splicemap ordered ordered-hg3
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   226
  initializing destination ordered-hg3 repository
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   227
  scanning source...
16162
7e279d475669 convert: fix typos in error messages
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 16118
diff changeset
   228
  abort: revision 717d54d67e6c31fd75ffef2ff3042bdd98418437 not found in destination repository (lookups with clonebranches=true are not implemented)
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   229
  [255]
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   230
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   231
Test invalid dependency
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   232
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   233
  $ cat > splicemap <<EOF
16480
123f96c4d454 tests: fix bashism in test-convert-splicemap.t
Mads Kiilerich <mads@kiilerich.com>
parents: 16190
diff changeset
   234
  > `(hg -R ordered id -r 2 -i --debug)` \
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   235
  > deadbeef102a90ea7b4a3361e4082ed620918c26,\
16480
123f96c4d454 tests: fix bashism in test-convert-splicemap.t
Mads Kiilerich <mads@kiilerich.com>
parents: 16190
diff changeset
   236
  > `(hg -R ordered-hg2 id -r 2 -i --debug)`
16106
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   237
  > EOF
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   238
  $ hg convert --splicemap splicemap ordered ordered-hg4
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   239
  initializing destination ordered-hg4 repository
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   240
  scanning source...
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   241
  abort: unknown splice map parent: deadbeef102a90ea7b4a3361e4082ed620918c26
d75aa756149b convert: use splicemap entries when sorting revisions (issue1748)
Patrick Mezard <patrick@mezard.eu>
parents: 16105
diff changeset
   242
  [255]