tests/test-convert-splicemap.t
changeset 12531 a1cbcc1a21f6
parent 10119 bb5ea66789e3
child 15608 63ff8fe3a8f0
equal deleted inserted replaced
12530:f11793a8c107 12531:a1cbcc1a21f6
       
     1 
       
     2   $ echo "[extensions]" >> $HGRCPATH
       
     3   $ echo "convert=" >> $HGRCPATH
       
     4   $ echo 'graphlog =' >> $HGRCPATH
       
     5   $ glog()
       
     6   > {
       
     7   >     hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
       
     8   > }
       
     9   $ hg init repo1
       
    10   $ cd repo1
       
    11   $ echo a > a
       
    12   $ hg ci -Am adda
       
    13   adding a
       
    14   $ echo b > b
       
    15   $ echo a >> a
       
    16   $ hg ci -Am addb
       
    17   adding b
       
    18   $ PARENTID1=`hg id --debug -i`
       
    19   $ echo c > c
       
    20   $ hg ci -Am addc
       
    21   adding c
       
    22   $ PARENTID2=`hg id --debug -i`
       
    23   $ cd ..
       
    24   $ hg init repo2
       
    25   $ cd repo2
       
    26   $ echo b > a
       
    27   $ echo d > d
       
    28   $ hg ci -Am addaandd
       
    29   adding a
       
    30   adding d
       
    31   $ CHILDID1=`hg id --debug -i`
       
    32   $ echo d >> d
       
    33   $ hg ci -Am changed
       
    34   $ CHILDID2=`hg id --debug -i`
       
    35   $ echo e > e
       
    36   $ hg ci -Am adde
       
    37   adding e
       
    38   $ cd ..
       
    39 
       
    40 test invalid splicemap
       
    41 
       
    42   $ cat > splicemap <<EOF
       
    43   > $CHILDID2
       
    44   > EOF
       
    45   $ hg convert --splicemap splicemap repo2 repo1
       
    46   abort: syntax error in splicemap(1): key/value pair expected
       
    47   [255]
       
    48 
       
    49 splice repo2 on repo1
       
    50 
       
    51   $ cat > splicemap <<EOF
       
    52   > $CHILDID1 $PARENTID1
       
    53   > $CHILDID2 $PARENTID2,$CHILDID1
       
    54   > EOF
       
    55   $ hg clone repo1 target1
       
    56   updating to branch default
       
    57   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    58   $ hg convert --splicemap splicemap repo2 target1
       
    59   scanning source...
       
    60   sorting...
       
    61   converting...
       
    62   2 addaandd
       
    63   spliced in ['6d4c2037ddc2cb2627ac3a244ecce35283268f8e'] as parents of 527cdedf31fbd5ea708aa14eeecf53d4676f38db
       
    64   1 changed
       
    65   spliced in ['e55c719b85b60e5102fac26110ba626e7cb6b7dc', '527cdedf31fbd5ea708aa14eeecf53d4676f38db'] as parents of e4ea00df91897da3079a10fab658c1eddba6617b
       
    66   0 adde
       
    67   $ glog -R target1
       
    68   o  5 "adde" files: e
       
    69   |
       
    70   o    4 "changed" files: d
       
    71   |\
       
    72   | o  3 "addaandd" files: a d
       
    73   | |
       
    74   @ |  2 "addc" files: c
       
    75   |/
       
    76   o  1 "addb" files: a b
       
    77   |
       
    78   o  0 "adda" files: a
       
    79