diff 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
line wrap: on
line diff
--- 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]