1 import os, sys, time |
1 from __future__ import absolute_import |
2 from mercurial import hg, ui, commands, util |
2 |
|
3 import os |
|
4 import sys |
|
5 import time |
|
6 from mercurial import ( |
|
7 commands, |
|
8 hg, |
|
9 ui as uimod, |
|
10 util, |
|
11 ) |
3 |
12 |
4 TESTDIR = os.environ["TESTDIR"] |
13 TESTDIR = os.environ["TESTDIR"] |
5 BUNDLEPATH = os.path.join(TESTDIR, 'bundles', 'test-no-symlinks.hg') |
14 BUNDLEPATH = os.path.join(TESTDIR, 'bundles', 'test-no-symlinks.hg') |
6 |
15 |
7 # only makes sense to test on os which supports symlinks |
16 # only makes sense to test on os which supports symlinks |
8 if not getattr(os, "symlink", False): |
17 if not getattr(os, "symlink", False): |
9 sys.exit(80) # SKIPPED_STATUS defined in run-tests.py |
18 sys.exit(80) # SKIPPED_STATUS defined in run-tests.py |
10 |
19 |
11 u = ui.ui() |
20 u = uimod.ui() |
12 # hide outer repo |
21 # hide outer repo |
13 hg.peer(u, {}, '.', create=True) |
22 hg.peer(u, {}, '.', create=True) |
14 |
23 |
15 # clone with symlink support |
24 # clone with symlink support |
16 hg.clone(u, {}, BUNDLEPATH, 'test0') |
25 hg.clone(u, {}, BUNDLEPATH, 'test0') |
34 fp = open(f, 'wb') |
43 fp = open(f, 'wb') |
35 fp.write(util.readfile(f[:-4])) |
44 fp.write(util.readfile(f[:-4])) |
36 fp.close() |
45 fp.close() |
37 |
46 |
38 # reload repository |
47 # reload repository |
39 u = ui.ui() |
48 u = uimod.ui() |
40 repo = hg.repository(u, 'test0') |
49 repo = hg.repository(u, 'test0') |
41 commands.status(u, repo) |
50 commands.status(u, repo) |
42 |
51 |
43 # try cloning a repo which contains symlinks |
52 # try cloning a repo which contains symlinks |
44 u = ui.ui() |
53 u = uimod.ui() |
45 hg.clone(u, {}, BUNDLEPATH, 'test1') |
54 hg.clone(u, {}, BUNDLEPATH, 'test1') |