comparison tests/test-rebase-scenario-global @ 6906:808f03f61ebe

Add rebase extension
author Stefano Tortarolo <stefano.tortarolo@gmail.com>
date Mon, 18 Aug 2008 21:16:31 +0200
parents
children 93609576244e
comparison
equal deleted inserted replaced
6905:248e54a9456e 6906:808f03f61ebe
1 #!/bin/sh
2
3 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
6
7 BASE=`pwd`
8
9 function addcommit {
10 echo $1 > $1
11 hg add $1
12 hg commit -d "${2} 0" -u test -m $1
13 }
14 function commit {
15 hg commit -d "${2} 0" -u test -m $1
16 }
17
18 function createrepo {
19 cd $BASE
20 rm -rf a
21 hg init a
22 cd a
23 addcommit "A" 0
24 addcommit "B" 1
25
26 hg update -C 0
27 addcommit "C" 2
28
29 hg update -C 0
30 addcommit "D" 3
31
32 hg merge -r 2
33 commit "E" 4
34
35 hg update -C 3
36 addcommit "F" 5
37 }
38
39 createrepo > /dev/null 2>&1
40 hg glog --template '{rev}: {desc}\n'
41
42 echo '% Rebasing'
43 echo '% B onto F - simple rebase'
44 hg rebase -s 1 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
45 hg glog --template '{rev}: {desc}\n'
46
47 createrepo > /dev/null 2>&1
48 echo '% B onto D - intermediate point'
49 hg rebase -s 1 -d 3 2>&1 | sed 's/\(saving bundle to \).*/\1/'
50 hg glog --template '{rev}: {desc}\n'
51
52 createrepo > /dev/null 2>&1
53 echo '% C onto F - skip of E'
54 hg rebase -s 2 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
55 hg glog --template '{rev}: {desc}\n'
56
57 createrepo > /dev/null 2>&1
58 echo '% D onto C - rebase of a branching point (skip E)'
59 hg rebase -s 3 -d 2 2>&1 | sed 's/\(saving bundle to \).*/\1/'
60 hg glog --template '{rev}: {desc}\n'
61
62 createrepo > /dev/null 2>&1
63 echo '% E onto F - merged revision having a parent in ancestors of target'
64 hg rebase -s 4 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
65 hg glog --template '{rev}: {desc}\n'
66
67 createrepo > /dev/null 2>&1
68 echo '% D onto B - E maintains C as parent'
69 hg rebase -s 3 -d 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
70 hg glog --template '{rev}: {desc}\n'
71
72 echo '% These will fail'
73 createrepo > /dev/null 2>&1
74 echo '% E onto D - rebase onto an ancestor'
75 hg rebase -s 4 -d 3
76 echo '% D onto E - rebase onto a descendant'
77 hg rebase -s 3 -d 4
78 echo '% E onto B - merge revision with both parents not in ancestors of target'
79 hg rebase -s 4 -d 1
80
81 exit 0