comparison tests/test-topic-debugcb.t @ 2901:52e6b28704a7

tests: add more tests for debugconvertbookmark
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 29 Aug 2017 18:13:33 +0530
parents 1928e9c802dd
children f6e297fda5c6
comparison
equal deleted inserted replaced
2900:1928e9c802dd 2901:52e6b28704a7
2 ================================================== 2 ==================================================
3 3
4 $ . "$TESTDIR/testlib/topic_setup.sh" 4 $ . "$TESTDIR/testlib/topic_setup.sh"
5 5
6 $ cat << EOF >> $HGRCPATH 6 $ cat << EOF >> $HGRCPATH
7 > drawdag=$RUNTESTDIR/drawdag.py
7 > [ui] 8 > [ui]
8 > logtemplate = [{rev}:{node|short}] {desc|firstline}\n\ 9 > logtemplate = [{rev}:{node|short}] {desc|firstline}\n\
9 > {if(bookmarks, " bookmark: {join(bookmarks,"\n bookmark:")}\n")}\ 10 > {if(bookmarks, " bookmark: {join(bookmarks,"\n bookmark:")}\n")}\
10 > {if(topics, " topic: {topics}\n")} 11 > {if(topics, " topic: {topics}\n")}
11 > EOF 12 > EOF
13
14 Setting up the things
15 =====================
12 16
13 $ hg init repo 17 $ hg init repo
14 $ cd repo 18 $ cd repo
15 $ echo "Hello" > a 19 $ echo "Hello" > a
16 $ hg commit -Aqm "First commit" 20 $ hg commit -Aqm "First commit"
119 | topic: secondfix 123 | topic: secondfix
120 | o [4:ca8825a7eb18] Second commit 124 | o [4:ca8825a7eb18] Second commit
121 |/ topic: hellos 125 |/ topic: hellos
122 o [0:3caf92e45cfb] First commit 126 o [0:3caf92e45cfb] First commit
123 127
128 Another setup
129 ==============
130
131 $ cd ..
132 $ rm -rf repo
133 $ hg init setup1
134 $ cd setup1
135 $ hg debugdrawdag <<EOF
136 > D F
137 > | |
138 > C E
139 > |/
140 > B
141 > |
142 > A
143 > EOF
144
145 $ hg log -G
146 o [5:11abe3fb10b8] F
147 |
148 | o [4:f585351a92f8] D
149 | |
150 o | [3:49cb92066bfd] E
151 | |
152 | o [2:26805aba1e60] C
153 |/
154 o [1:112478962961] B
155 |
156 o [0:426bada5c675] A
157
158 $ hg bookmark -r 5 foo
159 $ hg bookmark -r 4 bar
160 $ hg debugconvertbookmark --all
161 changed topic to "bar" on 2 revisions
162 changed topic to "foo" on 2 revisions
163 $ hg log -G
164 o [9:f07a5aaa3365] F
165 | topic: foo
166 o [8:00a25ca4fa07] E
167 | topic: foo
168 | o [7:603a45fb0033] D
169 | | topic: bar
170 | o [6:67dd4179b021] C
171 |/ topic: bar
172 | x [5:11abe3fb10b8] F
173 | |
174 | | x [4:f585351a92f8] D
175 | | |
176 | x | [3:49cb92066bfd] E
177 |/ /
178 | x [2:26805aba1e60] C
179 |/
180 o [1:112478962961] B
181 |
182 o [0:426bada5c675] A
183
184 Another Setup
185 =============
186
187 $ cd ..
188 $ rm -rf setup1
189 $ hg init setup2
190 $ cd setup2
191 $ hg debugdrawdag <<EOF
192 > E
193 > |
194 > D
195 > |
196 > C
197 > |
198 > B
199 > |
200 > A
201 > EOF
202
203 $ hg log -G
204 o [4:9bc730a19041] E
205 |
206 o [3:f585351a92f8] D
207 |
208 o [2:26805aba1e60] C
209 |
210 o [1:112478962961] B
211 |
212 o [0:426bada5c675] A
213
214 $ hg bookmark -r 4 foo
215 $ hg bookmark -r 2 bar
216
217 XXX: this should bot only put topic 'foo' on 3,4 but also 'bar' on 0,1,2
218
219 $ hg debugconvertbookmark --all
220 changed topic to "foo" on 2 revisions
221
222 $ hg log -G
223 o [6:4442f18c04c6] E
224 | topic: foo
225 o [5:0f81d1dec575] D
226 | topic: foo
227 | x [4:9bc730a19041] E
228 | |
229 | x [3:f585351a92f8] D
230 |/
231 o [2:26805aba1e60] C
232 | bookmark: bar
233 o [1:112478962961] B
234 |
235 o [0:426bada5c675] A
236