Show More
@@ -357,6 +357,9 b' def getremotechanges(ui, repo, other, on' | |||
|
357 | 357 | pass |
|
358 | 358 | return repo, [], other.close |
|
359 | 359 | |
|
360 | commonset = set(common) | |
|
361 | rheads = [x for x in rheads if x not in commonset] | |
|
362 | ||
|
360 | 363 | bundle = None |
|
361 | 364 | bundlerepo = None |
|
362 | 365 | localrepo = other.local() |
@@ -2339,9 +2339,12 b' def debugobsolete(ui, repo, precursor=No' | |||
|
2339 | 2339 | try: |
|
2340 | 2340 | tr = repo.transaction('debugobsolete') |
|
2341 | 2341 | try: |
|
2342 | repo.obsstore.create(tr, parsenodeid(precursor), succs, | |
|
2343 | opts['flags'], metadata) | |
|
2344 | tr.close() | |
|
2342 | try: | |
|
2343 | repo.obsstore.create(tr, parsenodeid(precursor), succs, | |
|
2344 | opts['flags'], metadata) | |
|
2345 | tr.close() | |
|
2346 | except ValueError, exc: | |
|
2347 | raise util.Abort(_('bad obsmarker input: %s') % exc) | |
|
2345 | 2348 | finally: |
|
2346 | 2349 | tr.release() |
|
2347 | 2350 | finally: |
@@ -553,6 +553,8 b' class changectx(basectx):' | |||
|
553 | 553 | anc = cahs[0] |
|
554 | 554 | else: |
|
555 | 555 | for r in self._repo.ui.configlist('merge', 'preferancestor'): |
|
556 | if r == '*': | |
|
557 | continue | |
|
556 | 558 | ctx = changectx(self._repo, r) |
|
557 | 559 | anc = ctx.node() |
|
558 | 560 | if anc in cahs: |
@@ -217,6 +217,7 b' def _oldheadssummary(repo, remoteheads, ' | |||
|
217 | 217 | # This explains why the new head are very simple to compute. |
|
218 | 218 | r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing) |
|
219 | 219 | newheads = list(c.node() for c in r) |
|
220 | # set some unsynced head to issue the "unsynced changes" warning | |
|
220 | 221 | unsynced = inc and set([None]) or set() |
|
221 | 222 | return {None: (oldheads, newheads, unsynced)} |
|
222 | 223 | |
@@ -313,12 +314,18 b' def checkheads(repo, remote, outgoing, r' | |||
|
313 | 314 | newhs = candidate_newhs |
|
314 | 315 | unsynced = sorted(h for h in unsyncedheads if h not in discardedheads) |
|
315 | 316 | if unsynced: |
|
316 |
if |
|
|
317 | if None in unsynced: | |
|
318 | # old remote, no heads data | |
|
319 | heads = None | |
|
320 | elif len(unsynced) <= 4 or repo.ui.verbose: | |
|
317 | 321 | heads = ' '.join(short(h) for h in unsynced) |
|
318 | 322 | else: |
|
319 | 323 | heads = (' '.join(short(h) for h in unsynced[:4]) + |
|
320 | 324 | ' ' + _("and %s others") % (len(unsynced) - 4)) |
|
321 |
if |
|
|
325 | if heads is None: | |
|
326 | repo.ui.status(_("remote has heads that are " | |
|
327 | "not known locally\n")) | |
|
328 | elif branch is None: | |
|
322 | 329 | repo.ui.status(_("remote has heads that are " |
|
323 | 330 | "not known locally: %s\n") % heads) |
|
324 | 331 | else: |
@@ -1052,7 +1052,7 b' def update(repo, node, branchmerge, forc' | |||
|
1052 | 1052 | cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node()) |
|
1053 | 1053 | pas = [repo[anc] for anc in (sorted(cahs) or [nullid])] |
|
1054 | 1054 | else: |
|
1055 |
pas = [p1.ancestor(p2, warn= |
|
|
1055 | pas = [p1.ancestor(p2, warn=branchmerge)] | |
|
1056 | 1056 | |
|
1057 | 1057 | fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2) |
|
1058 | 1058 |
@@ -277,6 +277,8 b' class obsstore(object):' | |||
|
277 | 277 | for succ in succs: |
|
278 | 278 | if len(succ) != 20: |
|
279 | 279 | raise ValueError(succ) |
|
280 | if prec in succs: | |
|
281 | raise ValueError(_('in-marker cycle with %s') % node.hex(prec)) | |
|
280 | 282 | marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata)) |
|
281 | 283 | return bool(self.add(transaction, [marker])) |
|
282 | 284 |
@@ -24,8 +24,6 b' Criss cross merging' | |||
|
24 | 24 | $ hg ci -m '5 second change f1' |
|
25 | 25 | |
|
26 | 26 | $ hg up -r3 |
|
27 | note: using 0f6b37dbe527 as ancestor of adfe50279922 and cf89f02107e5 | |
|
28 | alternatively, use --config merge.preferancestor=40663881a6dd | |
|
29 | 27 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
30 | 28 | $ echo '6 second change' > f2 |
|
31 | 29 | $ hg ci -m '6 second change f2' |
@@ -169,8 +167,6 b' Redo merge with merge.preferancestor="*"' | |||
|
169 | 167 | The other way around: |
|
170 | 168 | |
|
171 | 169 | $ hg up -C -r5 |
|
172 | note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922 | |
|
173 | alternatively, use --config merge.preferancestor=40663881a6dd | |
|
174 | 170 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
175 | 171 | $ hg merge -v --debug --config merge.preferancestor="*" |
|
176 | 172 | note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
@@ -345,4 +341,15 b' http://stackoverflow.com/questions/93500' | |||
|
345 | 341 | b |
|
346 | 342 | c |
|
347 | 343 | |
|
344 | Verify that the old context ancestor works with / despite preferancestor: | |
|
345 | ||
|
346 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n' | |
|
347 | 1 | |
|
348 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n' | |
|
349 | 2 | |
|
350 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n' | |
|
351 | 1 | |
|
352 | $ hg log -r 'ancestor(head())' --config merge.preferancestor='*' -T '{rev}\n' | |
|
353 | 1 | |
|
354 | ||
|
348 | 355 | $ cd .. |
@@ -62,6 +62,14 b' Killing a single changeset without repla' | |||
|
62 | 62 | $ hg tip |
|
63 | 63 | -1:000000000000 (public) [tip ] |
|
64 | 64 | $ hg up --hidden tip --quiet |
|
65 | ||
|
66 | Killing a single changeset with itself should fail | |
|
67 | (simple local safeguard) | |
|
68 | ||
|
69 | $ hg debugobsolete `getid kill_me` `getid kill_me` | |
|
70 | abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0 | |
|
71 | [255] | |
|
72 | ||
|
65 | 73 | $ cd .. |
|
66 | 74 | |
|
67 | 75 | Killing a single changeset with replacement |
@@ -324,4 +324,30 b' One with >200 heads, which used to use u' | |||
|
324 | 324 | 5 total queries |
|
325 | 325 | common heads: 3ee37d65064a |
|
326 | 326 | |
|
327 | Test actual protocol when pulling one new head in addition to common heads | |
|
328 | ||
|
329 | $ hg clone -U b c | |
|
330 | $ hg -R c id -ir tip | |
|
331 | 513314ca8b3a | |
|
332 | $ hg -R c up -qr default | |
|
333 | $ touch c/f | |
|
334 | $ hg -R c ci -Aqm "extra head" | |
|
335 | $ hg -R c id -i | |
|
336 | e64a39e7da8b | |
|
337 | ||
|
338 | $ hg serve -R c -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
|
339 | $ cat hg.pid >> $DAEMON_PIDS | |
|
340 | ||
|
341 | $ hg -R b incoming http://localhost:$HGPORT/ -T '{node|short}\n' | |
|
342 | comparing with http://localhost:$HGPORT/ | |
|
343 | searching for changes | |
|
344 | e64a39e7da8b | |
|
345 | ||
|
346 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS | |
|
347 | $ cut -d' ' -f6- access.log | grep -v cmd=known # cmd=known uses random sampling | |
|
348 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
|
349 | "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db | |
|
350 | "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477 | |
|
351 | $ cat errors.log | |
|
352 | ||
|
327 | 353 | $ cd .. |
@@ -17,11 +17,13 b' Setup HTTP server control:' | |||
|
17 | 17 | > echo '[web]' > $1/.hg/hgrc |
|
18 | 18 | > echo 'push_ssl = false' >> $1/.hg/hgrc |
|
19 | 19 | > echo 'allow_push = *' >> $1/.hg/hgrc |
|
20 | > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -E errors.log | |
|
20 | > hg serve -R $1 -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
|
21 | 21 | > cat hg.pid >> $DAEMON_PIDS |
|
22 | 22 | > } |
|
23 | 23 | $ tstop() { |
|
24 | 24 | > "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
25 | > [ "$1" ] && cut -d' ' -f6- access.log && cat errors.log | |
|
26 | > rm access.log errors.log | |
|
25 | 27 | > } |
|
26 | 28 | |
|
27 | 29 | Both are empty: |
@@ -188,10 +190,11 b' Local is subset:' | |||
|
188 | 190 | no changes found |
|
189 | 191 | [1] |
|
190 | 192 | $ cd .. |
|
193 | $ tstop | |
|
191 | 194 | |
|
192 | 195 | Remote is empty: |
|
193 | 196 | |
|
194 |
$ |
|
|
197 | $ tstart empty2 | |
|
195 | 198 | $ cd main |
|
196 | 199 | $ hg incoming $remote |
|
197 | 200 | comparing with http://localhost:$HGPORT/ |
@@ -230,10 +233,10 b' Remote is empty:' | |||
|
230 | 233 | no changes found |
|
231 | 234 | [1] |
|
232 | 235 | $ cd .. |
|
236 | $ tstop | |
|
233 | 237 | |
|
234 | 238 | Local is superset: |
|
235 | 239 | |
|
236 | $ tstop | |
|
237 | 240 | $ hg clone main subset2 --rev name2 |
|
238 | 241 | adding changesets |
|
239 | 242 | adding manifests |
@@ -280,10 +283,11 b' Local is superset:' | |||
|
280 | 283 | no changes found |
|
281 | 284 | [1] |
|
282 | 285 | $ cd .. |
|
286 | $ tstop | |
|
283 | 287 | |
|
284 | 288 | Partial pull: |
|
285 | 289 | |
|
286 |
$ |
|
|
290 | $ tstart main | |
|
287 | 291 | $ hg clone $remote partial --rev name2 |
|
288 | 292 | adding changesets |
|
289 | 293 | adding manifests |
@@ -322,10 +326,10 b' Partial pull:' | |||
|
322 | 326 | 10 8b6bad1512e1: r10 both |
|
323 | 327 | 11 a19bfa7e7328: r11 both |
|
324 | 328 | $ cd .. |
|
329 | $ tstop | |
|
325 | 330 | |
|
326 | 331 | Both have new stuff in new named branches: |
|
327 | 332 | |
|
328 | $ tstop | |
|
329 | 333 | $ hg clone main repo1a --rev name1 -q |
|
330 | 334 | $ hg clone repo1a repo1b -q |
|
331 | 335 | $ hg clone main repo2a --rev name2 -q |
@@ -372,8 +376,9 b' Both have new stuff in new named branche' | |||
|
372 | 376 | no changes found |
|
373 | 377 | [1] |
|
374 | 378 | $ cd .. |
|
379 | $ tstop | |
|
375 | 380 | |
|
376 |
$ |
|
|
381 | $ tstart repo1b | |
|
377 | 382 | $ cd repo2b |
|
378 | 383 | $ hg incoming $remote |
|
379 | 384 | comparing with http://localhost:$HGPORT/ |
@@ -414,10 +419,10 b' Both have new stuff in new named branche' | |||
|
414 | 419 | no changes found |
|
415 | 420 | [1] |
|
416 | 421 | $ cd .. |
|
422 | $ tstop | |
|
417 | 423 | |
|
418 | 424 | Both have new stuff in existing named branches: |
|
419 | 425 | |
|
420 | $ tstop | |
|
421 | 426 | $ rm -r repo1a repo1b repo2a repo2b |
|
422 | 427 | $ hg clone main repo1a --rev 3 --rev 8 -q |
|
423 | 428 | $ hg clone repo1a repo1b -q |
@@ -460,8 +465,9 b' Both have new stuff in existing named br' | |||
|
460 | 465 | no changes found |
|
461 | 466 | [1] |
|
462 | 467 | $ cd .. |
|
468 | $ tstop | |
|
463 | 469 | |
|
464 |
$ |
|
|
470 | $ tstart repo1b | |
|
465 | 471 | $ cd repo2b |
|
466 | 472 | $ hg incoming $remote |
|
467 | 473 | comparing with http://localhost:$HGPORT/ |
@@ -497,6 +503,32 b' Both have new stuff in existing named br' | |||
|
497 | 503 | no changes found |
|
498 | 504 | [1] |
|
499 | 505 | $ cd .. |
|
500 | ||
|
501 | $ tstop | |
|
502 | ||
|
506 | $ tstop show | |
|
507 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
|
508 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
509 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
510 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 | |
|
511 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
512 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
|
513 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
514 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
515 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 | |
|
516 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
|
517 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
518 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
519 | "GET /?cmd=branches HTTP/1.1" 200 - x-hgarg-1:nodes=d8f638ac69e9ae8dea4f09f11d696546a912d961 | |
|
520 | "GET /?cmd=between HTTP/1.1" 200 - x-hgarg-1:pairs=d8f638ac69e9ae8dea4f09f11d696546a912d961-d57206cc072a18317c1e381fb60aa31bd3401785 | |
|
521 | "GET /?cmd=changegroupsubset HTTP/1.1" 200 - x-hgarg-1:bases=d8f638ac69e9ae8dea4f09f11d696546a912d961&heads=d8f638ac69e9ae8dea4f09f11d696546a912d961+2c8d5d5ec612be65cdfdeac78b7662ab1696324a | |
|
522 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
523 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
|
524 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
525 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
526 | "GET /?cmd=branchmap HTTP/1.1" 200 - | |
|
527 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
528 | "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+1827a5bb63e602382eb89dd58f2ac9f3b007ad91 | |
|
529 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases | |
|
530 | "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks | |
|
531 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
|
532 | "GET /?cmd=heads HTTP/1.1" 200 - | |
|
533 | "GET /?cmd=capabilities HTTP/1.1" 200 - | |
|
534 | "GET /?cmd=heads HTTP/1.1" 200 - |
General Comments 0
You need to be logged in to leave comments.
Login now