Mercurial > evolve
comparison tests/test-topic-stack.t @ 1909:36112e361ee4
stack: display the base of the stack
Displaying the first parent of the stack seems useful. I'm even tempted to call
it 't0' and have the topic still active when 'hg up t0' is used to move to the
base.
As a side effect we gain a way to denote that the stack is not linear. I'm not
super convinced that it is the right way to display it, but this is better than
no information.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 14 Mar 2016 23:37:58 +0000 |
parents | 5e9ce6310720 |
children | 24986e5a537c |
comparison
equal
deleted
inserted
replaced
1908:dbd6d51e63f1 | 1909:36112e361ee4 |
---|---|
55 hg topic -l list all changeset in the topic | 55 hg topic -l list all changeset in the topic |
56 | 56 |
57 $ hg topic | 57 $ hg topic |
58 * foo | 58 * foo |
59 $ hg topic --list | 59 $ hg topic --list |
60 _ c_b | |
60 t0: c_c | 61 t0: c_c |
61 t1: c_d | 62 t1: c_d |
62 t2: c_e | 63 t2: c_e |
63 t3@ c_f (current) | 64 t3@ c_f (current) |
64 | 65 |
102 o 1 default {} draft c_b | 103 o 1 default {} draft c_b |
103 | | 104 | |
104 o 0 default {} draft c_a | 105 o 0 default {} draft c_a |
105 | 106 |
106 $ hg topic --list | 107 $ hg topic --list |
108 _ c_b | |
107 t0: c_c | 109 t0: c_c |
108 t1@ c_d (current) | 110 t1@ c_d (current) |
109 t2$ c_e (unstable) | 111 t2$ c_e (unstable) |
110 t3$ c_f (unstable) | 112 t3$ c_f (unstable) |
113 | |
114 Case with multiple heads on the topic | |
115 ------------------------------------- | |
116 | |
117 Make things linear again | |
118 | |
119 $ hg rebase -s 'desc(c_e)' -d 'desc(c_d) - obsolete()' | |
120 rebasing 4:91fa8808d101 "c_e" | |
121 rebasing 5:4ec5094907b7 "c_f" | |
122 $ hg log -G | |
123 o 9 default {foo} draft c_f | |
124 | | |
125 o 8 default {foo} draft c_e | |
126 | | |
127 @ 7 default {foo} draft c_d | |
128 | | |
129 o 2 default {foo} draft c_c | |
130 | | |
131 o 1 default {} draft c_b | |
132 | | |
133 o 0 default {} draft c_a | |
134 | |
135 | |
136 | |
137 Create the second branch | |
138 | |
139 $ hg up 'desc(c_d)' | |
140 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
141 $ echo aaa > ggg | |
142 $ hg add ggg | |
143 $ hg commit -m c_g | |
144 created new head | |
145 $ echo aaa > hhh | |
146 $ hg add hhh | |
147 $ hg commit -m c_h | |
148 created new head | |
149 $ hg log -G | |
150 @ 11 default {foo} draft c_h | |
151 | | |
152 o 10 default {foo} draft c_g | |
153 | | |
154 | o 9 default {foo} draft c_f | |
155 | | | |
156 | o 8 default {foo} draft c_e | |
157 |/ | |
158 o 7 default {foo} draft c_d | |
159 | | |
160 o 2 default {foo} draft c_c | |
161 | | |
162 o 1 default {} draft c_b | |
163 | | |
164 o 0 default {} draft c_a | |
165 | |
166 | |
167 Test output | |
168 | |
169 $ hg top -l | |
170 _ c_b | |
171 t0: c_c | |
172 t1: c_d | |
173 t2: c_g | |
174 t3@ c_h (current) | |
175 _ c_d | |
176 t4: c_e | |
177 t5: c_f | |
178 | |
179 Case with multiple heads on the topic with unstability involved | |
180 --------------------------------------------------------------- | |
181 | |
182 We amend the message to make sure the display base pick the right changeset | |
183 | |
184 $ hg up 'desc(c_d)' | |
185 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
186 $ echo ccc > ddd | |
187 $ hg commit --amend -m 'c_D' | |
188 $ hg rebase -d . -s 'desc(c_g)' | |
189 rebasing 10:11286b4fcb3d "c_g" | |
190 rebasing 11:3ad57527186d "c_h" | |
191 $ hg log -G | |
192 o 15 default {foo} draft c_h | |
193 | | |
194 o 14 default {foo} draft c_g | |
195 | | |
196 @ 13 default {foo} draft c_D | |
197 | | |
198 | o 9 default {foo} draft c_f | |
199 | | | |
200 | o 8 default {foo} draft c_e | |
201 | | | |
202 | x 7 default {foo} draft c_d | |
203 |/ | |
204 o 2 default {foo} draft c_c | |
205 | | |
206 o 1 default {} draft c_b | |
207 | | |
208 o 0 default {} draft c_a | |
209 | |
210 | |
211 $ hg topic --list | |
212 _ c_b | |
213 t0: c_c | |
214 t1@ c_D (current) | |
215 t2: c_g | |
216 t3: c_h | |
217 _ c_D | |
218 t4$ c_e (unstable) | |
219 t5$ c_f (unstable) |