##// END OF EJS Templates
merge with stable
Matt Mackall -
r22207:8dda6f6f merge default
parent child Browse files
Show More
@@ -357,6 +357,9 b' def getremotechanges(ui, repo, other, on'
357 pass
357 pass
358 return repo, [], other.close
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 bundle = None
363 bundle = None
361 bundlerepo = None
364 bundlerepo = None
362 localrepo = other.local()
365 localrepo = other.local()
@@ -2339,9 +2339,12 b' def debugobsolete(ui, repo, precursor=No'
2339 try:
2339 try:
2340 tr = repo.transaction('debugobsolete')
2340 tr = repo.transaction('debugobsolete')
2341 try:
2341 try:
2342 try:
2342 repo.obsstore.create(tr, parsenodeid(precursor), succs,
2343 repo.obsstore.create(tr, parsenodeid(precursor), succs,
2343 opts['flags'], metadata)
2344 opts['flags'], metadata)
2344 tr.close()
2345 tr.close()
2346 except ValueError, exc:
2347 raise util.Abort(_('bad obsmarker input: %s') % exc)
2345 finally:
2348 finally:
2346 tr.release()
2349 tr.release()
2347 finally:
2350 finally:
@@ -553,6 +553,8 b' class changectx(basectx):'
553 anc = cahs[0]
553 anc = cahs[0]
554 else:
554 else:
555 for r in self._repo.ui.configlist('merge', 'preferancestor'):
555 for r in self._repo.ui.configlist('merge', 'preferancestor'):
556 if r == '*':
557 continue
556 ctx = changectx(self._repo, r)
558 ctx = changectx(self._repo, r)
557 anc = ctx.node()
559 anc = ctx.node()
558 if anc in cahs:
560 if anc in cahs:
@@ -217,6 +217,7 b' def _oldheadssummary(repo, remoteheads, '
217 # This explains why the new head are very simple to compute.
217 # This explains why the new head are very simple to compute.
218 r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
218 r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
219 newheads = list(c.node() for c in r)
219 newheads = list(c.node() for c in r)
220 # set some unsynced head to issue the "unsynced changes" warning
220 unsynced = inc and set([None]) or set()
221 unsynced = inc and set([None]) or set()
221 return {None: (oldheads, newheads, unsynced)}
222 return {None: (oldheads, newheads, unsynced)}
222
223
@@ -313,12 +314,18 b' def checkheads(repo, remote, outgoing, r'
313 newhs = candidate_newhs
314 newhs = candidate_newhs
314 unsynced = sorted(h for h in unsyncedheads if h not in discardedheads)
315 unsynced = sorted(h for h in unsyncedheads if h not in discardedheads)
315 if unsynced:
316 if unsynced:
316 if len(unsynced) <= 4 or repo.ui.verbose:
317 if None in unsynced:
318 # old remote, no heads data
319 heads = None
320 elif len(unsynced) <= 4 or repo.ui.verbose:
317 heads = ' '.join(short(h) for h in unsynced)
321 heads = ' '.join(short(h) for h in unsynced)
318 else:
322 else:
319 heads = (' '.join(short(h) for h in unsynced[:4]) +
323 heads = (' '.join(short(h) for h in unsynced[:4]) +
320 ' ' + _("and %s others") % (len(unsynced) - 4))
324 ' ' + _("and %s others") % (len(unsynced) - 4))
321 if branch is None:
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 repo.ui.status(_("remote has heads that are "
329 repo.ui.status(_("remote has heads that are "
323 "not known locally: %s\n") % heads)
330 "not known locally: %s\n") % heads)
324 else:
331 else:
@@ -1052,7 +1052,7 b' def update(repo, node, branchmerge, forc'
1052 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node())
1052 cahs = repo.changelog.commonancestorsheads(p1.node(), p2.node())
1053 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])]
1053 pas = [repo[anc] for anc in (sorted(cahs) or [nullid])]
1054 else:
1054 else:
1055 pas = [p1.ancestor(p2, warn=True)]
1055 pas = [p1.ancestor(p2, warn=branchmerge)]
1056
1056
1057 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
1057 fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2)
1058
1058
@@ -277,6 +277,8 b' class obsstore(object):'
277 for succ in succs:
277 for succ in succs:
278 if len(succ) != 20:
278 if len(succ) != 20:
279 raise ValueError(succ)
279 raise ValueError(succ)
280 if prec in succs:
281 raise ValueError(_('in-marker cycle with %s') % node.hex(prec))
280 marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata))
282 marker = (str(prec), tuple(succs), int(flag), encodemeta(metadata))
281 return bool(self.add(transaction, [marker]))
283 return bool(self.add(transaction, [marker]))
282
284
@@ -24,8 +24,6 b' Criss cross merging'
24 $ hg ci -m '5 second change f1'
24 $ hg ci -m '5 second change f1'
25
25
26 $ hg up -r3
26 $ hg up -r3
27 note: using 0f6b37dbe527 as ancestor of adfe50279922 and cf89f02107e5
28 alternatively, use --config merge.preferancestor=40663881a6dd
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 $ echo '6 second change' > f2
28 $ echo '6 second change' > f2
31 $ hg ci -m '6 second change f2'
29 $ hg ci -m '6 second change f2'
@@ -169,8 +167,6 b' Redo merge with merge.preferancestor="*"'
169 The other way around:
167 The other way around:
170
168
171 $ hg up -C -r5
169 $ hg up -C -r5
172 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
173 alternatively, use --config merge.preferancestor=40663881a6dd
174 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 $ hg merge -v --debug --config merge.preferancestor="*"
171 $ hg merge -v --debug --config merge.preferancestor="*"
176 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
172 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
@@ -345,4 +341,15 b' http://stackoverflow.com/questions/93500'
345 b
341 b
346 c
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 $ cd ..
355 $ cd ..
@@ -62,6 +62,14 b' Killing a single changeset without repla'
62 $ hg tip
62 $ hg tip
63 -1:000000000000 (public) [tip ]
63 -1:000000000000 (public) [tip ]
64 $ hg up --hidden tip --quiet
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 $ cd ..
73 $ cd ..
66
74
67 Killing a single changeset with replacement
75 Killing a single changeset with replacement
@@ -324,4 +324,30 b' One with >200 heads, which used to use u'
324 5 total queries
324 5 total queries
325 common heads: 3ee37d65064a
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 $ cd ..
353 $ cd ..
@@ -17,11 +17,13 b' Setup HTTP server control:'
17 > echo '[web]' > $1/.hg/hgrc
17 > echo '[web]' > $1/.hg/hgrc
18 > echo 'push_ssl = false' >> $1/.hg/hgrc
18 > echo 'push_ssl = false' >> $1/.hg/hgrc
19 > echo 'allow_push = *' >> $1/.hg/hgrc
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 > cat hg.pid >> $DAEMON_PIDS
21 > cat hg.pid >> $DAEMON_PIDS
22 > }
22 > }
23 $ tstop() {
23 $ tstop() {
24 > "$TESTDIR/killdaemons.py" $DAEMON_PIDS
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 Both are empty:
29 Both are empty:
@@ -188,10 +190,11 b' Local is subset:'
188 no changes found
190 no changes found
189 [1]
191 [1]
190 $ cd ..
192 $ cd ..
193 $ tstop
191
194
192 Remote is empty:
195 Remote is empty:
193
196
194 $ tstop ; tstart empty2
197 $ tstart empty2
195 $ cd main
198 $ cd main
196 $ hg incoming $remote
199 $ hg incoming $remote
197 comparing with http://localhost:$HGPORT/
200 comparing with http://localhost:$HGPORT/
@@ -230,10 +233,10 b' Remote is empty:'
230 no changes found
233 no changes found
231 [1]
234 [1]
232 $ cd ..
235 $ cd ..
236 $ tstop
233
237
234 Local is superset:
238 Local is superset:
235
239
236 $ tstop
237 $ hg clone main subset2 --rev name2
240 $ hg clone main subset2 --rev name2
238 adding changesets
241 adding changesets
239 adding manifests
242 adding manifests
@@ -280,10 +283,11 b' Local is superset:'
280 no changes found
283 no changes found
281 [1]
284 [1]
282 $ cd ..
285 $ cd ..
286 $ tstop
283
287
284 Partial pull:
288 Partial pull:
285
289
286 $ tstop ; tstart main
290 $ tstart main
287 $ hg clone $remote partial --rev name2
291 $ hg clone $remote partial --rev name2
288 adding changesets
292 adding changesets
289 adding manifests
293 adding manifests
@@ -322,10 +326,10 b' Partial pull:'
322 10 8b6bad1512e1: r10 both
326 10 8b6bad1512e1: r10 both
323 11 a19bfa7e7328: r11 both
327 11 a19bfa7e7328: r11 both
324 $ cd ..
328 $ cd ..
329 $ tstop
325
330
326 Both have new stuff in new named branches:
331 Both have new stuff in new named branches:
327
332
328 $ tstop
329 $ hg clone main repo1a --rev name1 -q
333 $ hg clone main repo1a --rev name1 -q
330 $ hg clone repo1a repo1b -q
334 $ hg clone repo1a repo1b -q
331 $ hg clone main repo2a --rev name2 -q
335 $ hg clone main repo2a --rev name2 -q
@@ -372,8 +376,9 b' Both have new stuff in new named branche'
372 no changes found
376 no changes found
373 [1]
377 [1]
374 $ cd ..
378 $ cd ..
379 $ tstop
375
380
376 $ tstop ; tstart repo1b
381 $ tstart repo1b
377 $ cd repo2b
382 $ cd repo2b
378 $ hg incoming $remote
383 $ hg incoming $remote
379 comparing with http://localhost:$HGPORT/
384 comparing with http://localhost:$HGPORT/
@@ -414,10 +419,10 b' Both have new stuff in new named branche'
414 no changes found
419 no changes found
415 [1]
420 [1]
416 $ cd ..
421 $ cd ..
422 $ tstop
417
423
418 Both have new stuff in existing named branches:
424 Both have new stuff in existing named branches:
419
425
420 $ tstop
421 $ rm -r repo1a repo1b repo2a repo2b
426 $ rm -r repo1a repo1b repo2a repo2b
422 $ hg clone main repo1a --rev 3 --rev 8 -q
427 $ hg clone main repo1a --rev 3 --rev 8 -q
423 $ hg clone repo1a repo1b -q
428 $ hg clone repo1a repo1b -q
@@ -460,8 +465,9 b' Both have new stuff in existing named br'
460 no changes found
465 no changes found
461 [1]
466 [1]
462 $ cd ..
467 $ cd ..
468 $ tstop
463
469
464 $ tstop ; tstart repo1b
470 $ tstart repo1b
465 $ cd repo2b
471 $ cd repo2b
466 $ hg incoming $remote
472 $ hg incoming $remote
467 comparing with http://localhost:$HGPORT/
473 comparing with http://localhost:$HGPORT/
@@ -497,6 +503,32 b' Both have new stuff in existing named br'
497 no changes found
503 no changes found
498 [1]
504 [1]
499 $ cd ..
505 $ cd ..
500
506 $ tstop show
501 $ tstop
507 "GET /?cmd=capabilities HTTP/1.1" 200 -
502
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