comparison tests/test-symlink-os-yes-fs-no.py @ 30559:d83ca854fa21

ui: factor out ui.load() to create a ui without loading configs (API) This allows us to write doctests depending on a ui object, but not on global configs. ui.load() is a class method so we can do wsgiui.load(). All ui() calls but for doctests are replaced with ui.load(). Some of them could be changed to not load configs later.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 22 Oct 2016 14:35:10 +0900
parents 8836f13e3c5b
children 5ac84b20f184
comparison
equal deleted inserted replaced
30557:cbeb54ec0481 30559:d83ca854fa21
15 15
16 # only makes sense to test on os which supports symlinks 16 # only makes sense to test on os which supports symlinks
17 if not getattr(os, "symlink", False): 17 if not getattr(os, "symlink", False):
18 sys.exit(80) # SKIPPED_STATUS defined in run-tests.py 18 sys.exit(80) # SKIPPED_STATUS defined in run-tests.py
19 19
20 u = uimod.ui() 20 u = uimod.ui.load()
21 # hide outer repo 21 # hide outer repo
22 hg.peer(u, {}, '.', create=True) 22 hg.peer(u, {}, '.', create=True)
23 23
24 # clone with symlink support 24 # clone with symlink support
25 hg.clone(u, {}, BUNDLEPATH, 'test0') 25 hg.clone(u, {}, BUNDLEPATH, 'test0')
46 fp = open(f, 'wb') 46 fp = open(f, 'wb')
47 fp.write(util.readfile(f[:-4])) 47 fp.write(util.readfile(f[:-4]))
48 fp.close() 48 fp.close()
49 49
50 # reload repository 50 # reload repository
51 u = uimod.ui() 51 u = uimod.ui.load()
52 repo = hg.repository(u, 'test0') 52 repo = hg.repository(u, 'test0')
53 commands.status(u, repo) 53 commands.status(u, repo)
54 54
55 # try cloning a repo which contains symlinks 55 # try cloning a repo which contains symlinks
56 u = uimod.ui() 56 u = uimod.ui.load()
57 hg.clone(u, {}, BUNDLEPATH, 'test1') 57 hg.clone(u, {}, BUNDLEPATH, 'test1')