comparison tests/test-minitopic.t @ 3206:3ccde4699cf0

topic: introduce a minimal extensions to enable topic on the server This small extensions simply expose topic in the branch. This should help getting minimal support for topic from various hosting solution (eg: bitbucket maybe ?) See extensions help for details.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 15 Nov 2017 08:00:17 +0100
parents
children f7129e3d5a38
comparison
equal deleted inserted replaced
3205:0b85da2e8e2a 3206:3ccde4699cf0
1 $ . $TESTDIR/testlib/common.sh
2
3 setup
4 $ cat >> $HGRCPATH << EOF
5 > [extensions]
6 > share=
7 > blackbox=
8 > [web]
9 > allow_push = *
10 > push_ssl = no
11 > [phases]
12 > publish = False
13 > [paths]
14 > enabled = http://localhost:$HGPORT/
15 > disabled = http://localhost:$HGPORT2/
16 > EOF
17
18 $ hg init ./server-enabled
19 $ cat >> server-enabled/.hg/hgrc << EOF
20 > [extensions]
21 > serverminitopic=
22 > [experimental]
23 > server-mini-topic = yes
24 > EOF
25
26 $ hg share ./server-enabled ./server-disabled
27 updating working directory
28 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 $ cat >> server-disabled/.hg/hgrc << EOF
30 > [extensions]
31 > serverminitopic=
32 > [experimental]
33 > server-mini-topic = no
34 > EOF
35
36 $ hg init client-disabled
37 $ hg init client-enabled
38 $ cat >> client-enabled/.hg/hgrc << EOF
39 > [extensions]
40 > topic=
41 > EOF
42
43 $ hg serve -R server-enabled -p $HGPORT -d --pid-file hg1.pid --errorlog hg1.error
44 $ cat hg1.pid > $DAEMON_PIDS
45 $ hg serve -R server-disabled -p $HGPORT2 -d --pid-file hg2.pid --errorlog hg2.error
46 $ cat hg2.pid >> $DAEMON_PIDS
47
48 $ curl --silent http://localhost:$HGPORT/?cmd=capabilities | grep -o topics
49 topics
50 $ curl --silent http://localhost:$HGPORT2/?cmd=capabilities | grep -o topics
51 [1]
52
53 Pushing first changesets to the servers
54 --------------------------------------
55
56 $ cd client-enabled
57 $ mkcommit c_A0
58 $ hg push enabled
59 pushing to http://localhost:$HGPORT/
60 searching for changes
61 remote: adding changesets
62 remote: adding manifests
63 remote: adding file changes
64 remote: added 1 changesets with 1 changes to 1 files
65 $ mkcommit c_B0
66 $ hg push disabled
67 pushing to http://localhost:$HGPORT2/
68 searching for changes
69 remote: adding changesets
70 remote: adding manifests
71 remote: adding file changes
72 remote: added 1 changesets with 1 changes to 1 files
73
74 $ cat $TESTTMP/hg1.error
75 $ cat $TESTTMP/hg2.error
76
77 Pushing new head
78 ----------------
79
80 $ hg up 'desc("c_A0")'
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 $ mkcommit c_C0
83 created new head
84 $ hg push enabled
85 pushing to http://localhost:$HGPORT/
86 searching for changes
87 abort: push creates new remote head 22c9514ed811!
88 (merge or see 'hg help push' for details about pushing new heads)
89 [255]
90 $ hg push disabled
91 pushing to http://localhost:$HGPORT2/
92 searching for changes
93 abort: push creates new remote head 22c9514ed811!
94 (merge or see 'hg help push' for details about pushing new heads)
95 [255]
96
97 $ curl --silent http://localhost:$HGPORT/?cmd=branchmap | sort
98 default 0ab6d544d0efd629fda056601cfe95e73d1af210
99 $ curl --silent http://localhost:$HGPORT2/?cmd=branchmap | sort
100 default 0ab6d544d0efd629fda056601cfe95e73d1af210
101 $ cat $TESTTMP/hg1.error
102 $ cat $TESTTMP/hg2.error
103
104 Pushing new topic
105 -----------------
106
107 $ hg merge
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 (branch merge, don't forget to commit)
110 $ mkcommit c_D0
111 $ hg log -G
112 @ changeset: 3:9c660cf97499
113 |\ tag: tip
114 | | parent: 2:22c9514ed811
115 | | parent: 1:0ab6d544d0ef
116 | | user: test
117 | | date: Thu Jan 01 00:00:00 1970 +0000
118 | | summary: c_D0
119 | |
120 | o changeset: 2:22c9514ed811
121 | | parent: 0:14faebcf9752
122 | | user: test
123 | | date: Thu Jan 01 00:00:00 1970 +0000
124 | | summary: c_C0
125 | |
126 o | changeset: 1:0ab6d544d0ef
127 |/ user: test
128 | date: Thu Jan 01 00:00:00 1970 +0000
129 | summary: c_B0
130 |
131 o changeset: 0:14faebcf9752
132 user: test
133 date: Thu Jan 01 00:00:00 1970 +0000
134 summary: c_A0
135
136 $ hg push enabled
137 pushing to http://localhost:$HGPORT/
138 searching for changes
139 remote: adding changesets
140 remote: adding manifests
141 remote: adding file changes
142 remote: added 2 changesets with 2 changes to 2 files
143 $ hg up 'desc("c_C0")'
144 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
145 $ hg topic topic_A
146 marked working directory as topic: topic_A
147 $ mkcommit c_E0
148 active topic 'topic_A' grew its first changeset
149 $ hg push disabled
150 pushing to http://localhost:$HGPORT2/
151 searching for changes
152 abort: push creates new remote head f31af349535e!
153 (merge or see 'hg help push' for details about pushing new heads)
154 [255]
155 $ hg push enabled
156 pushing to http://localhost:$HGPORT/
157 searching for changes
158 remote: adding changesets
159 remote: adding manifests
160 remote: adding file changes
161 remote: added 1 changesets with 1 changes to 1 files (+1 heads)
162
163 $ curl --silent http://localhost:$HGPORT/?cmd=branchmap | sort
164 default 9c660cf97499ae01ccb6894880455c6ffa4b19cf
165 default%3Atopic_A f31af349535e413b6023f11b51a6afccf4139180
166 $ curl --silent http://localhost:$HGPORT2/?cmd=branchmap | sort
167 default 9c660cf97499ae01ccb6894880455c6ffa4b19cf f31af349535e413b6023f11b51a6afccf4139180
168 $ cat $TESTTMP/hg1.error
169 $ cat $TESTTMP/hg2.error
170
171 Pushing new head to a topic
172 ---------------------------
173
174 $ hg up 'desc("c_D0")'
175 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
176 $ hg topic topic_A
177 marked working directory as topic: topic_A
178 $ mkcommit c_F0
179 $ hg log -G
180 @ changeset: 5:82c5842e0472
181 | tag: tip
182 | topic: topic_A
183 | parent: 3:9c660cf97499
184 | user: test
185 | date: Thu Jan 01 00:00:00 1970 +0000
186 | summary: c_F0
187 |
188 | o changeset: 4:f31af349535e
189 | | topic: topic_A
190 | | parent: 2:22c9514ed811
191 | | user: test
192 | | date: Thu Jan 01 00:00:00 1970 +0000
193 | | summary: c_E0
194 | |
195 o | changeset: 3:9c660cf97499
196 |\| parent: 2:22c9514ed811
197 | | parent: 1:0ab6d544d0ef
198 | | user: test
199 | | date: Thu Jan 01 00:00:00 1970 +0000
200 | | summary: c_D0
201 | |
202 | o changeset: 2:22c9514ed811
203 | | parent: 0:14faebcf9752
204 | | user: test
205 | | date: Thu Jan 01 00:00:00 1970 +0000
206 | | summary: c_C0
207 | |
208 o | changeset: 1:0ab6d544d0ef
209 |/ user: test
210 | date: Thu Jan 01 00:00:00 1970 +0000
211 | summary: c_B0
212 |
213 o changeset: 0:14faebcf9752
214 user: test
215 date: Thu Jan 01 00:00:00 1970 +0000
216 summary: c_A0
217
218 $ hg push enabled
219 pushing to http://localhost:$HGPORT/
220 searching for changes
221 abort: push creates new remote head 82c5842e0472 on branch 'default:topic_A'!
222 (merge or see 'hg help push' for details about pushing new heads)
223 [255]
224 $ hg push disabled
225 pushing to http://localhost:$HGPORT2/
226 searching for changes
227 remote: adding changesets
228 remote: adding manifests
229 remote: adding file changes
230 remote: added 1 changesets with 1 changes to 1 files
231
232 $ curl --silent http://localhost:$HGPORT/?cmd=branchmap | sort
233 default 9c660cf97499ae01ccb6894880455c6ffa4b19cf
234 default%3Atopic_A f31af349535e413b6023f11b51a6afccf4139180 82c5842e047215160763f81ae93ae42c65b20a63
235 $ curl --silent http://localhost:$HGPORT2/?cmd=branchmap | sort
236 default f31af349535e413b6023f11b51a6afccf4139180 82c5842e047215160763f81ae93ae42c65b20a63
237 $ cat $TESTTMP/hg1.error
238 $ cat $TESTTMP/hg2.error