506 repo.ui.write(b"gathering %d sample pulls within %d revisions\n" |
507 repo.ui.write(b"gathering %d sample pulls within %d revisions\n" |
507 % (count, len(actionrevs))) |
508 % (count, len(actionrevs))) |
508 if 1 < min_cache: |
509 if 1 < min_cache: |
509 repo.ui.write(b" not caching ranges smaller than %d changesets\n" % min_cache) |
510 repo.ui.write(b" not caching ranges smaller than %d changesets\n" % min_cache) |
510 for i in range(count): |
511 for i in range(count): |
511 repo.ui.progress(b'gathering data', i, total=count) |
512 progress(repo.ui, b'gathering data', i, total=count) |
512 outgoing = takeonesample(repo, actionrevs) |
513 outgoing = takeonesample(repo, actionrevs) |
513 ranges = sliceoutgoing(repo, outgoing) |
514 ranges = sliceoutgoing(repo, outgoing) |
514 hitranges = 0 |
515 hitranges = 0 |
515 hitchanges = 0 |
516 hitchanges = 0 |
516 totalchanges = 0 |
517 totalchanges = 0 |
622 """ |
623 """ |
623 |
624 |
624 def fmtdist(name, data): |
625 def fmtdist(name, data): |
625 return STATSFORMAT.format(name=name, **data) |
626 return STATSFORMAT.format(name=name, **data) |
626 |
627 |
|
628 # hg <= 4.6 (bec1212eceaa) |
|
629 if util.safehasattr(uimod.ui, 'makeprogress'): |
|
630 def progress(ui, topic, pos, item=b"", unit=b"", total=None): |
|
631 progress = ui.makeprogress(topic, unit, total) |
|
632 if pos is not None: |
|
633 progress.update(pos, item=item) |
|
634 else: |
|
635 progress.complete() |
|
636 else: |
|
637 def progress(ui, topic, pos, item=b"", unit=b"", total=None): |
|
638 ui.progress(topic, pos, item, unit, total) |
|
639 |
627 # nodemap.get and index.[has_node|rev|get_rev] |
640 # nodemap.get and index.[has_node|rev|get_rev] |
628 # hg <= 5.3 (02802fa87b74) |
641 # hg <= 5.3 (02802fa87b74) |
629 def getgetrev(cl): |
642 def getgetrev(cl): |
630 """Returns index.get_rev or nodemap.get (for pre-5.3 Mercurial).""" |
643 """Returns index.get_rev or nodemap.get (for pre-5.3 Mercurial).""" |
631 if util.safehasattr(cl.index, 'get_rev'): |
644 if util.safehasattr(cl.index, 'get_rev'): |