Mercurial > hg-stable
comparison tests/test-rebase-parameters @ 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 "rebase=" >> $HGRCPATH | |
5 | |
6 function addcommit { | |
7 echo $1 > $1 | |
8 hg add $1 | |
9 hg commit -d "${2} 0" -u test -m $1 | |
10 } | |
11 | |
12 function commit { | |
13 hg commit -d "${2} 0" -u test -m $1 | |
14 } | |
15 | |
16 function createrepo { | |
17 hg init a | |
18 cd a | |
19 addcommit "c1" 0 | |
20 addcommit "c2" 1 | |
21 addcommit "c3" 2 | |
22 | |
23 hg update -C 1 | |
24 addcommit "l1" 3 | |
25 addcommit "l2" 4 | |
26 addcommit "l3" 5 | |
27 | |
28 hg update -C 2 | |
29 addcommit "r1" 6 | |
30 addcommit "r2" 7 | |
31 } | |
32 | |
33 createrepo > /dev/null 2&>1 | |
34 echo "% These fail" | |
35 echo | |
36 echo "% Use continue and abort" | |
37 hg rebase --continue --abort | |
38 | |
39 echo | |
40 echo "% Use continue and collapse" | |
41 hg rebase --continue --collapse | |
42 | |
43 echo | |
44 echo "% Use continue/abort and dest/source" | |
45 hg rebase --continue --dest 4 | |
46 | |
47 echo | |
48 echo "% Use source and base" | |
49 hg rebase --base 5 --source 4 | |
50 | |
51 echo | |
52 echo "% Rebase with no arguments - from current" | |
53 hg rebase | |
54 | |
55 echo | |
56 echo "% Rebase with no arguments - from the current branch" | |
57 hg update 6 | |
58 hg rebase | |
59 | |
60 echo "% ----------" | |
61 echo "% These work" | |
62 echo | |
63 echo "% Rebase with no arguments (from 3 onto 7)" | |
64 hg update -C 5 | |
65 hg rebase 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
66 | |
67 createrepo > /dev/null 2&>1 | |
68 echo | |
69 echo "% Rebase with base == '.' => same as no arguments (from 3 onto 7)" | |
70 hg update -C 5 | |
71 hg rebase --base . 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
72 | |
73 createrepo > /dev/null 2&>1 | |
74 echo | |
75 echo "% Rebase with dest == `hg branch` => same as no arguments (from 3 onto 7)" | |
76 hg update -C 5 | |
77 hg rebase --dest `hg branch` 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
78 | |
79 createrepo > /dev/null 2&>1 | |
80 echo | |
81 echo "% Specify only source (from 4 onto 7)" | |
82 hg rebase --source 4 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
83 | |
84 createrepo > /dev/null 2&>1 | |
85 echo | |
86 echo "% Specify only dest (from 3 onto 6)" | |
87 hg update -C 5 | |
88 hg rebase --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
89 | |
90 createrepo > /dev/null 2&>1 | |
91 echo | |
92 echo "% Specify only base (from 3 onto 7)" | |
93 hg rebase --base 5 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
94 | |
95 createrepo > /dev/null 2&>1 | |
96 echo | |
97 echo "% Specify source and dest (from 4 onto 6)" | |
98 hg rebase --source 4 --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
99 | |
100 createrepo > /dev/null 2&>1 | |
101 echo | |
102 echo "% Specify base and dest (from 3 onto 6)" | |
103 hg rebase --base 4 --dest 6 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
104 | |
105 exit 0 |