Show More
@@ -1,827 +1,827 b'' | |||
|
1 | 1 | #require serve |
|
2 | 2 | |
|
3 | 3 | $ cat << EOF >> $HGRCPATH |
|
4 | 4 | > [ui] |
|
5 | 5 | > logtemplate={rev}:{node|short} {desc|firstline} |
|
6 | 6 | > [phases] |
|
7 | 7 | > publish=False |
|
8 | 8 | > [experimental] |
|
9 | 9 | > evolution=createmarkers,exchange |
|
10 | 10 | > # drop me once bundle2 is the default, |
|
11 | 11 | > # added to get test change early. |
|
12 | 12 | > bundle2-exp = True |
|
13 | 13 | > EOF |
|
14 | 14 | |
|
15 | 15 | initialize |
|
16 | 16 | |
|
17 | 17 | $ hg init a |
|
18 | 18 | $ cd a |
|
19 | 19 | $ echo 'test' > test |
|
20 | 20 | $ hg commit -Am'test' |
|
21 | 21 | adding test |
|
22 | 22 | |
|
23 | 23 | set bookmarks |
|
24 | 24 | |
|
25 | 25 | $ hg bookmark X |
|
26 | 26 | $ hg bookmark Y |
|
27 | 27 | $ hg bookmark Z |
|
28 | 28 | |
|
29 | 29 | import bookmark by name |
|
30 | 30 | |
|
31 | 31 | $ hg init ../b |
|
32 | 32 | $ cd ../b |
|
33 | 33 | $ hg book Y |
|
34 | 34 | $ hg book |
|
35 | 35 | * Y -1:000000000000 |
|
36 | 36 | $ hg pull ../a |
|
37 | 37 | pulling from ../a |
|
38 | 38 | requesting all changes |
|
39 | 39 | adding changesets |
|
40 | 40 | adding manifests |
|
41 | 41 | adding file changes |
|
42 | 42 | added 1 changesets with 1 changes to 1 files |
|
43 | 43 | adding remote bookmark X |
|
44 | 44 | updating bookmark Y |
|
45 | 45 | adding remote bookmark Z |
|
46 | 46 | (run 'hg update' to get a working copy) |
|
47 | 47 | $ hg bookmarks |
|
48 | 48 | X 0:4e3505fd9583 |
|
49 | 49 | * Y 0:4e3505fd9583 |
|
50 | 50 | Z 0:4e3505fd9583 |
|
51 | 51 | $ hg debugpushkey ../a namespaces |
|
52 | 52 | bookmarks |
|
53 | 53 | namespaces |
|
54 | 54 | obsolete |
|
55 | 55 | phases |
|
56 | 56 | $ hg debugpushkey ../a bookmarks |
|
57 | 57 | X 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
58 | 58 | Y 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
59 | 59 | Z 4e3505fd95835d721066b76e75dbb8cc554d7f77 |
|
60 | 60 | |
|
61 | 61 | delete the bookmark to re-pull it |
|
62 | 62 | |
|
63 | 63 | $ hg book -d X |
|
64 | 64 | $ hg pull -B X ../a |
|
65 | 65 | pulling from ../a |
|
66 | 66 | no changes found |
|
67 | 67 | adding remote bookmark X |
|
68 | 68 | |
|
69 | 69 | finally no-op pull |
|
70 | 70 | |
|
71 | 71 | $ hg pull -B X ../a |
|
72 | 72 | pulling from ../a |
|
73 | 73 | no changes found |
|
74 | 74 | $ hg bookmark |
|
75 | 75 | X 0:4e3505fd9583 |
|
76 | 76 | * Y 0:4e3505fd9583 |
|
77 | 77 | Z 0:4e3505fd9583 |
|
78 | 78 | |
|
79 | 79 | export bookmark by name |
|
80 | 80 | |
|
81 | 81 | $ hg bookmark W |
|
82 | 82 | $ hg bookmark foo |
|
83 | 83 | $ hg bookmark foobar |
|
84 | 84 | $ hg push -B W ../a |
|
85 | 85 | pushing to ../a |
|
86 | 86 | searching for changes |
|
87 | 87 | no changes found |
|
88 | 88 | exporting bookmark W |
|
89 | 89 | [1] |
|
90 | 90 | $ hg -R ../a bookmarks |
|
91 | 91 | W -1:000000000000 |
|
92 | 92 | X 0:4e3505fd9583 |
|
93 | 93 | Y 0:4e3505fd9583 |
|
94 | 94 | * Z 0:4e3505fd9583 |
|
95 | 95 | |
|
96 | 96 | delete a remote bookmark |
|
97 | 97 | |
|
98 | 98 | $ hg book -d W |
|
99 | 99 | $ hg push -B W ../a |
|
100 | 100 | pushing to ../a |
|
101 | 101 | searching for changes |
|
102 | 102 | no changes found |
|
103 | 103 | deleting remote bookmark W |
|
104 | 104 | [1] |
|
105 | 105 | |
|
106 | 106 | push/pull name that doesn't exist |
|
107 | 107 | |
|
108 | 108 | $ hg push -B badname ../a |
|
109 | 109 | pushing to ../a |
|
110 | 110 | searching for changes |
|
111 | 111 | bookmark badname does not exist on the local or remote repository! |
|
112 | 112 | no changes found |
|
113 | 113 | [2] |
|
114 | 114 | $ hg pull -B anotherbadname ../a |
|
115 | 115 | pulling from ../a |
|
116 | 116 | abort: remote bookmark anotherbadname not found! |
|
117 | 117 | [255] |
|
118 | 118 | |
|
119 | 119 | divergent bookmarks |
|
120 | 120 | |
|
121 | 121 | $ cd ../a |
|
122 | 122 | $ echo c1 > f1 |
|
123 | 123 | $ hg ci -Am1 |
|
124 | 124 | adding f1 |
|
125 | 125 | $ hg book -f @ |
|
126 | 126 | $ hg book -f X |
|
127 | 127 | $ hg book |
|
128 | 128 | @ 1:0d2164f0ce0d |
|
129 | 129 | * X 1:0d2164f0ce0d |
|
130 | 130 | Y 0:4e3505fd9583 |
|
131 | 131 | Z 1:0d2164f0ce0d |
|
132 | 132 | |
|
133 | 133 | $ cd ../b |
|
134 | 134 | $ hg up |
|
135 | 135 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
136 | 136 | updating bookmark foobar |
|
137 | 137 | $ echo c2 > f2 |
|
138 | 138 | $ hg ci -Am2 |
|
139 | 139 | adding f2 |
|
140 | 140 | $ hg book -if @ |
|
141 | 141 | $ hg book -if X |
|
142 | 142 | $ hg book |
|
143 | 143 | @ 1:9b140be10808 |
|
144 | 144 | X 1:9b140be10808 |
|
145 | 145 | Y 0:4e3505fd9583 |
|
146 | 146 | Z 0:4e3505fd9583 |
|
147 | 147 | foo -1:000000000000 |
|
148 | 148 | * foobar 1:9b140be10808 |
|
149 | 149 | |
|
150 | 150 | $ hg pull --config paths.foo=../a foo |
|
151 | 151 | pulling from $TESTTMP/a (glob) |
|
152 | 152 | searching for changes |
|
153 | 153 | adding changesets |
|
154 | 154 | adding manifests |
|
155 | 155 | adding file changes |
|
156 | 156 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
157 | 157 | divergent bookmark @ stored as @foo |
|
158 | 158 | divergent bookmark X stored as X@foo |
|
159 | 159 | updating bookmark Z |
|
160 | 160 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
161 | 161 | $ hg book |
|
162 | 162 | @ 1:9b140be10808 |
|
163 | 163 | @foo 2:0d2164f0ce0d |
|
164 | 164 | X 1:9b140be10808 |
|
165 | 165 | X@foo 2:0d2164f0ce0d |
|
166 | 166 | Y 0:4e3505fd9583 |
|
167 | 167 | Z 2:0d2164f0ce0d |
|
168 | 168 | foo -1:000000000000 |
|
169 | 169 | * foobar 1:9b140be10808 |
|
170 | 170 | |
|
171 | 171 | (test that too many divergence of bookmark) |
|
172 | 172 | |
|
173 | 173 | $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -r 000000000000 "X@${i}"; done |
|
174 | 174 | $ hg pull ../a |
|
175 | 175 | pulling from ../a |
|
176 | 176 | searching for changes |
|
177 | 177 | no changes found |
|
178 | 178 | warning: failed to assign numbered name to divergent bookmark X |
|
179 | 179 | divergent bookmark @ stored as @1 |
|
180 | 180 | $ hg bookmarks | grep '^ X' | grep -v ':000000000000' |
|
181 | 181 | X 1:9b140be10808 |
|
182 | 182 | X@foo 2:0d2164f0ce0d |
|
183 | 183 | |
|
184 | 184 | (test that remotely diverged bookmarks are reused if they aren't changed) |
|
185 | 185 | |
|
186 | 186 | $ hg bookmarks | grep '^ @' |
|
187 | 187 | @ 1:9b140be10808 |
|
188 | 188 | @1 2:0d2164f0ce0d |
|
189 | 189 | @foo 2:0d2164f0ce0d |
|
190 | 190 | $ hg pull ../a |
|
191 | 191 | pulling from ../a |
|
192 | 192 | searching for changes |
|
193 | 193 | no changes found |
|
194 | 194 | warning: failed to assign numbered name to divergent bookmark X |
|
195 | 195 | divergent bookmark @ stored as @1 |
|
196 | 196 | $ hg bookmarks | grep '^ @' |
|
197 | 197 | @ 1:9b140be10808 |
|
198 | 198 | @1 2:0d2164f0ce0d |
|
199 | 199 | @foo 2:0d2164f0ce0d |
|
200 | 200 | |
|
201 | 201 | $ python $TESTDIR/seq.py 1 100 | while read i; do hg bookmarks -d "X@${i}"; done |
|
202 | 202 | $ hg bookmarks -d "@1" |
|
203 | 203 | |
|
204 | 204 | $ hg push -f ../a |
|
205 | 205 | pushing to ../a |
|
206 | 206 | searching for changes |
|
207 | 207 | adding changesets |
|
208 | 208 | adding manifests |
|
209 | 209 | adding file changes |
|
210 | 210 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
211 | 211 | $ hg -R ../a book |
|
212 | 212 | @ 1:0d2164f0ce0d |
|
213 | 213 | * X 1:0d2164f0ce0d |
|
214 | 214 | Y 0:4e3505fd9583 |
|
215 | 215 | Z 1:0d2164f0ce0d |
|
216 | 216 | |
|
217 | 217 | explicit pull should overwrite the local version (issue4439) |
|
218 | 218 | |
|
219 | 219 | $ hg pull --config paths.foo=../a foo -B X |
|
220 | 220 | pulling from $TESTTMP/a (glob) |
|
221 | 221 | no changes found |
|
222 | 222 | divergent bookmark @ stored as @foo |
|
223 | 223 | importing bookmark X |
|
224 | 224 | |
|
225 | 225 | reinstall state for further testing: |
|
226 | 226 | |
|
227 | 227 | $ hg book -fr 9b140be10808 X |
|
228 | 228 | |
|
229 | 229 | revsets should not ignore divergent bookmarks |
|
230 | 230 | |
|
231 | 231 | $ hg bookmark -fr 1 Z |
|
232 | 232 | $ hg log -r 'bookmark()' --template '{rev}:{node|short} {bookmarks}\n' |
|
233 | 233 | 0:4e3505fd9583 Y |
|
234 | 234 | 1:9b140be10808 @ X Z foobar |
|
235 | 235 | 2:0d2164f0ce0d @foo X@foo |
|
236 | 236 | $ hg log -r 'bookmark("X@foo")' --template '{rev}:{node|short} {bookmarks}\n' |
|
237 | 237 | 2:0d2164f0ce0d @foo X@foo |
|
238 | 238 | $ hg log -r 'bookmark("re:X@foo")' --template '{rev}:{node|short} {bookmarks}\n' |
|
239 | 239 | 2:0d2164f0ce0d @foo X@foo |
|
240 | 240 | |
|
241 | 241 | update a remote bookmark from a non-head to a head |
|
242 | 242 | |
|
243 | 243 | $ hg up -q Y |
|
244 | 244 | $ echo c3 > f2 |
|
245 | 245 | $ hg ci -Am3 |
|
246 | 246 | adding f2 |
|
247 | 247 | created new head |
|
248 | 248 | $ hg push ../a |
|
249 | 249 | pushing to ../a |
|
250 | 250 | searching for changes |
|
251 | 251 | adding changesets |
|
252 | 252 | adding manifests |
|
253 | 253 | adding file changes |
|
254 | 254 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
255 | 255 | updating bookmark Y |
|
256 | 256 | $ hg -R ../a book |
|
257 | 257 | @ 1:0d2164f0ce0d |
|
258 | 258 | * X 1:0d2164f0ce0d |
|
259 | 259 | Y 3:f6fc62dde3c0 |
|
260 | 260 | Z 1:0d2164f0ce0d |
|
261 | 261 | |
|
262 | 262 | update a bookmark in the middle of a client pulling changes |
|
263 | 263 | |
|
264 | 264 | $ cd .. |
|
265 | 265 | $ hg clone -q a pull-race |
|
266 | 266 | |
|
267 | 267 | We want to use http because it is stateless and therefore more susceptible to |
|
268 | 268 | race conditions |
|
269 | 269 | |
|
270 | 270 | $ hg -R pull-race serve -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log |
|
271 | 271 | $ cat pull-race.pid >> $DAEMON_PIDS |
|
272 | 272 | |
|
273 | 273 | $ hg clone -q http://localhost:$HGPORT/ pull-race2 |
|
274 | 274 | $ cd pull-race |
|
275 | 275 | $ hg up -q Y |
|
276 | 276 | $ echo c4 > f2 |
|
277 | 277 | $ hg ci -Am4 |
|
278 | 278 | $ echo c5 > f3 |
|
279 | 279 | $ cat <<EOF > .hg/hgrc |
|
280 | 280 | > [hooks] |
|
281 | 281 | > outgoing.makecommit = hg ci -Am5; echo committed in pull-race |
|
282 | 282 | > EOF |
|
283 | 283 | |
|
284 | 284 | (new config needs a server restart) |
|
285 | 285 | |
|
286 | 286 | $ cd .. |
|
287 | 287 | $ killdaemons.py |
|
288 | 288 | $ hg -R pull-race serve -p $HGPORT -d --pid-file=pull-race.pid -E main-error.log |
|
289 | 289 | $ cat pull-race.pid >> $DAEMON_PIDS |
|
290 | 290 | $ cd pull-race2 |
|
291 | 291 | $ hg -R $TESTTMP/pull-race book |
|
292 | 292 | @ 1:0d2164f0ce0d |
|
293 | 293 | X 1:0d2164f0ce0d |
|
294 | 294 | * Y 4:b0a5eff05604 |
|
295 | 295 | Z 1:0d2164f0ce0d |
|
296 | 296 | $ hg pull |
|
297 | 297 | pulling from http://localhost:$HGPORT/ |
|
298 | 298 | searching for changes |
|
299 | 299 | adding changesets |
|
300 | 300 | adding manifests |
|
301 | 301 | adding file changes |
|
302 | 302 | added 1 changesets with 1 changes to 1 files |
|
303 | 303 | updating bookmark Y |
|
304 | 304 | (run 'hg update' to get a working copy) |
|
305 | 305 | $ hg book |
|
306 | 306 | * @ 1:0d2164f0ce0d |
|
307 | 307 | X 1:0d2164f0ce0d |
|
308 | 308 | Y 4:b0a5eff05604 |
|
309 | 309 | Z 1:0d2164f0ce0d |
|
310 | 310 | |
|
311 | 311 | Update a bookmark right after the initial lookup -B (issue4689) |
|
312 | 312 | |
|
313 | 313 | $ echo c6 > ../pull-race/f3 # to be committed during the race |
|
314 | 314 | $ cat <<EOF > ../pull-race/.hg/hgrc |
|
315 | 315 | > [hooks] |
|
316 | 316 | > # If anything to commit, commit it right after the first key listing used |
|
317 | 317 | > # during lookup. This makes the commit appear before the actual getbundle |
|
318 | 318 | > # call. |
|
319 | 319 | > listkeys.makecommit= ((hg st | grep -q M) && (hg commit -m race; echo commited in pull-race)) || exit 0 |
|
320 | 320 | > EOF |
|
321 | 321 | |
|
322 | 322 | (new config need server restart) |
|
323 | 323 | |
|
324 | 324 | $ killdaemons.py |
|
325 | 325 | $ hg -R ../pull-race serve -p $HGPORT -d --pid-file=../pull-race.pid -E main-error.log |
|
326 | 326 | $ cat ../pull-race.pid >> $DAEMON_PIDS |
|
327 | 327 | |
|
328 | 328 | $ hg -R $TESTTMP/pull-race book |
|
329 | 329 | @ 1:0d2164f0ce0d |
|
330 | 330 | X 1:0d2164f0ce0d |
|
331 | 331 | * Y 5:35d1ef0a8d1b |
|
332 | 332 | Z 1:0d2164f0ce0d |
|
333 | 333 | $ hg pull -B Y |
|
334 | 334 | pulling from http://localhost:$HGPORT/ |
|
335 | 335 | searching for changes |
|
336 | 336 | adding changesets |
|
337 | 337 | adding manifests |
|
338 | 338 | adding file changes |
|
339 | 339 | added 1 changesets with 1 changes to 1 files |
|
340 | 340 | updating bookmark Y |
|
341 | 341 | (run 'hg update' to get a working copy) |
|
342 | 342 | $ hg book |
|
343 | 343 | * @ 1:0d2164f0ce0d |
|
344 | 344 | X 1:0d2164f0ce0d |
|
345 | 345 | Y 5:35d1ef0a8d1b |
|
346 | 346 | Z 1:0d2164f0ce0d |
|
347 | 347 | |
|
348 | 348 | (done with this section of the test) |
|
349 | 349 | |
|
350 | 350 | $ killdaemons.py |
|
351 | 351 | $ cd ../b |
|
352 | 352 | |
|
353 | 353 | diverging a remote bookmark fails |
|
354 | 354 | |
|
355 | 355 | $ hg up -q 4e3505fd9583 |
|
356 | 356 | $ echo c4 > f2 |
|
357 | 357 | $ hg ci -Am4 |
|
358 | 358 | adding f2 |
|
359 | 359 | created new head |
|
360 | 360 | $ echo c5 > f2 |
|
361 | 361 | $ hg ci -Am5 |
|
362 | 362 | $ hg log -G |
|
363 | 363 | @ 5:c922c0139ca0 5 |
|
364 | 364 | | |
|
365 | 365 | o 4:4efff6d98829 4 |
|
366 | 366 | | |
|
367 | 367 | | o 3:f6fc62dde3c0 3 |
|
368 | 368 | |/ |
|
369 | 369 | | o 2:0d2164f0ce0d 1 |
|
370 | 370 | |/ |
|
371 | 371 | | o 1:9b140be10808 2 |
|
372 | 372 | |/ |
|
373 | 373 | o 0:4e3505fd9583 test |
|
374 | 374 | |
|
375 | 375 | |
|
376 | 376 | $ hg book -f Y |
|
377 | 377 | |
|
378 | 378 | $ cat <<EOF > ../a/.hg/hgrc |
|
379 | 379 | > [web] |
|
380 | 380 | > push_ssl = false |
|
381 | 381 | > allow_push = * |
|
382 | 382 | > EOF |
|
383 | 383 | |
|
384 | 384 | $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid |
|
385 | 385 | $ cat ../hg2.pid >> $DAEMON_PIDS |
|
386 | 386 | |
|
387 | 387 | $ hg push http://localhost:$HGPORT2/ |
|
388 | 388 | pushing to http://localhost:$HGPORT2/ |
|
389 | 389 | searching for changes |
|
390 | 390 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! |
|
391 | 391 | (merge or see "hg help push" for details about pushing new heads) |
|
392 | 392 | [255] |
|
393 | 393 | $ hg -R ../a book |
|
394 | 394 | @ 1:0d2164f0ce0d |
|
395 | 395 | * X 1:0d2164f0ce0d |
|
396 | 396 | Y 3:f6fc62dde3c0 |
|
397 | 397 | Z 1:0d2164f0ce0d |
|
398 | 398 | |
|
399 | 399 | |
|
400 | 400 | Unrelated marker does not alter the decision |
|
401 | 401 | |
|
402 | 402 | $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
403 | 403 | $ hg push http://localhost:$HGPORT2/ |
|
404 | 404 | pushing to http://localhost:$HGPORT2/ |
|
405 | 405 | searching for changes |
|
406 | 406 | abort: push creates new remote head c922c0139ca0 with bookmark 'Y'! |
|
407 | 407 | (merge or see "hg help push" for details about pushing new heads) |
|
408 | 408 | [255] |
|
409 | 409 | $ hg -R ../a book |
|
410 | 410 | @ 1:0d2164f0ce0d |
|
411 | 411 | * X 1:0d2164f0ce0d |
|
412 | 412 | Y 3:f6fc62dde3c0 |
|
413 | 413 | Z 1:0d2164f0ce0d |
|
414 | 414 | |
|
415 | 415 | Update to a successor works |
|
416 | 416 | |
|
417 | 417 | $ hg id --debug -r 3 |
|
418 | 418 | f6fc62dde3c0771e29704af56ba4d8af77abcc2f |
|
419 | 419 | $ hg id --debug -r 4 |
|
420 | 420 | 4efff6d98829d9c824c621afd6e3f01865f5439f |
|
421 | 421 | $ hg id --debug -r 5 |
|
422 | 422 | c922c0139ca03858f655e4a2af4dd02796a63969 tip Y |
|
423 | 423 | $ hg debugobsolete f6fc62dde3c0771e29704af56ba4d8af77abcc2f cccccccccccccccccccccccccccccccccccccccc |
|
424 | 424 | $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc 4efff6d98829d9c824c621afd6e3f01865f5439f |
|
425 | 425 | $ hg push http://localhost:$HGPORT2/ |
|
426 | 426 | pushing to http://localhost:$HGPORT2/ |
|
427 | 427 | searching for changes |
|
428 | 428 | remote: adding changesets |
|
429 | 429 | remote: adding manifests |
|
430 | 430 | remote: adding file changes |
|
431 | 431 | remote: added 2 changesets with 2 changes to 1 files (+1 heads) |
|
432 | 432 | remote: 2 new obsolescence markers |
|
433 | 433 | updating bookmark Y |
|
434 | 434 | $ hg -R ../a book |
|
435 | 435 | @ 1:0d2164f0ce0d |
|
436 | 436 | * X 1:0d2164f0ce0d |
|
437 | 437 | Y 5:c922c0139ca0 |
|
438 | 438 | Z 1:0d2164f0ce0d |
|
439 | 439 | |
|
440 | 440 | hgweb |
|
441 | 441 | |
|
442 | 442 | $ cat <<EOF > .hg/hgrc |
|
443 | 443 | > [web] |
|
444 | 444 | > push_ssl = false |
|
445 | 445 | > allow_push = * |
|
446 | 446 | > EOF |
|
447 | 447 | |
|
448 | 448 | $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log |
|
449 | 449 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
450 | 450 | $ cd ../a |
|
451 | 451 | |
|
452 | 452 | $ hg debugpushkey http://localhost:$HGPORT/ namespaces |
|
453 | 453 | bookmarks |
|
454 | 454 | namespaces |
|
455 | 455 | obsolete |
|
456 | 456 | phases |
|
457 | 457 | $ hg debugpushkey http://localhost:$HGPORT/ bookmarks |
|
458 | 458 | @ 9b140be1080824d768c5a4691a564088eede71f9 |
|
459 | 459 | X 9b140be1080824d768c5a4691a564088eede71f9 |
|
460 | 460 | Y c922c0139ca03858f655e4a2af4dd02796a63969 |
|
461 | 461 | Z 9b140be1080824d768c5a4691a564088eede71f9 |
|
462 | 462 | foo 0000000000000000000000000000000000000000 |
|
463 | 463 | foobar 9b140be1080824d768c5a4691a564088eede71f9 |
|
464 | 464 | $ hg out -B http://localhost:$HGPORT/ |
|
465 | 465 | comparing with http://localhost:$HGPORT/ |
|
466 | 466 | searching for changed bookmarks |
|
467 | 467 | @ 0d2164f0ce0d |
|
468 | 468 | X 0d2164f0ce0d |
|
469 | 469 | Z 0d2164f0ce0d |
|
470 | 470 | foo |
|
471 | 471 | foobar |
|
472 | 472 | $ hg push -B Z http://localhost:$HGPORT/ |
|
473 | 473 | pushing to http://localhost:$HGPORT/ |
|
474 | 474 | searching for changes |
|
475 | 475 | no changes found |
|
476 | 476 | updating bookmark Z |
|
477 | 477 | [1] |
|
478 | 478 | $ hg book -d Z |
|
479 | 479 | $ hg in -B http://localhost:$HGPORT/ |
|
480 | 480 | comparing with http://localhost:$HGPORT/ |
|
481 | 481 | searching for changed bookmarks |
|
482 | 482 | @ 9b140be10808 |
|
483 | 483 | X 9b140be10808 |
|
484 | 484 | Z 0d2164f0ce0d |
|
485 | 485 | foo 000000000000 |
|
486 | 486 | foobar 9b140be10808 |
|
487 | 487 | $ hg pull -B Z http://localhost:$HGPORT/ |
|
488 | 488 | pulling from http://localhost:$HGPORT/ |
|
489 | 489 | no changes found |
|
490 | 490 | divergent bookmark @ stored as @1 |
|
491 | 491 | divergent bookmark X stored as X@1 |
|
492 | 492 | adding remote bookmark Z |
|
493 | 493 | adding remote bookmark foo |
|
494 | 494 | adding remote bookmark foobar |
|
495 | 495 | $ hg clone http://localhost:$HGPORT/ cloned-bookmarks |
|
496 | 496 | requesting all changes |
|
497 | 497 | adding changesets |
|
498 | 498 | adding manifests |
|
499 | 499 | adding file changes |
|
500 | 500 | added 5 changesets with 5 changes to 3 files (+2 heads) |
|
501 | 501 | 2 new obsolescence markers |
|
502 | 502 | updating to bookmark @ |
|
503 | 503 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
504 | 504 | $ hg -R cloned-bookmarks bookmarks |
|
505 | 505 | * @ 1:9b140be10808 |
|
506 | 506 | X 1:9b140be10808 |
|
507 | 507 | Y 4:c922c0139ca0 |
|
508 | 508 | Z 2:0d2164f0ce0d |
|
509 | 509 | foo -1:000000000000 |
|
510 | 510 | foobar 1:9b140be10808 |
|
511 | 511 | |
|
512 | 512 | $ cd .. |
|
513 | 513 | |
|
514 | 514 | Test to show result of bookmarks comparision |
|
515 | 515 | |
|
516 | 516 | $ mkdir bmcomparison |
|
517 | 517 | $ cd bmcomparison |
|
518 | 518 | |
|
519 | 519 | $ hg init source |
|
520 | 520 | $ hg -R source debugbuilddag '+2*2*3*4' |
|
521 | 521 | $ hg -R source log -G --template '{rev}:{node|short}' |
|
522 | 522 | o 4:e7bd5218ca15 |
|
523 | 523 | | |
|
524 | 524 | | o 3:6100d3090acf |
|
525 | 525 | |/ |
|
526 | 526 | | o 2:fa942426a6fd |
|
527 | 527 | |/ |
|
528 | 528 | | o 1:66f7d451a68b |
|
529 | 529 | |/ |
|
530 | 530 | o 0:1ea73414a91b |
|
531 | 531 | |
|
532 | 532 | $ hg -R source bookmarks -r 0 SAME |
|
533 | 533 | $ hg -R source bookmarks -r 0 ADV_ON_REPO1 |
|
534 | 534 | $ hg -R source bookmarks -r 0 ADV_ON_REPO2 |
|
535 | 535 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO1 |
|
536 | 536 | $ hg -R source bookmarks -r 0 DIFF_ADV_ON_REPO2 |
|
537 | 537 | $ hg -R source bookmarks -r 1 DIVERGED |
|
538 | 538 | |
|
539 | 539 | $ hg clone -U source repo1 |
|
540 | 540 | |
|
541 | 541 | (test that incoming/outgoing exit with 1, if there is no bookmark to |
|
542 | 542 | be exchanged) |
|
543 | 543 | |
|
544 | 544 | $ hg -R repo1 incoming -B |
|
545 | 545 | comparing with $TESTTMP/bmcomparison/source |
|
546 | 546 | searching for changed bookmarks |
|
547 | 547 | no changed bookmarks found |
|
548 | 548 | [1] |
|
549 | 549 | $ hg -R repo1 outgoing -B |
|
550 | 550 | comparing with $TESTTMP/bmcomparison/source |
|
551 | 551 | searching for changed bookmarks |
|
552 | 552 | no changed bookmarks found |
|
553 | 553 | [1] |
|
554 | 554 | |
|
555 | 555 | $ hg -R repo1 bookmarks -f -r 1 ADD_ON_REPO1 |
|
556 | 556 | $ hg -R repo1 bookmarks -f -r 2 ADV_ON_REPO1 |
|
557 | 557 | $ hg -R repo1 bookmarks -f -r 3 DIFF_ADV_ON_REPO1 |
|
558 | 558 | $ hg -R repo1 bookmarks -f -r 3 DIFF_DIVERGED |
|
559 | 559 | $ hg -R repo1 -q --config extensions.mq= strip 4 |
|
560 | 560 | $ hg -R repo1 log -G --template '{node|short} ({bookmarks})' |
|
561 | 561 | o 6100d3090acf (DIFF_ADV_ON_REPO1 DIFF_DIVERGED) |
|
562 | 562 | | |
|
563 | 563 | | o fa942426a6fd (ADV_ON_REPO1) |
|
564 | 564 | |/ |
|
565 | 565 | | o 66f7d451a68b (ADD_ON_REPO1 DIVERGED) |
|
566 | 566 | |/ |
|
567 | 567 | o 1ea73414a91b (ADV_ON_REPO2 DIFF_ADV_ON_REPO2 SAME) |
|
568 | 568 | |
|
569 | 569 | |
|
570 | 570 | $ hg clone -U source repo2 |
|
571 | 571 | $ hg -R repo2 bookmarks -f -r 1 ADD_ON_REPO2 |
|
572 | 572 | $ hg -R repo2 bookmarks -f -r 1 ADV_ON_REPO2 |
|
573 | 573 | $ hg -R repo2 bookmarks -f -r 2 DIVERGED |
|
574 | 574 | $ hg -R repo2 bookmarks -f -r 4 DIFF_ADV_ON_REPO2 |
|
575 | 575 | $ hg -R repo2 bookmarks -f -r 4 DIFF_DIVERGED |
|
576 | 576 | $ hg -R repo2 -q --config extensions.mq= strip 3 |
|
577 | 577 | $ hg -R repo2 log -G --template '{node|short} ({bookmarks})' |
|
578 | 578 | o e7bd5218ca15 (DIFF_ADV_ON_REPO2 DIFF_DIVERGED) |
|
579 | 579 | | |
|
580 | 580 | | o fa942426a6fd (DIVERGED) |
|
581 | 581 | |/ |
|
582 | 582 | | o 66f7d451a68b (ADD_ON_REPO2 ADV_ON_REPO2) |
|
583 | 583 | |/ |
|
584 | 584 | o 1ea73414a91b (ADV_ON_REPO1 DIFF_ADV_ON_REPO1 SAME) |
|
585 | 585 | |
|
586 | 586 | |
|
587 | 587 | (test that difference of bookmarks between repositories are fully shown) |
|
588 | 588 | |
|
589 | 589 | $ hg -R repo1 incoming -B repo2 -v |
|
590 | 590 | comparing with repo2 |
|
591 | 591 | searching for changed bookmarks |
|
592 | 592 | ADD_ON_REPO2 66f7d451a68b added |
|
593 | 593 | ADV_ON_REPO2 66f7d451a68b advanced |
|
594 | 594 | DIFF_ADV_ON_REPO2 e7bd5218ca15 changed |
|
595 | 595 | DIFF_DIVERGED e7bd5218ca15 changed |
|
596 | 596 | DIVERGED fa942426a6fd diverged |
|
597 | 597 | $ hg -R repo1 outgoing -B repo2 -v |
|
598 | 598 | comparing with repo2 |
|
599 | 599 | searching for changed bookmarks |
|
600 | 600 | ADD_ON_REPO1 66f7d451a68b added |
|
601 | 601 | ADD_ON_REPO2 deleted |
|
602 | 602 | ADV_ON_REPO1 fa942426a6fd advanced |
|
603 | 603 | DIFF_ADV_ON_REPO1 6100d3090acf advanced |
|
604 | 604 | DIFF_ADV_ON_REPO2 1ea73414a91b changed |
|
605 | 605 | DIFF_DIVERGED 6100d3090acf changed |
|
606 | 606 | DIVERGED 66f7d451a68b diverged |
|
607 | 607 | |
|
608 | 608 | $ hg -R repo2 incoming -B repo1 -v |
|
609 | 609 | comparing with repo1 |
|
610 | 610 | searching for changed bookmarks |
|
611 | 611 | ADD_ON_REPO1 66f7d451a68b added |
|
612 | 612 | ADV_ON_REPO1 fa942426a6fd advanced |
|
613 | 613 | DIFF_ADV_ON_REPO1 6100d3090acf changed |
|
614 | 614 | DIFF_DIVERGED 6100d3090acf changed |
|
615 | 615 | DIVERGED 66f7d451a68b diverged |
|
616 | 616 | $ hg -R repo2 outgoing -B repo1 -v |
|
617 | 617 | comparing with repo1 |
|
618 | 618 | searching for changed bookmarks |
|
619 | 619 | ADD_ON_REPO1 deleted |
|
620 | 620 | ADD_ON_REPO2 66f7d451a68b added |
|
621 | 621 | ADV_ON_REPO2 66f7d451a68b advanced |
|
622 | 622 | DIFF_ADV_ON_REPO1 1ea73414a91b changed |
|
623 | 623 | DIFF_ADV_ON_REPO2 e7bd5218ca15 advanced |
|
624 | 624 | DIFF_DIVERGED e7bd5218ca15 changed |
|
625 | 625 | DIVERGED fa942426a6fd diverged |
|
626 | 626 | |
|
627 | 627 | $ cd .. |
|
628 | 628 | |
|
629 | 629 | Pushing a bookmark should only push the changes required by that |
|
630 | 630 | bookmark, not all outgoing changes: |
|
631 | 631 | $ hg clone http://localhost:$HGPORT/ addmarks |
|
632 | 632 | requesting all changes |
|
633 | 633 | adding changesets |
|
634 | 634 | adding manifests |
|
635 | 635 | adding file changes |
|
636 | 636 | added 5 changesets with 5 changes to 3 files (+2 heads) |
|
637 | 637 | 2 new obsolescence markers |
|
638 | 638 | updating to bookmark @ |
|
639 | 639 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
640 | 640 | $ cd addmarks |
|
641 | 641 | $ echo foo > foo |
|
642 | 642 | $ hg add foo |
|
643 | 643 | $ hg commit -m 'add foo' |
|
644 | 644 | $ echo bar > bar |
|
645 | 645 | $ hg add bar |
|
646 | 646 | $ hg commit -m 'add bar' |
|
647 | 647 | $ hg co "tip^" |
|
648 | 648 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
649 | 649 | (leaving bookmark @) |
|
650 | 650 | $ hg book add-foo |
|
651 | 651 | $ hg book -r tip add-bar |
|
652 | 652 | Note: this push *must* push only a single changeset, as that's the point |
|
653 | 653 | of this test. |
|
654 | 654 | $ hg push -B add-foo --traceback |
|
655 | 655 | pushing to http://localhost:$HGPORT/ |
|
656 | 656 | searching for changes |
|
657 | 657 | remote: adding changesets |
|
658 | 658 | remote: adding manifests |
|
659 | 659 | remote: adding file changes |
|
660 | 660 | remote: added 1 changesets with 1 changes to 1 files |
|
661 | 661 | exporting bookmark add-foo |
|
662 | 662 | |
|
663 | 663 | pushing a new bookmark on a new head does not require -f if -B is specified |
|
664 | 664 | |
|
665 | 665 | $ hg up -q X |
|
666 | 666 | $ hg book W |
|
667 | 667 | $ echo c5 > f2 |
|
668 | 668 | $ hg ci -Am5 |
|
669 | 669 | created new head |
|
670 | 670 | $ hg push -B W |
|
671 | 671 | pushing to http://localhost:$HGPORT/ |
|
672 | 672 | searching for changes |
|
673 | 673 | remote: adding changesets |
|
674 | 674 | remote: adding manifests |
|
675 | 675 | remote: adding file changes |
|
676 | 676 | remote: added 1 changesets with 1 changes to 1 files (+1 heads) |
|
677 | 677 | exporting bookmark W |
|
678 | 678 | $ hg -R ../b id -r W |
|
679 | 679 | cc978a373a53 tip W |
|
680 | 680 | |
|
681 | 681 | pushing an existing but divergent bookmark with -B still requires -f |
|
682 | 682 | |
|
683 | $ hg clone -q . r | |
|
683 | $ hg clone -q . ../r | |
|
684 | 684 | $ hg up -q X |
|
685 | 685 | $ echo 1 > f2 |
|
686 | 686 | $ hg ci -qAml |
|
687 | 687 | |
|
688 | $ cd r | |
|
688 | $ cd ../r | |
|
689 | 689 | $ hg up -q X |
|
690 | 690 | $ echo 2 > f2 |
|
691 | 691 | $ hg ci -qAmr |
|
692 | 692 | $ hg push -B X |
|
693 | 693 | pushing to $TESTTMP/addmarks (glob) |
|
694 | 694 | searching for changes |
|
695 | 695 | remote has heads on branch 'default' that are not known locally: a2a606d9ff1b |
|
696 | 696 | abort: push creates new remote head 54694f811df9 with bookmark 'X'! |
|
697 | 697 | (pull and merge or see "hg help push" for details about pushing new heads) |
|
698 | 698 | [255] |
|
699 | $ cd .. | |
|
699 | $ cd ../addmarks | |
|
700 | 700 | |
|
701 | 701 | Check summary output for incoming/outgoing bookmarks |
|
702 | 702 | |
|
703 | 703 | $ hg bookmarks -d X |
|
704 | 704 | $ hg bookmarks -d Y |
|
705 | 705 | $ hg summary --remote | grep '^remote:' |
|
706 | 706 | remote: *, 2 incoming bookmarks, 1 outgoing bookmarks (glob) |
|
707 | 707 | |
|
708 | 708 | $ cd .. |
|
709 | 709 | |
|
710 | 710 | pushing an unchanged bookmark should result in no changes |
|
711 | 711 | |
|
712 | 712 | $ hg init unchanged-a |
|
713 | 713 | $ hg init unchanged-b |
|
714 | 714 | $ cd unchanged-a |
|
715 | 715 | $ echo initial > foo |
|
716 | 716 | $ hg commit -A -m initial |
|
717 | 717 | adding foo |
|
718 | 718 | $ hg bookmark @ |
|
719 | 719 | $ hg push -B @ ../unchanged-b |
|
720 | 720 | pushing to ../unchanged-b |
|
721 | 721 | searching for changes |
|
722 | 722 | adding changesets |
|
723 | 723 | adding manifests |
|
724 | 724 | adding file changes |
|
725 | 725 | added 1 changesets with 1 changes to 1 files |
|
726 | 726 | exporting bookmark @ |
|
727 | 727 | |
|
728 | 728 | $ hg push -B @ ../unchanged-b |
|
729 | 729 | pushing to ../unchanged-b |
|
730 | 730 | searching for changes |
|
731 | 731 | no changes found |
|
732 | 732 | [1] |
|
733 | 733 | |
|
734 | 734 | |
|
735 | 735 | Check hook preventing push (issue4455) |
|
736 | 736 | ====================================== |
|
737 | 737 | |
|
738 | 738 | $ hg bookmarks |
|
739 | 739 | * @ 0:55482a6fb4b1 |
|
740 | 740 | $ hg log -G |
|
741 | 741 | @ 0:55482a6fb4b1 initial |
|
742 | 742 | |
|
743 | 743 | $ hg init ../issue4455-dest |
|
744 | 744 | $ hg push ../issue4455-dest # changesets only |
|
745 | 745 | pushing to ../issue4455-dest |
|
746 | 746 | searching for changes |
|
747 | 747 | adding changesets |
|
748 | 748 | adding manifests |
|
749 | 749 | adding file changes |
|
750 | 750 | added 1 changesets with 1 changes to 1 files |
|
751 | 751 | $ cat >> .hg/hgrc << EOF |
|
752 | 752 | > [paths] |
|
753 | 753 | > local=../issue4455-dest/ |
|
754 | 754 | > ssh=ssh://user@dummy/issue4455-dest |
|
755 | 755 | > http=http://localhost:$HGPORT/ |
|
756 | 756 | > [ui] |
|
757 | 757 | > ssh=python "$TESTDIR/dummyssh" |
|
758 | 758 | > EOF |
|
759 | 759 | $ cat >> ../issue4455-dest/.hg/hgrc << EOF |
|
760 | 760 | > [hooks] |
|
761 | 761 | > prepushkey=false |
|
762 | 762 | > [web] |
|
763 | 763 | > push_ssl = false |
|
764 | 764 | > allow_push = * |
|
765 | 765 | > EOF |
|
766 | 766 | $ killdaemons.py |
|
767 | 767 | $ hg -R ../issue4455-dest serve -p $HGPORT -d --pid-file=../issue4455.pid -E ../issue4455-error.log |
|
768 | 768 | $ cat ../issue4455.pid >> $DAEMON_PIDS |
|
769 | 769 | |
|
770 | 770 | Local push |
|
771 | 771 | ---------- |
|
772 | 772 | |
|
773 | 773 | $ hg push -B @ local |
|
774 | 774 | pushing to $TESTTMP/issue4455-dest (glob) |
|
775 | 775 | searching for changes |
|
776 | 776 | no changes found |
|
777 | 777 | pushkey-abort: prepushkey hook exited with status 1 |
|
778 | 778 | abort: exporting bookmark @ failed! |
|
779 | 779 | [255] |
|
780 | 780 | $ hg -R ../issue4455-dest/ bookmarks |
|
781 | 781 | no bookmarks set |
|
782 | 782 | |
|
783 | 783 | Using ssh |
|
784 | 784 | --------- |
|
785 | 785 | |
|
786 | 786 | $ hg push -B @ ssh --config experimental.bundle2-exp=True |
|
787 | 787 | pushing to ssh://user@dummy/issue4455-dest |
|
788 | 788 | searching for changes |
|
789 | 789 | no changes found |
|
790 | 790 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
791 | 791 | abort: exporting bookmark @ failed! |
|
792 | 792 | [255] |
|
793 | 793 | $ hg -R ../issue4455-dest/ bookmarks |
|
794 | 794 | no bookmarks set |
|
795 | 795 | |
|
796 | 796 | $ hg push -B @ ssh --config experimental.bundle2-exp=False |
|
797 | 797 | pushing to ssh://user@dummy/issue4455-dest |
|
798 | 798 | searching for changes |
|
799 | 799 | no changes found |
|
800 | 800 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
801 | 801 | exporting bookmark @ failed! |
|
802 | 802 | [1] |
|
803 | 803 | $ hg -R ../issue4455-dest/ bookmarks |
|
804 | 804 | no bookmarks set |
|
805 | 805 | |
|
806 | 806 | Using http |
|
807 | 807 | ---------- |
|
808 | 808 | |
|
809 | 809 | $ hg push -B @ http --config experimental.bundle2-exp=True |
|
810 | 810 | pushing to http://localhost:$HGPORT/ |
|
811 | 811 | searching for changes |
|
812 | 812 | no changes found |
|
813 | 813 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
814 | 814 | abort: exporting bookmark @ failed! |
|
815 | 815 | [255] |
|
816 | 816 | $ hg -R ../issue4455-dest/ bookmarks |
|
817 | 817 | no bookmarks set |
|
818 | 818 | |
|
819 | 819 | $ hg push -B @ http --config experimental.bundle2-exp=False |
|
820 | 820 | pushing to http://localhost:$HGPORT/ |
|
821 | 821 | searching for changes |
|
822 | 822 | no changes found |
|
823 | 823 | remote: pushkey-abort: prepushkey hook exited with status 1 |
|
824 | 824 | exporting bookmark @ failed! |
|
825 | 825 | [1] |
|
826 | 826 | $ hg -R ../issue4455-dest/ bookmarks |
|
827 | 827 | no bookmarks set |
General Comments 0
You need to be logged in to leave comments.
Login now