comparison hgext3rd/pullbundle.py @ 5047:a8ac174010a5

pullbundle: random.sample() chokes on a spanset, turn it into a list instead On Python 3.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 20 Dec 2019 14:08:37 +0700
parents ebd0f5c6098f
children a4d081923c81
comparison
equal deleted inserted replaced
5046:ebd0f5c6098f 5047:a8ac174010a5
590 cachedhitsdist = distribution(cachedhits) 590 cachedhitsdist = distribution(cachedhits)
591 repo.ui.write(fmtdist(b'hit on cached bundles', cachedhitsdist)) 591 repo.ui.write(fmtdist(b'hit on cached bundles', cachedhitsdist))
592 592
593 def takeonesample(repo, revs): 593 def takeonesample(repo, revs):
594 node = repo.changelog.node 594 node = repo.changelog.node
595 revs = list(revs)
595 pulled = random.sample(revs, max(4, len(revs) // 1000)) 596 pulled = random.sample(revs, max(4, len(revs) // 1000))
596 pulled = repo.revs(b'%ld::%ld', pulled, pulled) 597 pulled = repo.revs(b'%ld::%ld', pulled, pulled)
597 nodes = [node(r) for r in pulled] 598 nodes = [node(r) for r in pulled]
598 return outgoingfromnodes(repo, nodes) 599 return outgoingfromnodes(repo, nodes)
599 600