D12312: revlogutils: unconditionally pass version to random seed
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Wed Mar 2 23:31:54 UTC 2022
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D12312
AFFECTED FILES
mercurial/revlogutils/docket.py
CHANGE DETAILS
diff --git a/mercurial/revlogutils/docket.py b/mercurial/revlogutils/docket.py
--- a/mercurial/revlogutils/docket.py
+++ b/mercurial/revlogutils/docket.py
@@ -25,7 +25,6 @@
encoding,
error,
node,
- pycompat,
util,
)
@@ -65,10 +64,7 @@
low_part = (int_seed & low_mask) << 28
int_seed = high_part + low_part + i
r = random.Random()
- if pycompat.ispy3:
- r.seed(int_seed, version=1)
- else:
- r.seed(int_seed)
+ r.seed(int_seed, version=1)
# once we drop python 3.8 support we can simply use r.randbytes
raw = r.getrandbits(id_size * 4)
assert id_size == 8
To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list