Patchwork D12312: revlogutils: unconditionally pass version to random seed

login
register
mail settings
Submitter phabricator
Date March 2, 2022, 11:31 p.m.
Message ID <differential-rev-PHID-DREV-g5nchzjb6no6i4mer5ee-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50651/
State New
Headers show

Comments

phabricator - March 2, 2022, 11:31 p.m.
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




To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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