Mercurial > hg
comparison tests/test-treediscovery.t @ 14199:e3dd3dcd6059
treediscovery: fix regression when run against older repos (issue2793)
I ran the entire test suite with "known" and "getbundle" disabled in
localrepository. This generated failures because the old findoutgoing
had always queried remote's heads explicitly and thus always got them
back in the returned heads. treediscovery.findcommonincoming now
correctly returns remote's heads in all cases.
Also adds a dedicated test for running treediscovery against a
pre-getbundle HTTP server.
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Thu, 05 May 2011 12:53:33 +0200 |
parents | |
children | dc733eec9169 |
comparison
equal
deleted
inserted
replaced
14198:8f11fd321014 | 14199:e3dd3dcd6059 |
---|---|
1 Tests discovery against servers without getbundle support: | |
2 | |
3 $ CAP=getbundle | |
4 $ . "$TESTDIR/notcapable" | |
5 $ echo '[ui]' >>$HGRCPATH | |
6 $ echo 'logtemplate="{rev} {node|short}: {desc} {branches}\\n"' >>$HGRCPATH | |
7 $ echo '[extensions]' >>$HGRCPATH | |
8 $ echo 'graphlog=' >>$HGRCPATH | |
9 | |
10 Setup HTTP server control: | |
11 | |
12 $ export remote=http://localhost:$HGPORT/ | |
13 $ start() { | |
14 > echo '[web]' > $1/.hg/hgrc | |
15 > echo 'push_ssl = false' >> $1/.hg/hgrc | |
16 > echo 'allow_push = *' >> $1/.hg/hgrc | |
17 > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
18 > cat hg.pid >> $DAEMON_PIDS | |
19 > } | |
20 $ stop() { | |
21 > "$TESTDIR/killdaemons.py" | |
22 > } | |
23 | |
24 Both are empty: | |
25 | |
26 $ hg init empty1 | |
27 $ hg init empty2 | |
28 $ start empty2 | |
29 $ hg incoming -R empty1 $remote | |
30 comparing with http://localhost:$HGPORT/ | |
31 no changes found | |
32 [1] | |
33 $ hg outgoing -R empty1 $remote | |
34 comparing with http://localhost:$HGPORT/ | |
35 no changes found | |
36 [1] | |
37 $ hg pull -R empty1 $remote | |
38 pulling from http://localhost:$HGPORT/ | |
39 no changes found | |
40 $ hg push -R empty1 $remote | |
41 pushing to http://localhost:$HGPORT/ | |
42 no changes found | |
43 $ stop | |
44 | |
45 Base repo: | |
46 | |
47 $ hg init main | |
48 $ cd main | |
49 $ hg debugbuilddag -mo '+2:tbase @name1 +3:thead1 <tbase @name2 +4:thead2 @both /thead1 +2:tmaintip' | |
50 $ hg glog | |
51 o 11 a19bfa7e7328: r11 both | |
52 | | |
53 o 10 8b6bad1512e1: r10 both | |
54 | | |
55 o 9 025829e08038: r9 both | |
56 |\ | |
57 | o 8 d8f638ac69e9: r8 name2 | |
58 | | | |
59 | o 7 b6b4d315a2ac: r7 name2 | |
60 | | | |
61 | o 6 6c6f5d5f3c11: r6 name2 | |
62 | | | |
63 | o 5 70314b29987d: r5 name2 | |
64 | | | |
65 o | 4 e71dbbc70e03: r4 name1 | |
66 | | | |
67 o | 3 2c8d5d5ec612: r3 name1 | |
68 | | | |
69 o | 2 a7892891da29: r2 name1 | |
70 |/ | |
71 o 1 0019a3b924fd: r1 | |
72 | | |
73 o 0 d57206cc072a: r0 | |
74 | |
75 $ cd .. | |
76 $ start main | |
77 | |
78 Full clone: | |
79 | |
80 $ hg clone main full | |
81 updating to branch default | |
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
83 $ cd full | |
84 $ hg incoming $remote | |
85 comparing with http://localhost:$HGPORT/ | |
86 searching for changes | |
87 no changes found | |
88 [1] | |
89 $ hg outgoing $remote | |
90 comparing with http://localhost:$HGPORT/ | |
91 searching for changes | |
92 no changes found | |
93 [1] | |
94 $ hg pull $remote | |
95 pulling from http://localhost:$HGPORT/ | |
96 searching for changes | |
97 no changes found | |
98 $ hg push $remote | |
99 pushing to http://localhost:$HGPORT/ | |
100 searching for changes | |
101 no changes found | |
102 $ cd .. | |
103 | |
104 Local is empty: | |
105 | |
106 $ cd empty1 | |
107 $ hg incoming $remote | |
108 comparing with http://localhost:$HGPORT/ | |
109 0 d57206cc072a: r0 | |
110 1 0019a3b924fd: r1 | |
111 2 a7892891da29: r2 name1 | |
112 3 2c8d5d5ec612: r3 name1 | |
113 4 e71dbbc70e03: r4 name1 | |
114 5 70314b29987d: r5 name2 | |
115 6 6c6f5d5f3c11: r6 name2 | |
116 7 b6b4d315a2ac: r7 name2 | |
117 8 d8f638ac69e9: r8 name2 | |
118 9 025829e08038: r9 both | |
119 10 8b6bad1512e1: r10 both | |
120 11 a19bfa7e7328: r11 both | |
121 $ hg outgoing $remote | |
122 comparing with http://localhost:$HGPORT/ | |
123 no changes found | |
124 [1] | |
125 $ hg push $remote | |
126 pushing to http://localhost:$HGPORT/ | |
127 no changes found | |
128 $ hg pull $remote | |
129 pulling from http://localhost:$HGPORT/ | |
130 requesting all changes | |
131 adding changesets | |
132 adding manifests | |
133 adding file changes | |
134 added 12 changesets with 24 changes to 2 files | |
135 (run 'hg update' to get a working copy) | |
136 $ hg incoming $remote | |
137 comparing with http://localhost:$HGPORT/ | |
138 searching for changes | |
139 no changes found | |
140 [1] | |
141 $ cd .. | |
142 | |
143 Local is subset: | |
144 | |
145 $ hg clone main subset --rev name2 ; cd subset | |
146 adding changesets | |
147 adding manifests | |
148 adding file changes | |
149 added 6 changesets with 12 changes to 2 files | |
150 updating to branch name2 | |
151 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
152 $ hg incoming $remote | |
153 comparing with http://localhost:$HGPORT/ | |
154 searching for changes | |
155 6 a7892891da29: r2 name1 | |
156 7 2c8d5d5ec612: r3 name1 | |
157 8 e71dbbc70e03: r4 name1 | |
158 9 025829e08038: r9 both | |
159 10 8b6bad1512e1: r10 both | |
160 11 a19bfa7e7328: r11 both | |
161 $ hg outgoing $remote | |
162 comparing with http://localhost:$HGPORT/ | |
163 searching for changes | |
164 no changes found | |
165 [1] | |
166 $ hg push $remote | |
167 pushing to http://localhost:$HGPORT/ | |
168 searching for changes | |
169 no changes found | |
170 $ hg pull $remote | |
171 pulling from http://localhost:$HGPORT/ | |
172 searching for changes | |
173 adding changesets | |
174 adding manifests | |
175 adding file changes | |
176 added 6 changesets with 12 changes to 2 files | |
177 (run 'hg update' to get a working copy) | |
178 $ hg incoming $remote | |
179 comparing with http://localhost:$HGPORT/ | |
180 searching for changes | |
181 no changes found | |
182 [1] | |
183 $ cd .. | |
184 | |
185 Remote is empty: | |
186 | |
187 $ stop ; start empty2 | |
188 $ cd main | |
189 $ hg incoming $remote | |
190 comparing with http://localhost:$HGPORT/ | |
191 searching for changes | |
192 no changes found | |
193 [1] | |
194 $ hg outgoing $remote | |
195 comparing with http://localhost:$HGPORT/ | |
196 searching for changes | |
197 0 d57206cc072a: r0 | |
198 1 0019a3b924fd: r1 | |
199 2 a7892891da29: r2 name1 | |
200 3 2c8d5d5ec612: r3 name1 | |
201 4 e71dbbc70e03: r4 name1 | |
202 5 70314b29987d: r5 name2 | |
203 6 6c6f5d5f3c11: r6 name2 | |
204 7 b6b4d315a2ac: r7 name2 | |
205 8 d8f638ac69e9: r8 name2 | |
206 9 025829e08038: r9 both | |
207 10 8b6bad1512e1: r10 both | |
208 11 a19bfa7e7328: r11 both | |
209 $ hg pull $remote | |
210 pulling from http://localhost:$HGPORT/ | |
211 searching for changes | |
212 no changes found | |
213 $ hg push $remote | |
214 pushing to http://localhost:$HGPORT/ | |
215 searching for changes | |
216 remote: adding changesets | |
217 remote: adding manifests | |
218 remote: adding file changes | |
219 remote: added 12 changesets with 24 changes to 2 files | |
220 $ hg outgoing $remote | |
221 comparing with http://localhost:$HGPORT/ | |
222 searching for changes | |
223 no changes found | |
224 [1] | |
225 $ cd .. | |
226 | |
227 Local is superset: | |
228 | |
229 $ stop | |
230 $ hg clone main subset2 --rev name2 | |
231 adding changesets | |
232 adding manifests | |
233 adding file changes | |
234 added 6 changesets with 12 changes to 2 files | |
235 updating to branch name2 | |
236 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
237 $ start subset2 | |
238 $ cd main | |
239 $ hg incoming $remote | |
240 comparing with http://localhost:$HGPORT/ | |
241 searching for changes | |
242 no changes found | |
243 [1] | |
244 $ hg outgoing $remote | |
245 comparing with http://localhost:$HGPORT/ | |
246 searching for changes | |
247 2 a7892891da29: r2 name1 | |
248 3 2c8d5d5ec612: r3 name1 | |
249 4 e71dbbc70e03: r4 name1 | |
250 9 025829e08038: r9 both | |
251 10 8b6bad1512e1: r10 both | |
252 11 a19bfa7e7328: r11 both | |
253 $ hg pull $remote | |
254 pulling from http://localhost:$HGPORT/ | |
255 searching for changes | |
256 no changes found | |
257 $ hg push $remote | |
258 pushing to http://localhost:$HGPORT/ | |
259 searching for changes | |
260 abort: push creates new remote branches: both, name1! | |
261 (use 'hg push --new-branch' to create new remote branches) | |
262 [255] | |
263 $ hg push $remote --new-branch | |
264 pushing to http://localhost:$HGPORT/ | |
265 searching for changes | |
266 remote: adding changesets | |
267 remote: adding manifests | |
268 remote: adding file changes | |
269 remote: added 6 changesets with 12 changes to 2 files | |
270 $ hg outgoing $remote | |
271 comparing with http://localhost:$HGPORT/ | |
272 searching for changes | |
273 no changes found | |
274 [1] | |
275 $ cd .. | |
276 | |
277 $ stop | |
278 |