contrib/perf.py
changeset 29567 7e2b389418da
parent 29497 ee2027195847
child 30017 973cf6c3de30
equal deleted inserted replaced
29566:075146e85bb6 29567:7e2b389418da
    23 import os
    23 import os
    24 import random
    24 import random
    25 import sys
    25 import sys
    26 import time
    26 import time
    27 from mercurial import (
    27 from mercurial import (
    28     branchmap,
       
    29     cmdutil,
    28     cmdutil,
    30     commands,
    29     commands,
    31     copies,
    30     copies,
    32     error,
    31     error,
    33     extensions,
    32     extensions,
    34     mdiff,
    33     mdiff,
    35     merge,
    34     merge,
    36     obsolete,
       
    37     repoview,
       
    38     revlog,
    35     revlog,
    39     scmutil,
       
    40     util,
    36     util,
    41 )
    37 )
       
    38 
       
    39 # for "historical portability":
       
    40 # try to import modules separately (in dict order), and ignore
       
    41 # failure, because these aren't available with early Mercurial
       
    42 try:
       
    43     from mercurial import branchmap # since 2.5 (or bcee63733aad)
       
    44 except ImportError:
       
    45     pass
       
    46 try:
       
    47     from mercurial import obsolete # since 2.3 (or ad0d6c2b3279)
       
    48 except ImportError:
       
    49     pass
       
    50 try:
       
    51     from mercurial import repoview # since 2.5 (or 3a6ddacb7198)
       
    52 except ImportError:
       
    53     pass
       
    54 try:
       
    55     from mercurial import scmutil # since 1.9 (or 8b252e826c68)
       
    56 except ImportError:
       
    57     pass
    42 
    58 
    43 # for "historical portability":
    59 # for "historical portability":
    44 # define util.safehasattr forcibly, because util.safehasattr has been
    60 # define util.safehasattr forcibly, because util.safehasattr has been
    45 # available since 1.9.3 (or 94b200a11cf7)
    61 # available since 1.9.3 (or 94b200a11cf7)
    46 _undefined = object()
    62 _undefined = object()