##// END OF EJS Templates
rebase: use helpers.sh in tests
Matt Mackall -
r11198:b345b1cc default
parent child Browse files
Show More
@@ -2,8 +2,16 b''
2
2
3 hideport() { sed "s/localhost:$HGPORT/localhost:\$HGPORT/"; }
3 hideport() { sed "s/localhost:$HGPORT/localhost:\$HGPORT/"; }
4
4
5 repr() { python -c "import sys; print repr(sys.stdin.read()).replace('\\n', '\n')" }
5 repr() { python -c "import sys; print repr(sys.stdin.read()).replace('\\n', '\n')"; }
6
7 hidehex() { python -c 'import sys, re; print re.replace("\b[0-9A-Fa-f]{12,40}", "X" * 12)'; }
8
9 hidetmp() { sed "s/$HGTMP/\$HGTMP/"; }
6
10
7 hidehex() { python -c 'import sys, re; print re.replace("\b[0-9A-Fa-f]{12,40}", "X" * 12)' }
11 hidebackup() { sed 's/\(saving bundle to \).*/\1/'; }
8
12
9 hidetmp() { sed "s/$HGTMP/\$HGTMP/"; } No newline at end of file
13 cleanrebase() {
14 sed -e 's/\(Rebase status stored to\).*/\1/' \
15 -e 's/\(Rebase status restored from\).*/\1/' \
16 -e 's/\(saving bundle to \).*/\1/';
17 }
@@ -1,15 +1,11 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
5 echo "bookmarks=" >> $HGRCPATH
7 echo "bookmarks=" >> $HGRCPATH
6
8
7 cleanoutput () {
8 sed -e 's/\(Rebase status stored to\).*/\1/' \
9 -e 's/\(Rebase status restored from\).*/\1/' \
10 -e 's/\(saving bundle to \).*/\1/'
11 }
12
13 echo % initialize repository
9 echo % initialize repository
14 hg init
10 hg init
15
11
@@ -33,6 +29,6 b' echo % bookmark list'
33 hg bookmark
29 hg bookmark
34
30
35 echo % rebase
31 echo % rebase
36 hg rebase -s two -d one 2>&1 | cleanoutput
32 hg rebase -s two -d one 2>&1 | cleanrebase
37
33
38 hg log
34 hg log
@@ -1,15 +1,11 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
6
8
7 cleanoutput () {
8 sed -e 's/\(Rebase status stored to\).*/\1/' \
9 -e 's/\(Rebase status restored from\).*/\1/' \
10 -e 's/\(saving bundle to \).*/\1/'
11 }
12
13 hg init a
9 hg init a
14 cd a
10 cd a
15 echo 'c1' >common
11 echo 'c1' >common
@@ -35,10 +31,10 b" hg glog --template '{rev}: {desc}\\n'"
35
31
36 echo
32 echo
37 echo '% Conflicting rebase'
33 echo '% Conflicting rebase'
38 hg rebase -s 3 -d 2 2>&1 | cleanoutput
34 hg rebase -s 3 -d 2 | cleanrebase
39
35
40 echo
36 echo
41 echo '% Abort'
37 echo '% Abort'
42 hg rebase --abort 2>&1 | cleanoutput
38 hg rebase --abort | cleanrebase
43
39
44 hg glog --template '{rev}: {desc}\n'
40 hg glog --template '{rev}: {desc}\n'
@@ -12,10 +12,10 b' o 0: C1'
12
12
13
13
14 % Conflicting rebase
14 % Conflicting rebase
15 merging common
16 warning: conflicts during merge.
15 warning: conflicts during merge.
17 merging common failed!
16 merging common failed!
18 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
17 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
18 merging common
19
19
20 % Abort
20 % Abort
21 rebase aborted
21 rebase aborted
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 createrepo() {
5 createrepo() {
4 rm -rf repo
6 rm -rf repo
5 hg init repo
7 hg init repo
@@ -52,7 +54,7 b" hg heads --template '{rev}:{node|short} "
52
54
53 echo
55 echo
54 echo '% Rebase part of branch2 (5-6) onto branch3 (8)'
56 echo '% Rebase part of branch2 (5-6) onto branch3 (8)'
55 hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 2>&1 | sed 's/\(saving bundle to \).*/\1/'
57 hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 | hidebackup
56
58
57 echo
59 echo
58 echo '% Branches'
60 echo '% Branches'
@@ -70,7 +72,7 b" echo '% Rebase head of branch3 (8) onto "
70 createrepo > /dev/null 2>&1
72 createrepo > /dev/null 2>&1
71 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
73 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
72
74
73 hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
75 hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 | hidebackup
74
76
75 echo
77 echo
76 echo '% Branches'
78 echo '% Branches'
@@ -89,7 +91,7 b" echo '% Rebase entire branch3 (7-8) onto"
89 createrepo > /dev/null 2>&1
91 createrepo > /dev/null 2>&1
90 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
92 hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n'
91
93
92 hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
94 hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 | hidebackup
93
95
94 echo
96 echo
95 echo '% Branches'
97 echo '% Branches'
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -41,28 +43,28 b' echo'
41 echo "% - Rebasing B onto E - check keep"
43 echo "% - Rebasing B onto E - check keep"
42 createrepo > /dev/null 2>&1
44 createrepo > /dev/null 2>&1
43 hg glog --template '{rev}:{desc}:{branches}\n'
45 hg glog --template '{rev}:{desc}:{branches}\n'
44 hg rebase -s 1 -d 4 --keep 2>&1 | sed 's/\(saving bundle to \).*/\1/'
46 hg rebase -s 1 -d 4 --keep | hidebackup
45
47
46 echo
48 echo
47 echo "% - Solve the conflict and go on"
49 echo "% - Solve the conflict and go on"
48 echo 'conflict solved' > A
50 echo 'conflict solved' > A
49 rm A.orig
51 rm A.orig
50 hg resolve -m A
52 hg resolve -m A
51 hg rebase --continue 2>&1 | sed 's/\(saving bundle to \).*/\1/'
53 hg rebase --continue | hidebackup
52 hg glog --template '{rev}:{desc}:{branches}\n'
54 hg glog --template '{rev}:{desc}:{branches}\n'
53
55
54 echo
56 echo
55 echo "% - Rebase F onto E - check keepbranches"
57 echo "% - Rebase F onto E - check keepbranches"
56 createrepo > /dev/null 2>&1
58 createrepo > /dev/null 2>&1
57 hg glog --template '{rev}:{desc}:{branches}\n'
59 hg glog --template '{rev}:{desc}:{branches}\n'
58 hg rebase -s 5 -d 4 --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
60 hg rebase -s 5 -d 4 --keepbranches | hidebackup
59
61
60 echo
62 echo
61 echo "% - Solve the conflict and go on"
63 echo "% - Solve the conflict and go on"
62 echo 'conflict solved' > A
64 echo 'conflict solved' > A
63 rm A.orig
65 rm A.orig
64 hg resolve -m A
66 hg resolve -m A
65 hg rebase --continue 2>&1 | sed 's/\(saving bundle to \).*/\1/'
67 hg rebase --continue 2>&1 | hidebackup
66 hg glog --template '{rev}:{desc}:{branches}\n'
68 hg glog --template '{rev}:{desc}:{branches}\n'
67
69
68 exit 0
70 exit 0
@@ -12,10 +12,10 b''
12 |/
12 |/
13 o 0:A:
13 o 0:A:
14
14
15 merging A
16 warning: conflicts during merge.
15 warning: conflicts during merge.
17 merging A failed!
16 merging A failed!
18 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
17 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
18 merging A
19
19
20 % - Solve the conflict and go on
20 % - Solve the conflict and go on
21 rebase completed
21 rebase completed
@@ -49,10 +49,10 b' o 0:A:'
49 |/
49 |/
50 o 0:A:
50 o 0:A:
51
51
52 merging A
53 warning: conflicts during merge.
52 warning: conflicts during merge.
54 merging A failed!
53 merging A failed!
55 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
54 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
55 merging A
56
56
57 % - Solve the conflict and go on
57 % - Solve the conflict and go on
58 adding branch
58 adding branch
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -43,7 +45,7 b' createrepo > /dev/null 2>&1'
43 hg glog --template '{rev}: {desc}\n'
45 hg glog --template '{rev}: {desc}\n'
44 echo '% Rebasing B onto H'
46 echo '% Rebasing B onto H'
45 hg up -C 3
47 hg up -C 3
46 hg rebase --collapse --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
48 hg rebase --collapse --keepbranches | hidebackup
47 hg glog --template '{rev}: {desc}\n'
49 hg glog --template '{rev}: {desc}\n'
48 echo "Expected A, B, C, D, F, H"
50 echo "Expected A, B, C, D, F, H"
49 hg manifest
51 hg manifest
@@ -51,7 +53,7 b' hg manifest'
51 createrepo > /dev/null 2>&1
53 createrepo > /dev/null 2>&1
52 echo
54 echo
53 echo '% Rebasing G onto H'
55 echo '% Rebasing G onto H'
54 hg rebase --base 6 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
56 hg rebase --base 6 --collapse | hidebackup
55 hg glog --template '{rev}: {desc}\n'
57 hg glog --template '{rev}: {desc}\n'
56 echo "Expected A, E, F, H"
58 echo "Expected A, E, F, H"
57 hg manifest
59 hg manifest
@@ -91,7 +93,7 b' hg rebase -s 2 --collapse'
91
93
92 echo
94 echo
93 echo '% Rebase and collapse - E onto H'
95 echo '% Rebase and collapse - E onto H'
94 hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
96 hg rebase -s 4 --collapse | hidebackup
95 hg glog --template '{rev}: {desc}\n'
97 hg glog --template '{rev}: {desc}\n'
96 echo "Expected A, B, C, E, F, H"
98 echo "Expected A, B, C, E, F, H"
97 hg manifest
99 hg manifest
@@ -130,7 +132,7 b" hg glog --template '{rev}: {desc}\\n'"
130
132
131 echo
133 echo
132 echo '% Rebase and collapse - E onto I'
134 echo '% Rebase and collapse - E onto I'
133 hg rebase -s 4 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
135 hg rebase -s 4 --collapse | hidebackup
134
136
135 hg glog --template '{rev}: {desc}\n'
137 hg glog --template '{rev}: {desc}\n'
136
138
@@ -166,7 +168,7 b" hg glog --template '{rev}: {desc}\\n'"
166
168
167 echo
169 echo
168 echo '% Rebase and collapse - B onto F'
170 echo '% Rebase and collapse - B onto F'
169 hg rebase -s 1 --collapse 2>&1 | sed 's/\(saving bundle to \).*/\1/'
171 hg rebase -s 1 --collapse | hidebackup
170
172
171 hg glog --template '{rev}: {desc}\n'
173 hg glog --template '{rev}: {desc}\n'
172
174
@@ -1,15 +1,11 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
6
8
7 cleanoutput () {
8 sed -e 's/\(Rebase status stored to\).*/\1/' \
9 -e 's/\(Rebase status restored from\).*/\1/' \
10 -e 's/\(saving bundle to \).*/\1/'
11 }
12
13 hg init a
9 hg init a
14 cd a
10 cd a
15 echo 'c1' >common
11 echo 'c1' >common
@@ -53,7 +49,7 b' echo'
53 echo '% Conclude rebase'
49 echo '% Conclude rebase'
54 echo 'resolved merge' >common
50 echo 'resolved merge' >common
55 hg resolve -m common
51 hg resolve -m common
56 hg rebase --continue 2>&1 | cleanoutput
52 hg rebase --continue | cleanrebase
57
53
58 hg glog --template '{rev}: {desc}\n'
54 hg glog --template '{rev}: {desc}\n'
59
55
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -33,7 +35,7 b' createrepo () {'
33 createrepo > /dev/null 2>&1
35 createrepo > /dev/null 2>&1
34 hg glog --template '{rev}: {desc}\n'
36 hg glog --template '{rev}: {desc}\n'
35 echo '% Rebasing D onto E detaching from C'
37 echo '% Rebasing D onto E detaching from C'
36 hg rebase --detach -s 3 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
38 hg rebase --detach -s 3 -d 4 | hidebackup
37 hg glog --template '{rev}: {desc}\n'
39 hg glog --template '{rev}: {desc}\n'
38 echo "Expected A, D, E"
40 echo "Expected A, D, E"
39 hg manifest
41 hg manifest
@@ -42,7 +44,7 b' echo'
42 createrepo > /dev/null 2>&1
44 createrepo > /dev/null 2>&1
43 hg glog --template '{rev}: {desc}\n'
45 hg glog --template '{rev}: {desc}\n'
44 echo '% Rebasing C onto E detaching from B'
46 echo '% Rebasing C onto E detaching from B'
45 hg rebase --detach -s 2 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
47 hg rebase --detach -s 2 -d 4 | hidebackup
46 hg glog --template '{rev}: {desc}\n'
48 hg glog --template '{rev}: {desc}\n'
47 echo "Expected A, C, D, E"
49 echo "Expected A, C, D, E"
48 hg manifest
50 hg manifest
@@ -51,7 +53,7 b' echo'
51 createrepo > /dev/null 2>&1
53 createrepo > /dev/null 2>&1
52 hg glog --template '{rev}: {desc}\n'
54 hg glog --template '{rev}: {desc}\n'
53 echo '% Rebasing B onto E using detach (same as not using it)'
55 echo '% Rebasing B onto E using detach (same as not using it)'
54 hg rebase --detach -s 1 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
56 hg rebase --detach -s 1 -d 4 | hidebackup
55 hg glog --template '{rev}: {desc}\n'
57 hg glog --template '{rev}: {desc}\n'
56 echo "Expected A, B, C, D, E"
58 echo "Expected A, B, C, D, E"
57 hg manifest
59 hg manifest
@@ -60,7 +62,7 b' echo'
60 createrepo > /dev/null 2>&1
62 createrepo > /dev/null 2>&1
61 hg glog --template '{rev}: {desc}\n'
63 hg glog --template '{rev}: {desc}\n'
62 echo '% Rebasing C onto E detaching from B and collapsing'
64 echo '% Rebasing C onto E detaching from B and collapsing'
63 hg rebase --detach --collapse -s 2 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
65 hg rebase --detach --collapse -s 2 -d 4 | hidebackup
64 hg glog --template '{rev}: {desc}\n'
66 hg glog --template '{rev}: {desc}\n'
65 echo "Expected A, C, D, E"
67 echo "Expected A, C, D, E"
66 hg manifest
68 hg manifest
@@ -1,5 +1,6 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
3 echo "[extensions]" >> $HGRCPATH
4 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
5 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
@@ -38,7 +39,7 b" hg glog --template '{rev}: {desc}\\n'"
38
39
39 echo
40 echo
40 echo "% - Rebasing B onto E"
41 echo "% - Rebasing B onto E"
41 hg rebase -s 1 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
42 hg rebase -s 1 -d 4 | hidebackup
42
43
43 echo
44 echo
44 echo "% - Force a commit on C during the interruption"
45 echo "% - Force a commit on C during the interruption"
@@ -66,7 +67,7 b" hg glog --template '{rev}: {desc}\\n'"
66
67
67 echo
68 echo
68 echo "% Rebasing B onto E"
69 echo "% Rebasing B onto E"
69 hg rebase -s 1 -d 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
70 hg rebase -s 1 -d 4 | hidebackup
70
71
71 echo
72 echo
72 echo "% Force a commit on B' during the interruption"
73 echo "% Force a commit on B' during the interruption"
@@ -11,10 +11,10 b' o 0: A'
11
11
12
12
13 % - Rebasing B onto E
13 % - Rebasing B onto E
14 merging A
15 warning: conflicts during merge.
14 warning: conflicts during merge.
16 merging A failed!
15 merging A failed!
17 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
16 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
17 merging A
18
18
19 % - Force a commit on C during the interruption
19 % - Force a commit on C during the interruption
20 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
20 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -73,10 +73,10 b' o 0: A'
73
73
74
74
75 % Rebasing B onto E
75 % Rebasing B onto E
76 merging A
77 warning: conflicts during merge.
76 warning: conflicts during merge.
78 merging A failed!
77 merging A failed!
79 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
78 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
79 merging A
80
80
81 % Force a commit on B' during the interruption
81 % Force a commit on B' during the interruption
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -25,7 +27,7 b" hg glog --template '{rev}:{desc}\\n'"
25 echo
27 echo
26 echo '% Rebase with no arguments - single revision in source branch'
28 echo '% Rebase with no arguments - single revision in source branch'
27 hg update -C 2
29 hg update -C 2
28 hg rebase 2>&1 | sed 's/\(saving bundle to \).*/\1/'
30 hg rebase | hidebackup
29 hg glog --template '{rev}:{desc}\n'
31 hg glog --template '{rev}:{desc}\n'
30
32
31 cd ..
33 cd ..
@@ -45,5 +47,5 b" hg glog --template '{rev}:{desc}\\n'"
45 echo
47 echo
46 echo '% Rebase with no arguments - single revision in target branch'
48 echo '% Rebase with no arguments - single revision in target branch'
47 hg update -C 3
49 hg update -C 3
48 hg rebase 2>&1 | sed 's/\(saving bundle to \).*/\1/'
50 hg rebase 2>&1 | hidebackup
49 hg glog --template '{rev}:{desc}\n'
51 hg glog --template '{rev}:{desc}\n'
@@ -26,7 +26,7 b" hg glog --template '{rev}:{desc}:{branch"
26 echo
26 echo
27 echo '% Rebase a branch while preserving the branch name'
27 echo '% Rebase a branch while preserving the branch name'
28 hg update -C 3
28 hg update -C 3
29 hg rebase -b 4 -d 3 --keepbranches 2>&1 | sed 's/\(saving bundle to \).*/\1/'
29 hg rebase -b 4 -d 3 --keepbranches -q
30 hg glog --template '{rev}:{desc}:{branches}\n'
30 hg glog --template '{rev}:{desc}:{branches}\n'
31 echo '% dirstate branch should be "notdefault"'
31 echo '% dirstate branch should be "notdefault"'
32 hg branch
32 hg branch
@@ -13,12 +13,6 b' o 0:c1:'
13
13
14 % Rebase a branch while preserving the branch name
14 % Rebase a branch while preserving the branch name
15 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
15 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
16 adding branch
17 adding changesets
18 adding manifests
19 adding file changes
20 added 1 changesets with 1 changes to 1 files
21 rebase completed
22 @ 4:r1:notdefault
16 @ 4:r1:notdefault
23 |
17 |
24 o 3:l2:
18 o 3:l2:
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -58,13 +60,13 b' echo'
58 echo '% Fix the 1st conflict'
60 echo '% Fix the 1st conflict'
59 echo 'mq1r1' > f
61 echo 'mq1r1' > f
60 hg resolve -m f
62 hg resolve -m f
61 hg rebase -c 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
63 hg rebase -c | hidebackup
62
64
63 echo
65 echo
64 echo '% Fix the 2nd conflict'
66 echo '% Fix the 2nd conflict'
65 echo 'mq1r1mq2' > f
67 echo 'mq1r1mq2' > f
66 hg resolve -m f
68 hg resolve -m f
67 hg rebase -c 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
69 hg rebase -c | hidebackup
68
70
69 hg glog --template '{rev} {desc} tags: {tags}\n'
71 hg glog --template '{rev} {desc} tags: {tags}\n'
70
72
@@ -109,7 +111,7 b' cat .hg/patches/f.patch | filterpatch'
109
111
110 echo
112 echo
111 echo '% Rebase the applied mq patches'
113 echo '% Rebase the applied mq patches'
112 hg rebase -s 2 -d 1 --quiet 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
114 hg rebase -s 2 -d 1 --quiet
113
115
114 echo '% And the patches are correct'
116 echo '% And the patches are correct'
115 echo '% Git patch'
117 echo '% Git patch'
@@ -2,6 +2,8 b''
2 # This emulates the effects of an hg pull --rebase in which the remote repo
2 # This emulates the effects of an hg pull --rebase in which the remote repo
3 # already has one local mq patch
3 # already has one local mq patch
4
4
5 source $TESTDIR/helpers.sh
6
5 echo "[extensions]" >> $HGRCPATH
7 echo "[extensions]" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
8 echo "graphlog=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
9 echo "rebase=" >> $HGRCPATH
@@ -40,5 +42,5 b' rm p1.patch'
40 echo
42 echo
41 echo '% Rebase'
43 echo '% Rebase'
42 hg up -C qtip
44 hg up -C qtip
43 hg rebase 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
45 hg rebase | hidebackup
44 hg glog --template '{rev} {desc} tags: {tags}\n'
46 hg glog --template '{rev} {desc} tags: {tags}\n'
@@ -21,10 +21,10 b' merging f failed!'
21 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
21 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
22
22
23 % Fix the 1st conflict
23 % Fix the 1st conflict
24 merging f
25 warning: conflicts during merge.
24 warning: conflicts during merge.
26 merging f failed!
25 merging f failed!
27 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
26 abort: fix unresolved conflicts with hg resolve then run hg rebase --continue
27 merging f
28
28
29 % Fix the 2nd conflict
29 % Fix the 2nd conflict
30 adding branch
30 adding branch
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -25,7 +27,7 b' echo D >> a'
25 hg commit -AmAD -u test -d '3 0'
27 hg commit -AmAD -u test -d '3 0'
26
28
27 hg glog --template '{rev}:{desc} {node|short}\n'
29 hg glog --template '{rev}:{desc} {node|short}\n'
28 hg rebase -q -s 1 -d 3 2>&1 | grep -v 'saving bundle'
30 hg rebase -q -s 1 -d 3 | hidebackup
29 hg glog --template '{rev}:{desc} {node|short}\n'
31 hg glog --template '{rev}:{desc} {node|short}\n'
30
32
31 exit 0
33 exit 0
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
5
7
@@ -62,7 +64,7 b' echo "% These work"'
62 echo
64 echo
63 echo "% Rebase with no arguments (from 3 onto 7)"
65 echo "% Rebase with no arguments (from 3 onto 7)"
64 hg update -C 5
66 hg update -C 5
65 hg rebase 2>&1 | sed 's/\(saving bundle to \).*/\1/'
67 hg rebase 2>&1 | hidebackup
66
68
67 echo "% Try to rollback after a rebase (fail)"
69 echo "% Try to rollback after a rebase (fail)"
68 hg rollback
70 hg rollback
@@ -71,38 +73,38 b' createrepo > /dev/null 2>&1'
71 echo
73 echo
72 echo "% Rebase with base == '.' => same as no arguments (from 3 onto 7)"
74 echo "% Rebase with base == '.' => same as no arguments (from 3 onto 7)"
73 hg update -C 5
75 hg update -C 5
74 hg rebase --base . 2>&1 | sed 's/\(saving bundle to \).*/\1/'
76 hg rebase --base . | hidebackup
75
77
76 createrepo > /dev/null 2>&1
78 createrepo > /dev/null 2>&1
77 echo
79 echo
78 echo "% Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7)"
80 echo "% Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7)"
79 hg update -C 5
81 hg update -C 5
80 hg rebase --dest `hg branch` 2>&1 | sed 's/\(saving bundle to \).*/\1/'
82 hg rebase --dest `hg branch` | hidebackup
81
83
82 createrepo > /dev/null 2>&1
84 createrepo > /dev/null 2>&1
83 echo
85 echo
84 echo "% Specify only source (from 4 onto 7)"
86 echo "% Specify only source (from 4 onto 7)"
85 hg rebase --source 4 2>&1 | sed 's/\(saving bundle to \).*/\1/'
87 hg rebase --source 4 | hidebackup
86
88
87 createrepo > /dev/null 2>&1
89 createrepo > /dev/null 2>&1
88 echo
90 echo
89 echo "% Specify only dest (from 3 onto 6)"
91 echo "% Specify only dest (from 3 onto 6)"
90 hg update -C 5
92 hg update -C 5
91 hg rebase --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
93 hg rebase --dest 6 | hidebackup
92
94
93 createrepo > /dev/null 2>&1
95 createrepo > /dev/null 2>&1
94 echo
96 echo
95 echo "% Specify only base (from 3 onto 7)"
97 echo "% Specify only base (from 3 onto 7)"
96 hg rebase --base 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
98 hg rebase --base 5 | hidebackup
97
99
98 createrepo > /dev/null 2>&1
100 createrepo > /dev/null 2>&1
99 echo
101 echo
100 echo "% Specify source and dest (from 4 onto 6)"
102 echo "% Specify source and dest (from 4 onto 6)"
101 hg rebase --source 4 --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
103 hg rebase --source 4 --dest 6 | hidebackup
102
104
103 createrepo > /dev/null 2>&1
105 createrepo > /dev/null 2>&1
104 echo
106 echo
105 echo "% Specify base and dest (from 3 onto 6)"
107 echo "% Specify base and dest (from 3 onto 6)"
106 hg rebase --base 4 --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/'
108 hg rebase --base 4 --dest 6 | hidebackup
107
109
108 exit 0
110 exit 0
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -34,14 +36,13 b' addcommit "R1" 3'
34 cd ../b
36 cd ../b
35 echo
37 echo
36 echo "% Now b has one revision to be pulled from a"
38 echo "% Now b has one revision to be pulled from a"
37 hg pull --rebase 2>&1 | sed -e 's/\(saving bundle to \).*/\1/' \
39 hg pull --rebase | hidebackup | sed -e 's/\(pulling from \).*/\1/'
38 -e 's/\(pulling from \).*/\1/'
39
40
40 hg glog --template '{rev}:{desc}\n'
41 hg glog --template '{rev}:{desc}\n'
41
42
42 echo
43 echo
43 echo "% Re-run pull --rebase"
44 echo "% Re-run pull --rebase"
44 hg pull --rebase 2>&1 | sed 's/\(pulling from \).*/\1/'
45 hg pull --rebase | sed 's/\(pulling from \).*/\1/'
45
46
46 echo
47 echo
47 echo "% Invoke pull --rebase and nothing to rebase"
48 echo "% Invoke pull --rebase and nothing to rebase"
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "rebase=" >> $HGRCPATH
6 echo "rebase=" >> $HGRCPATH
5 echo "[diff]" >> $HGRCPATH
7 echo "[diff]" >> $HGRCPATH
@@ -7,12 +9,6 b' echo "git=1" >> $HGRCPATH'
7
9
8 BASE=`pwd`
10 BASE=`pwd`
9
11
10 cleanoutput () {
11 sed -e 's/\(Rebase status stored to\).*/\1/' \
12 -e 's/\(Rebase status restored from\).*/\1/' \
13 -e 's/\(saving bundle to \).*/\1/'
14 }
15
16 hg init repo1
12 hg init repo1
17 cd repo1
13 cd repo1
18 echo "a">a
14 echo "a">a
@@ -28,7 +24,7 b" echo '% Rename is tracked'"
28 hg log -p -r tip --template '{rev}:{desc}\n'
24 hg log -p -r tip --template '{rev}:{desc}\n'
29
25
30 echo '% Rebase the revision containing the rename'
26 echo '% Rebase the revision containing the rename'
31 hg rebase -s 2 -d 1 --quiet 2>&1 | cleanoutput
27 hg rebase -s 2 -d 1 --quiet | cleanrebase
32
28
33 echo
29 echo
34 echo '% Rename is not lost'
30 echo '% Rename is not lost'
@@ -51,7 +47,7 b" echo '% Copy is tracked'"
51 hg log -p -r tip --template '{rev}:{desc}\n'
47 hg log -p -r tip --template '{rev}:{desc}\n'
52
48
53 echo '% Rebase the revision containing the copy'
49 echo '% Rebase the revision containing the copy'
54 hg rebase -s 2 -d 1 --quiet 2>&1 | cleanoutput
50 hg rebase -s 2 -d 1 --quiet | cleanrebase
55
51
56 echo
52 echo
57 echo '% Copy is not lost'
53 echo '% Copy is not lost'
@@ -1,5 +1,7 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 source $TESTDIR/helpers.sh
4
3 echo "[extensions]" >> $HGRCPATH
5 echo "[extensions]" >> $HGRCPATH
4 echo "graphlog=" >> $HGRCPATH
6 echo "graphlog=" >> $HGRCPATH
5 echo "rebase=" >> $HGRCPATH
7 echo "rebase=" >> $HGRCPATH
@@ -42,32 +44,32 b" hg glog --template '{rev}: {desc}\\n'"
42
44
43 echo '% Rebasing'
45 echo '% Rebasing'
44 echo '% B onto F - simple rebase'
46 echo '% B onto F - simple rebase'
45 hg rebase -s 1 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
47 hg rebase -s 1 -d 5 | hidebackup
46 hg glog --template '{rev}: {desc}\n'
48 hg glog --template '{rev}: {desc}\n'
47
49
48 createrepo > /dev/null 2>&1
50 createrepo > /dev/null 2>&1
49 echo '% B onto D - intermediate point'
51 echo '% B onto D - intermediate point'
50 hg rebase -s 1 -d 3 2>&1 | sed 's/\(saving bundle to \).*/\1/'
52 hg rebase -s 1 -d 3 | hidebackup
51 hg glog --template '{rev}: {desc}\n'
53 hg glog --template '{rev}: {desc}\n'
52
54
53 createrepo > /dev/null 2>&1
55 createrepo > /dev/null 2>&1
54 echo '% C onto F - skip of E'
56 echo '% C onto F - skip of E'
55 hg rebase -s 2 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
57 hg rebase -s 2 -d 5 | hidebackup
56 hg glog --template '{rev}: {desc}\n'
58 hg glog --template '{rev}: {desc}\n'
57
59
58 createrepo > /dev/null 2>&1
60 createrepo > /dev/null 2>&1
59 echo '% D onto C - rebase of a branching point (skip E)'
61 echo '% D onto C - rebase of a branching point (skip E)'
60 hg rebase -s 3 -d 2 2>&1 | sed 's/\(saving bundle to \).*/\1/'
62 hg rebase -s 3 -d 2 | hidebackup
61 hg glog --template '{rev}: {desc}\n'
63 hg glog --template '{rev}: {desc}\n'
62
64
63 createrepo > /dev/null 2>&1
65 createrepo > /dev/null 2>&1
64 echo '% E onto F - merged revision having a parent in ancestors of target'
66 echo '% E onto F - merged revision having a parent in ancestors of target'
65 hg rebase -s 4 -d 5 2>&1 | sed 's/\(saving bundle to \).*/\1/'
67 hg rebase -s 4 -d 5 | hidebackup
66 hg glog --template '{rev}: {desc}\n'
68 hg glog --template '{rev}: {desc}\n'
67
69
68 createrepo > /dev/null 2>&1
70 createrepo > /dev/null 2>&1
69 echo '% D onto B - E maintains C as parent'
71 echo '% D onto B - E maintains C as parent'
70 hg rebase -s 3 -d 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
72 hg rebase -s 3 -d 1 | hidebackup
71 hg glog --template '{rev}: {desc}\n'
73 hg glog --template '{rev}: {desc}\n'
72
74
73 echo '% These will fail (using --source)'
75 echo '% These will fail (using --source)'
General Comments 0
You need to be logged in to leave comments. Login now