equal
deleted
inserted
replaced
6 encoding.environ[b'HGREALINTERFACES'] = b'1' |
6 encoding.environ[b'HGREALINTERFACES'] = b'1' |
7 |
7 |
8 import os |
8 import os |
9 import subprocess |
9 import subprocess |
10 import sys |
10 import sys |
11 |
|
12 # Only run if tests are run in a repo |
|
13 if subprocess.call( |
|
14 [sys.executable, '%s/hghave' % os.environ['TESTDIR'], 'test-repo'] |
|
15 ): |
|
16 sys.exit(80) |
|
17 |
11 |
18 from mercurial.interfaces import ( |
12 from mercurial.interfaces import ( |
19 dirstate as intdirstate, |
13 dirstate as intdirstate, |
20 repository, |
14 repository, |
21 ) |
15 ) |
39 wireprototypes, |
33 wireprototypes, |
40 wireprotov1peer, |
34 wireprotov1peer, |
41 ) |
35 ) |
42 |
36 |
43 testdir = os.path.dirname(__file__) |
37 testdir = os.path.dirname(__file__) |
44 rootdir = pycompat.fsencode(os.path.normpath(os.path.join(testdir, '..'))) |
|
45 |
38 |
46 sys.path[0:0] = [testdir] |
39 sys.path[0:0] = [testdir] |
47 import simplestorerepo |
40 import simplestorerepo |
48 |
41 |
49 del sys.path[0] |
42 del sys.path[0] |
113 pass |
106 pass |
114 |
107 |
115 @property |
108 @property |
116 def closed(self): |
109 def closed(self): |
117 pass |
110 pass |
|
111 |
|
112 |
|
113 def init_test_repo(): |
|
114 testtmp_dir = os.path.normpath(os.environ['TESTTMP']) |
|
115 test_repo_dir = os.path.join(testtmp_dir, "test-repo") |
|
116 subprocess.run(["hg", "init", test_repo_dir]) |
|
117 subprocess.run(["hg", "--cwd", test_repo_dir, "debugbuilddag", "+3<3+1"]) |
|
118 return test_repo_dir |
118 |
119 |
119 |
120 |
120 def main(): |
121 def main(): |
121 ui = uimod.ui() |
122 ui = uimod.ui() |
122 # Needed so we can open a local repo with obsstore without a warning. |
123 # Needed so we can open a local repo with obsstore without a warning. |
166 repository.ilocalrepositorymain, localrepo.localrepository |
167 repository.ilocalrepositorymain, localrepo.localrepository |
167 ) |
168 ) |
168 ziverify.verifyClass( |
169 ziverify.verifyClass( |
169 repository.ilocalrepositoryfilestorage, localrepo.revlogfilestorage |
170 repository.ilocalrepositoryfilestorage, localrepo.revlogfilestorage |
170 ) |
171 ) |
171 repo = localrepo.makelocalrepository(ui, rootdir) |
172 test_repo_dir = init_test_repo() |
|
173 repo = localrepo.makelocalrepository(ui, pycompat.fsencode(test_repo_dir)) |
172 checkzobject(repo) |
174 checkzobject(repo) |
173 |
175 |
174 ziverify.verifyClass( |
176 ziverify.verifyClass( |
175 wireprototypes.baseprotocolhandler, wireprotoserver.sshv1protocolhandler |
177 wireprototypes.baseprotocolhandler, wireprotoserver.sshv1protocolhandler |
176 ) |
178 ) |