Mercurial > evolve
comparison hgext/evolve.py @ 1197:0d15d461a316 stable
merge default into table
3.3 is about to be released.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 30 Jan 2015 21:57:41 +0000 |
parents | aa7cdd9d7310 9e3f332f7630 |
children | bfe9be352453 |
comparison
equal
deleted
inserted
replaced
1194:aa7cdd9d7310 | 1197:0d15d461a316 |
---|---|
2392 _takefullsample = setdiscovery._takefullsample | 2392 _takefullsample = setdiscovery._takefullsample |
2393 | 2393 |
2394 while undecided: | 2394 while undecided: |
2395 | 2395 |
2396 ui.note(_("sampling from both directions\n")) | 2396 ui.note(_("sampling from both directions\n")) |
2397 sample = _takefullsample(dag, undecided, size=fullsamplesize) | 2397 if len(undecided) < fullsamplesize: |
2398 sample = set(undecided) | |
2399 else: | |
2400 sample = _takefullsample(dag, undecided, size=fullsamplesize) | |
2398 | 2401 |
2399 roundtrips += 1 | 2402 roundtrips += 1 |
2400 ui.debug("query %i; still undecided: %i, sample size is: %i\n" | 2403 ui.debug("query %i; still undecided: %i, sample size is: %i\n" |
2401 % (roundtrips, len(undecided), len(sample))) | 2404 % (roundtrips, len(undecided), len(sample))) |
2402 # indices between sample and externalized version must match | 2405 # indices between sample and externalized version must match |
2574 Its a separed functio to play around with strategy for that.""" | 2577 Its a separed functio to play around with strategy for that.""" |
2575 repo = pullop.repo | 2578 repo = pullop.repo |
2576 cl = pullop.repo.changelog | 2579 cl = pullop.repo.changelog |
2577 remote = pullop.remote | 2580 remote = pullop.remote |
2578 unfi = repo.unfiltered() | 2581 unfi = repo.unfiltered() |
2579 revs = unfi.revs('::%ln', pullop.common) | 2582 revs = unfi.revs('::(%ln - null)', pullop.common) |
2580 common = [nullid] | 2583 common = [nullid] |
2581 if remote.capable('_evoext_obshash_0'): | 2584 if remote.capable('_evoext_obshash_0'): |
2582 obsexcmsg(repo.ui, "looking for common markers in %i nodes\n" | 2585 obsexcmsg(repo.ui, "looking for common markers in %i nodes\n" |
2583 % len(revs)) | 2586 % len(revs)) |
2584 common = findcommonobsmarkers(repo.ui, repo, remote, revs) | 2587 common = findcommonobsmarkers(repo.ui, repo, remote, revs) |
2762 It computed form the "orsht" of its parent and markers | 2765 It computed form the "orsht" of its parent and markers |
2763 relevant to the changeset itself.""" | 2766 relevant to the changeset itself.""" |
2764 for chg, obs in _obsrelsethashtree(repo): | 2767 for chg, obs in _obsrelsethashtree(repo): |
2765 ui.status('%s %s\n' % (node.hex(chg), node.hex(obs))) | 2768 ui.status('%s %s\n' % (node.hex(chg), node.hex(obs))) |
2766 | 2769 |
2770 _bestformat = max(obsolete.formats.keys()) | |
2771 | |
2772 @command( | |
2773 'debugobsconvert', | |
2774 [('', 'new-format', _bestformat, _('Destination format for markers.'))], | |
2775 '') | |
2776 def debugobsconvert(ui, repo, new_format): | |
2777 if new_format == repo.obsstore._version: | |
2778 msg = _('New format is the same as the old format, not upgrading!') | |
2779 raise util.Abort(msg) | |
2780 f = repo.sopener('obsstore', 'wb', atomictemp=True) | |
2781 origmarkers = repo.obsstore._all | |
2782 known = set() | |
2783 markers = [] | |
2784 for m in origmarkers: | |
2785 if m in known: | |
2786 continue | |
2787 known.add(m) | |
2788 markers.append(m) | |
2789 ui.write(_('Old store is version %d, will rewrite in version %d\n') % ( | |
2790 repo.obsstore._version, new_format)) | |
2791 map(f.write, obsolete.encodemarkers(markers, True, new_format)) | |
2792 f.close() | |
2793 ui.write(_('Done!\n')) | |
2794 | |
2767 | 2795 |
2768 @eh.wrapfunction(wireproto, 'capabilities') | 2796 @eh.wrapfunction(wireproto, 'capabilities') |
2769 def capabilities(orig, repo, proto): | 2797 def capabilities(orig, repo, proto): |
2770 """wrapper to advertise new capability""" | 2798 """wrapper to advertise new capability""" |
2771 caps = orig(repo, proto) | 2799 caps = orig(repo, proto) |