tests/test-rebase-collapse
author Yuya Nishihara <yuya@tcha.org>
Thu, 08 Apr 2010 00:13:33 +0900
branchstable
changeset 10953 f1250e2e8fd1
parent 10762 129e96f7a87a
child 11198 b345b1cc124f
permissions -rwxr-xr-x
remoteui: copy http_proxy settings http_proxy settings of current repo's .hg/hgrc should be available on remoteui, so that the httprepo can use them when pulling via http.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     2
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     3
echo "[extensions]" >> $HGRCPATH
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     4
echo "graphlog=" >> $HGRCPATH
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     5
echo "rebase=" >> $HGRCPATH
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     6
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     7
BASE=`pwd`
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     8
6910
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
     9
addcommit () {
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    10
    echo $1 > $1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    11
    hg add $1
8168
8766fee6f225 tests: removed redundant "-u test" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 7278
diff changeset
    12
    hg commit -d "${2} 0" -m $1
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    13
}
6910
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
    14
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
    15
commit () {
8168
8766fee6f225 tests: removed redundant "-u test" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 7278
diff changeset
    16
    hg commit -d "${2} 0" -m $1
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    17
}
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    18
6910
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
    19
createrepo () {
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    20
    cd $BASE
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    21
    rm -rf a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    22
    hg init a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    23
    cd a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    24
    addcommit "A" 0
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    25
    addcommit "B" 1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    26
    addcommit "C" 2
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    27
    addcommit "D" 3
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    28
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    29
    hg update -C 0
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    30
    addcommit "E" 4
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    31
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    32
    hg update -C 0
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    33
    addcommit "F" 5
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    34
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    35
    hg merge -r 4
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    36
    commit "G" 6
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    37
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    38
    hg update -C 5
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    39
    addcommit "H" 7
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    40
}
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    41
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    42
createrepo > /dev/null 2>&1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    43
hg glog  --template '{rev}: {desc}\n'
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    44
echo '% Rebasing B onto H'
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    45
hg up -C 3
10762
129e96f7a87a rebase: fix --collapse with --keepbranches (issue2100)
Patrick Mezard <pmezard@gmail.com>
parents: 9815
diff changeset
    46
hg rebase --collapse --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    47
hg glog  --template '{rev}: {desc}\n'
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    48
echo "Expected A, B, C, D, F, H"
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    49
hg manifest
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    50
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    51
createrepo > /dev/null 2>&1
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    52
echo
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    53
echo '% Rebasing G onto H'
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    54
hg rebase --base 6 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    55
hg glog  --template '{rev}: {desc}\n'
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    56
echo "Expected A, E, F, H"
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    57
hg manifest
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    58
6910
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
    59
createrepocomplex () {
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    60
    cd $BASE
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    61
    rm -rf a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    62
    hg init a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    63
    cd a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    64
    addcommit "A" 0
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    65
    addcommit "B" 1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    66
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    67
    hg up 0
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    68
    addcommit "C" 2
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    69
    hg merge
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    70
    commit "D" 3
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    71
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    72
    hg up 1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    73
    addcommit "E" 4
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    74
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    75
    addcommit "F" 5
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    76
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    77
    hg merge
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    78
    commit "G" 6
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    79
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    80
    hg up 0
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    81
    addcommit "H" 7
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    82
}
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    83
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    84
echo
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    85
createrepocomplex > /dev/null 2>&1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    86
hg glog  --template '{rev}: {desc}\n'
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    87
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    88
echo
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    89
echo '% Rebase and collapse - more than one external (fail)'
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    90
hg rebase -s 2 --collapse
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    91
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    92
echo
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    93
echo '% Rebase and collapse - E onto H'
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    94
hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    95
hg glog  --template '{rev}: {desc}\n'
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    96
echo "Expected A, B, C, E, F, H"
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    97
hg manifest
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    98
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    99
createrepocomplex () {
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   100
    cd $BASE
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   101
    rm -rf a
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   102
    hg init a
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   103
    cd a
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   104
    addcommit "A" 0
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   105
    addcommit "B" 1
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   106
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   107
    hg up 0
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   108
    addcommit "C" 2
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   109
    hg merge
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   110
    commit "D" 3
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   111
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   112
    hg up 1
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   113
    addcommit "E" 4
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   114
    
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   115
    echo "F" > E
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   116
    commit "F" 5
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   117
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   118
    addcommit "G" 6
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   119
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   120
    hg merge
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   121
    commit "H" 7
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   122
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   123
    hg up 0
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   124
    addcommit "I" 8
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   125
}
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   126
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   127
echo
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   128
createrepocomplex > /dev/null 2>&1
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   129
hg glog  --template '{rev}: {desc}\n'
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   130
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   131
echo
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   132
echo '% Rebase and collapse - E onto I'
9815
49efeed49c94 rebase: make sure the newancestor is used during the whole update
Christian Boos <cboos@bct-technology.com>
parents: 8168
diff changeset
   133
hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
7278
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   134
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   135
hg glog  --template '{rev}: {desc}\n'
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   136
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   137
echo "Expected A, B, C, E, G, I"
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   138
hg manifest
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   139
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   140
echo 'Cat E:'
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   141
cat E
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   142
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   143
createrepocomplex () {
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   144
    cd $BASE
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   145
    rm -rf a
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   146
    hg init a
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   147
    cd a
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   148
    addcommit "A" 0
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   149
    addcommit "B" 1
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   150
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   151
    addcommit "C" 2
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   152
    hg up 1
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   153
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   154
    addcommit "D" 3
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   155
    
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   156
    hg merge
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   157
    commit "E" 4
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   158
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   159
    hg up 0
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   160
    addcommit "F" 5
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   161
}
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   162
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   163
echo
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   164
createrepocomplex > /dev/null 2>&1
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   165
hg glog  --template '{rev}: {desc}\n'
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   166
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   167
echo
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   168
echo '% Rebase and collapse - B onto F'
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   169
hg rebase -s 1 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   170
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   171
hg glog  --template '{rev}: {desc}\n'
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   172
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   173
echo "Expected A, B, C, D, F"
45495d784ad6 rebase: avoid redundant merges (issue1301)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
   174
hg manifest
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   175
exit 0