comparison mercurial/revset.py @ 49946:76c128d4de4e stable

revset: the `random` sort should not depend on sys.maxsize (issue6770)
author Julien Cristau <jcristau@mozilla.com>
date Tue, 06 Dec 2022 15:11:51 +0100
parents 117dcc4a0e67
children 1bd33932713d
comparison
equal deleted inserted replaced
49945:d00ac86fbd78 49946:76c128d4de4e
8 8
9 import binascii 9 import binascii
10 import functools 10 import functools
11 import random 11 import random
12 import re 12 import re
13 import sys
14 13
15 from .i18n import _ 14 from .i18n import _
16 from .pycompat import getattr 15 from .pycompat import getattr
17 from .node import ( 16 from .node import (
18 bin, 17 bin,
2353 return True 2352 return True
2354 2353
2355 return subset & s.filter(filter, condrepr=b'<roots>') 2354 return subset & s.filter(filter, condrepr=b'<roots>')
2356 2355
2357 2356
2358 MAXINT = sys.maxsize 2357 MAXINT = (1 << 31) - 1
2359 MININT = -MAXINT - 1 2358 MININT = -MAXINT - 1
2360 2359
2361 2360
2362 def pick_random(c, gen=random): 2361 def pick_random(c, gen=random):
2363 # exists as its own function to make it possible to overwrite the seed 2362 # exists as its own function to make it possible to overwrite the seed