tests/test-rebase-pull
author Brodie Rao <brodie@bitheap.org>
Fri, 02 Apr 2010 15:22:19 -0500
changeset 10827 b66388f6adfa
parent 10775 c52057614c72
child 11198 b345b1cc124f
permissions -rwxr-xr-x
color: don't split colors across lines (which confuses less -R) Currently, less -R doesn't support colors spanning multiple lines; only the first line will be colorized. Instead of allowing colors to span multiple lines, the color extension now applies colors to each line it receives, even when ui.write() is given multiple lines in one call.
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
6910
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
     7
addcommit () {
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     8
    echo $1 > $1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
     9
    hg add $1
8168
8766fee6f225 tests: removed redundant "-u test" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 7786
diff changeset
    10
    hg commit -d "${2} 0" -m $1
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    11
}
6910
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
    12
93609576244e Debashify rebase tests
Brendan Cully <brendan@kublai.com>
parents: 6906
diff changeset
    13
commit () {
8168
8766fee6f225 tests: removed redundant "-u test" from test scripts
Martin Geisler <mg@lazybytes.net>
parents: 7786
diff changeset
    14
    hg commit -d "${2} 0" -m $1
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    15
}
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    16
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    17
rm -rf a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    18
hg init a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    19
cd a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    20
addcommit "C1" 0
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    21
addcommit "C2" 1
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    22
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    23
cd ..
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    24
hg clone a b
7786
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    25
# This is needed to test pull --rebase
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    26
hg clone a c
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    27
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    28
cd b
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    29
addcommit "L1" 2
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    30
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    31
cd ../a
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    32
addcommit "R1" 3
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    33
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    34
cd ../b
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    35
echo
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    36
echo "% Now b has one revision to be pulled from a"
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    37
hg pull --rebase 2>&1 | sed -e 's/\(saving bundle to \).*/\1/' \
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    38
                -e 's/\(pulling from \).*/\1/'
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    39
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    40
hg glog --template '{rev}:{desc}\n'
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
echo
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    43
echo "% Re-run pull --rebase"
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    44
hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    45
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    46
echo
7786
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    47
echo "% Invoke pull --rebase and nothing to rebase"
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    48
cd ../c
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    49
hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    50
hg glog --template '{rev}\n' -l 1
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    51
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    52
echo
8242
aee8455ee8ec Fix typeerror when specifying both --rebase and --pull
Martijn Pieters <mj@zopatista.com>
parents: 7786
diff changeset
    53
echo "% pull --rebase --update should ignore --update"
aee8455ee8ec Fix typeerror when specifying both --rebase and --pull
Martijn Pieters <mj@zopatista.com>
parents: 7786
diff changeset
    54
hg pull --rebase --update 2>&1 | sed 's/\(pulling from \).*/\1/'
aee8455ee8ec Fix typeerror when specifying both --rebase and --pull
Martijn Pieters <mj@zopatista.com>
parents: 7786
diff changeset
    55
aee8455ee8ec Fix typeerror when specifying both --rebase and --pull
Martijn Pieters <mj@zopatista.com>
parents: 7786
diff changeset
    56
echo
7786
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    57
echo "% pull --rebase doesn't update if nothing has been pulled"
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    58
hg up 1
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    59
hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
92455c1d6f83 rebase: pull --rebase updates if there is nothing to rebase
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 6910
diff changeset
    60
hg glog --template '{rev}\n' -l 1
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    61
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    62
exit 0