comparison tests/test-rebase-named-branches.t @ 15800:e4fc0f0b4f7e stable

rebase: reinstate old-style rev spec support for the source and base (issue3181) As of b12362ab13e7 (first released as part of Mercurial 2.0), the rebase command accepted ONLY revsets for the source and base arguments and no longer accepted old-style revision specifications. As a result, some revision names were no longer recognised, e.g. hg rebase --base br-anch abort: unknown revision 'br'! These arguments are now interpreted first as old-style revision specifications, then as revsets when no matching revision is found. This restores backwards compatibility with releases prior to 2.0.
author Steven Brown <StevenGBrown@gmail.com>
date Sun, 08 Jan 2012 23:09:35 +0800
parents 41885892796e
children bfd3ce759682
comparison
equal deleted inserted replaced
15799:e43c140eb08f 15800:e4fc0f0b4f7e
17 (run 'hg heads' to see heads, 'hg merge' to merge) 17 (run 'hg heads' to see heads, 'hg merge' to merge)
18 $ hg up tip 18 $ hg up tip
19 3 files updated, 0 files merged, 0 files removed, 0 files unresolved 19 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 $ cd .. 20 $ cd ..
21 21
22 $ hg clone -q -u . a a1
23
24 $ cd a1
25
26 $ hg update 3
27 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
28 $ hg branch dev-one
29 marked working directory as branch dev-one
30 (branches are permanent and global, did you want a bookmark?)
31 $ hg ci -m 'dev-one named branch'
32
33 $ hg update 7
34 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
35 $ hg branch dev-two
36 marked working directory as branch dev-two
37 (branches are permanent and global, did you want a bookmark?)
38
39 $ echo x > x
40
41 $ hg add x
42
43 $ hg ci -m 'dev-two named branch'
44
45 $ hg tglog
46 @ 9: 'dev-two named branch' dev-two
47 |
48 | o 8: 'dev-one named branch' dev-one
49 | |
50 o | 7: 'H'
51 | |
52 +---o 6: 'G'
53 | | |
54 o | | 5: 'F'
55 | | |
56 +---o 4: 'E'
57 | |
58 | o 3: 'D'
59 | |
60 | o 2: 'C'
61 | |
62 | o 1: 'B'
63 |/
64 o 0: 'A'
65
66
67 Branch name containing a dash (issue3181)
68
69 $ hg rebase -b dev-two -d dev-one --keepbranches
70 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
71
72 $ hg tglog
73 @ 9: 'dev-two named branch' dev-two
74 |
75 o 8: 'H'
76 |
77 | o 7: 'G'
78 |/|
79 o | 6: 'F'
80 | |
81 o | 5: 'dev-one named branch' dev-one
82 | |
83 | o 4: 'E'
84 | |
85 o | 3: 'D'
86 | |
87 o | 2: 'C'
88 | |
89 o | 1: 'B'
90 |/
91 o 0: 'A'
92
93 $ hg rebase -s dev-one -d 0 --keepbranches
94 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
95
96 $ hg tglog
97 @ 8: 'dev-two named branch' dev-two
98 |
99 o 7: 'H'
100 |
101 | o 6: 'G'
102 |/|
103 o | 5: 'F'
104 | |
105 | o 4: 'E'
106 |/
107 | o 3: 'D'
108 | |
109 | o 2: 'C'
110 | |
111 | o 1: 'B'
112 |/
113 o 0: 'A'
114
115 $ hg update 3
116 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
117 $ hg branch dev-one
118 marked working directory as branch dev-one
119 (branches are permanent and global, did you want a bookmark?)
120 $ hg ci -m 'dev-one named branch'
121
122 $ hg tglog
123 @ 9: 'dev-one named branch' dev-one
124 |
125 | o 8: 'dev-two named branch' dev-two
126 | |
127 | o 7: 'H'
128 | |
129 | | o 6: 'G'
130 | |/|
131 | o | 5: 'F'
132 | | |
133 | | o 4: 'E'
134 | |/
135 o | 3: 'D'
136 | |
137 o | 2: 'C'
138 | |
139 o | 1: 'B'
140 |/
141 o 0: 'A'
142
143 $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
144 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
145
146 $ hg tglog
147 @ 9: 'dev-two named branch' dev-two
148 |
149 o 8: 'H'
150 |
151 | o 7: 'G'
152 |/|
153 o | 6: 'F'
154 | |
155 o | 5: 'dev-one named branch' dev-one
156 | |
157 | o 4: 'E'
158 | |
159 o | 3: 'D'
160 | |
161 o | 2: 'C'
162 | |
163 o | 1: 'B'
164 |/
165 o 0: 'A'
166
167 $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches
168 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
169
170 $ hg tglog
171 @ 8: 'dev-two named branch' dev-two
172 |
173 o 7: 'H'
174 |
175 | o 6: 'G'
176 |/|
177 o | 5: 'F'
178 | |
179 | o 4: 'E'
180 |/
181 | o 3: 'D'
182 | |
183 | o 2: 'C'
184 | |
185 | o 1: 'B'
186 |/
187 o 0: 'A'
188
22 189
23 Rebasing descendant onto ancestor across different named branches 190 Rebasing descendant onto ancestor across different named branches
24 191
25 $ hg clone -q -u . a a1
26
27 $ cd a1
28
29 $ hg branch dev
30 marked working directory as branch dev
31 (branches are permanent and global, did you want a bookmark?)
32
33 $ echo x > x
34
35 $ hg add x
36
37 $ hg ci -m 'extra named branch'
38
39 $ hg tglog
40 @ 8: 'extra named branch' dev
41 |
42 o 7: 'H'
43 |
44 | o 6: 'G'
45 |/|
46 o | 5: 'F'
47 | |
48 | o 4: 'E'
49 |/
50 | o 3: 'D'
51 | |
52 | o 2: 'C'
53 | |
54 | o 1: 'B'
55 |/
56 o 0: 'A'
57
58
59
60 $ hg rebase -s 1 -d 8 --keepbranches 192 $ hg rebase -s 1 -d 8 --keepbranches
61 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) 193 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
62 194
63 $ hg tglog 195 $ hg tglog
64 @ 8: 'D' 196 @ 8: 'D'
65 | 197 |
66 o 7: 'C' 198 o 7: 'C'
67 | 199 |
68 o 6: 'B' 200 o 6: 'B'
69 | 201 |
70 o 5: 'extra named branch' dev 202 o 5: 'dev-two named branch' dev-two
71 | 203 |
72 o 4: 'H' 204 o 4: 'H'
73 | 205 |
74 | o 3: 'G' 206 | o 3: 'G'
75 |/| 207 |/|
91 | 223 |
92 o 7: 'C' 224 o 7: 'C'
93 | 225 |
94 o 6: 'B' 226 o 6: 'B'
95 | 227 |
96 o 5: 'extra named branch' 228 o 5: 'dev-two named branch'
97 | 229 |
98 o 4: 'H' 230 o 4: 'H'
99 | 231 |
100 | o 3: 'G' 232 | o 3: 'G'
101 |/| 233 |/|