Show More
@@ -25,7 +25,6 b' 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, | |
@@ -33,14 +32,31 b' from mercurial import (' | |||||
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 | ) | |
42 |
|
38 | |||
43 | # for "historical portability": |
|
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 | |||
|
58 | ||||
|
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() |
General Comments 0
You need to be logged in to leave comments.
Login now