comparison tests/test-topic-debugcb.t @ 2903:d16781d7a061

tests: import section in 'test-topic-debugcb.t' We now have two levels of titles to clarify some aspect of the tests.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Sep 2017 12:02:27 +0200
parents f6e297fda5c6
children 4ae89b5834e6
comparison
equal deleted inserted replaced
2902:f6e297fda5c6 2903:d16781d7a061
1 ==================================================
1 Test for `hg debugconvertbookmark` added by topics 2 Test for `hg debugconvertbookmark` added by topics
2 ================================================== 3 ==================================================
3 4
4 $ . "$TESTDIR/testlib/topic_setup.sh" 5 $ . "$TESTDIR/testlib/topic_setup.sh"
5 6
10 > {if(bookmarks, " bookmark: {join(bookmarks,"\n bookmark:")}\n")}\ 11 > {if(bookmarks, " bookmark: {join(bookmarks,"\n bookmark:")}\n")}\
11 > {if(topics, " topic: {topics}\n")} 12 > {if(topics, " topic: {topics}\n")}
12 > EOF 13 > EOF
13 14
14 Setting up the things 15 Setting up the things
15 ===================== 16 ---------------------
16 17
17 $ hg init repo 18 $ hg init repo
18 $ cd repo 19 $ cd repo
19 $ echo "Hello" > a 20 $ echo "Hello" > a
20 $ hg commit -Aqm "First commit" 21 $ hg commit -Aqm "First commit"
35 | 36 |
36 | o [1:50634233706a] Second commit 37 | o [1:50634233706a] Second commit
37 |/ bookmark: hellos 38 |/ bookmark: hellos
38 o [0:3caf92e45cfb] First commit 39 o [0:3caf92e45cfb] First commit
39 40
41
42 Generic tests
43 =============
44
40 Help for the command 45 Help for the command
41 ==================== 46 --------------------
42 47
43 $ hg help debugconvertbookmark 48 $ hg help debugconvertbookmark
44 hg debugcb [-b BOOKMARK] [--all] 49 hg debugcb [-b BOOKMARK] [--all]
45 50
46 aliases: debugconvertbookmark 51 aliases: debugconvertbookmark
53 --all convert all bookmarks to topics 58 --all convert all bookmarks to topics
54 59
55 (some details hidden, use --verbose to show complete help) 60 (some details hidden, use --verbose to show complete help)
56 61
57 Running without any argument 62 Running without any argument
58 ============================ 63 ----------------------------
59 64
60 $ hg debugconvertbookmark 65 $ hg debugconvertbookmark
61 abort: you must specify either '--all' or '-b' 66 abort: you must specify either '--all' or '-b'
62 [255] 67 [255]
63 68
73 | | bookmark: secondfix 78 | | bookmark: secondfix
74 | o [2:8e79b09248c2] Fixing first 79 | o [2:8e79b09248c2] Fixing first
75 |/ 80 |/
76 o [0:3caf92e45cfb] First commit 81 o [0:3caf92e45cfb] First commit
77 82
83
78 Changing all bookmarks to topic 84 Changing all bookmarks to topic
79 =============================== 85 ===============================
80 86
87 Simple test
88 -----------
89
81 $ hg debugconvertbookmark --all 90 $ hg debugconvertbookmark --all
82 switching to topic secondfix 91 switching to topic secondfix
83 changed topic to "secondfix" on 2 revisions 92 changed topic to "secondfix" on 2 revisions
84 $ hg log -G 93 $ hg log -G
85 @ [6:6efc0524f97a] Fixing second 94 @ [6:6efc0524f97a] Fixing second
88 | topic: secondfix 97 | topic: secondfix
89 | o [4:ca8825a7eb18] Second commit 98 | o [4:ca8825a7eb18] Second commit
90 |/ topic: hellos 99 |/ topic: hellos
91 o [0:3caf92e45cfb] First commit 100 o [0:3caf92e45cfb] First commit
92 101
102
93 Trying with multiple bookmarks on a single changeset 103 Trying with multiple bookmarks on a single changeset
94 ==================================================== 104 ----------------------------------------------------
95 105
96 $ echo "multiple bookmarks" >> m 106 $ echo "multiple bookmarks" >> m
97 $ hg commit -Aqm "Trying multiple bookmarks" 107 $ hg commit -Aqm "Trying multiple bookmarks"
98 $ hg bookmark book1 108 $ hg bookmark book1
99 $ hg bookmark book2 109 $ hg bookmark book2
123 | topic: secondfix 133 | topic: secondfix
124 | o [4:ca8825a7eb18] Second commit 134 | o [4:ca8825a7eb18] Second commit
125 |/ topic: hellos 135 |/ topic: hellos
126 o [0:3caf92e45cfb] First commit 136 o [0:3caf92e45cfb] First commit
127 137
128 Another setup 138
129 ============== 139 Two bookmarks on two different topological branches
140 ---------------------------------------------------
130 141
131 $ cd .. 142 $ cd ..
132 $ rm -rf repo 143 $ rm -rf repo
133 $ hg init setup1 144 $ hg init setup1
134 $ cd setup1 145 $ cd setup1
177 |/ topic: bar 188 |/ topic: bar
178 o [1:a7922543592c] B 189 o [1:a7922543592c] B
179 | 190 |
180 o [0:fc58adec4bcd] A 191 o [0:fc58adec4bcd] A
181 192
182 Another Setup 193
183 ============= 194 Two bookmarks on top of each other
195 ----------------------------------
184 196
185 $ cd .. 197 $ cd ..
186 $ rm -rf setup1 198 $ rm -rf setup1
187 $ hg init setup2 199 $ hg init setup2
188 $ cd setup2 200 $ cd setup2