pullbundle: random.sample() chokes on a spanset, turn it into a list instead
authorAnton Shestakov <av6@dwimlabs.net>
Fri, 20 Dec 2019 14:08:37 +0700
changeset 5047 a8ac174010a5
parent 5046 ebd0f5c6098f
child 5049 1b393870c6b9
child 5230 39d282fd04e0
child 5237 8b7da5df5c7f
pullbundle: random.sample() chokes on a spanset, turn it into a list instead On Python 3.
hgext3rd/pullbundle.py
--- a/hgext3rd/pullbundle.py	Fri Dec 20 13:50:31 2019 +0700
+++ b/hgext3rd/pullbundle.py	Fri Dec 20 14:08:37 2019 +0700
@@ -592,6 +592,7 @@
 
 def takeonesample(repo, revs):
     node = repo.changelog.node
+    revs = list(revs)
     pulled = random.sample(revs, max(4, len(revs) // 1000))
     pulled = repo.revs(b'%ld::%ld', pulled, pulled)
     nodes = [node(r) for r in pulled]