File: test-rebase-check-restore

package info (click to toggle)
mercurial 1.6.4-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 17,928 kB
  • ctags: 6,062
  • sloc: python: 44,238; sh: 20,985; tcl: 3,578; ansic: 2,557; lisp: 1,412; makefile: 176; xml: 15
file content (70 lines) | stat: -rwxr-xr-x 1,282 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh

. $TESTDIR/helpers.sh

echo "[extensions]" >> $HGRCPATH
echo "graphlog=" >> $HGRCPATH
echo "rebase=" >> $HGRCPATH

BASE=`pwd`

addcommit () {
    echo $1 > $1
    hg add $1
    hg commit -d "${2} 0" -m $1
}

commit () {
    hg commit -d "${2} 0" -m $1
}

createrepo () {
    cd $BASE
    rm -rf a
    hg init a
    cd a
    addcommit "A" 0
    addcommit "B" 1
    echo "C" >> A
    commit "C" 2

    hg update -C 0
    echo "D" >> A
    commit "D" 3
    addcommit "E" 4

    hg update -C 0
    hg branch 'notdefault'
    echo "F" >> A
    commit "F" 5
}

echo
echo "% - Rebasing B onto E - check keep"
createrepo > /dev/null 2>&1
hg glog  --template '{rev}:{desc}:{branches}\n'
hg rebase -s 1 -d 4 --keep | hidebackup

echo
echo "% - Solve the conflict and go on"
echo 'conflict solved' > A
rm A.orig
hg resolve -m A
hg rebase --continue | hidebackup
hg glog  --template '{rev}:{desc}:{branches}\n'

echo
echo "% - Rebase F onto E - check keepbranches"
createrepo > /dev/null 2>&1
hg glog  --template '{rev}:{desc}:{branches}\n'
hg rebase -s 5 -d 4 --keepbranches | hidebackup

echo
echo "% - Solve the conflict and go on"
echo 'conflict solved' > A
rm A.orig
hg resolve -m A
hg rebase --continue 2>&1 | hidebackup
hg glog  --template '{rev}:{desc}:{branches}\n'

exit 0