##// END OF EJS Templates
test-install: embed wix namespace for Python 2.6 compatibility...
Yuya Nishihara -
r27519:f4517c88 default
parent child Browse files
Show More
@@ -1,113 +1,113
1 hg debuginstall
1 hg debuginstall
2 $ hg debuginstall
2 $ hg debuginstall
3 checking encoding (ascii)...
3 checking encoding (ascii)...
4 checking Python executable (*) (glob)
4 checking Python executable (*) (glob)
5 checking Python version (2.*) (glob)
5 checking Python version (2.*) (glob)
6 checking Python lib (*lib*)... (glob)
6 checking Python lib (*lib*)... (glob)
7 checking installed modules (*mercurial)... (glob)
7 checking installed modules (*mercurial)... (glob)
8 checking templates (*mercurial?templates)... (glob)
8 checking templates (*mercurial?templates)... (glob)
9 checking commit editor...
9 checking commit editor...
10 checking username...
10 checking username...
11 no problems detected
11 no problems detected
12
12
13 hg debuginstall with no username
13 hg debuginstall with no username
14 $ HGUSER= hg debuginstall
14 $ HGUSER= hg debuginstall
15 checking encoding (ascii)...
15 checking encoding (ascii)...
16 checking Python executable (*) (glob)
16 checking Python executable (*) (glob)
17 checking Python version (2.*) (glob)
17 checking Python version (2.*) (glob)
18 checking Python lib (*lib*)... (glob)
18 checking Python lib (*lib*)... (glob)
19 checking installed modules (*mercurial)... (glob)
19 checking installed modules (*mercurial)... (glob)
20 checking templates (*mercurial?templates)... (glob)
20 checking templates (*mercurial?templates)... (glob)
21 checking commit editor...
21 checking commit editor...
22 checking username...
22 checking username...
23 no username supplied
23 no username supplied
24 (specify a username in your configuration file)
24 (specify a username in your configuration file)
25 1 problems detected, please check your install!
25 1 problems detected, please check your install!
26 [1]
26 [1]
27
27
28 path variables are expanded (~ is the same as $TESTTMP)
28 path variables are expanded (~ is the same as $TESTTMP)
29 $ mkdir tools
29 $ mkdir tools
30 $ touch tools/testeditor.exe
30 $ touch tools/testeditor.exe
31 #if execbit
31 #if execbit
32 $ chmod 755 tools/testeditor.exe
32 $ chmod 755 tools/testeditor.exe
33 #endif
33 #endif
34 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
34 $ hg debuginstall --config ui.editor=~/tools/testeditor.exe
35 checking encoding (ascii)...
35 checking encoding (ascii)...
36 checking Python executable (*) (glob)
36 checking Python executable (*) (glob)
37 checking Python version (*) (glob)
37 checking Python version (*) (glob)
38 checking Python lib (*lib*)... (glob)
38 checking Python lib (*lib*)... (glob)
39 checking installed modules (*mercurial)... (glob)
39 checking installed modules (*mercurial)... (glob)
40 checking templates (*mercurial?templates)... (glob)
40 checking templates (*mercurial?templates)... (glob)
41 checking commit editor...
41 checking commit editor...
42 checking username...
42 checking username...
43 no problems detected
43 no problems detected
44
44
45 #if test-repo
45 #if test-repo
46 $ cat >> wixxml.py << EOF
46 $ cat >> wixxml.py << EOF
47 > import os, subprocess, sys
47 > import os, subprocess, sys
48 > import xml.etree.ElementTree as ET
48 > import xml.etree.ElementTree as ET
49 >
49 >
50 > # MSYS mangles the path if it expands $TESTDIR
50 > # MSYS mangles the path if it expands $TESTDIR
51 > testdir = os.environ['TESTDIR']
51 > testdir = os.environ['TESTDIR']
52 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
52 > ns = {'wix' : 'http://schemas.microsoft.com/wix/2006/wi'}
53 >
53 >
54 > def directory(node, relpath):
54 > def directory(node, relpath):
55 > '''generator of files in the xml node, rooted at relpath'''
55 > '''generator of files in the xml node, rooted at relpath'''
56 > dirs = node.findall('./wix:Directory', ns)
56 > dirs = node.findall('./{%(wix)s}Directory' % ns)
57 >
57 >
58 > for d in dirs:
58 > for d in dirs:
59 > for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
59 > for subfile in directory(d, relpath + d.attrib['Name'] + '/'):
60 > yield subfile
60 > yield subfile
61 >
61 >
62 > files = node.findall('./wix:Component/wix:File', ns)
62 > files = node.findall('./{%(wix)s}Component/{%(wix)s}File' % ns)
63 >
63 >
64 > for f in files:
64 > for f in files:
65 > yield relpath + f.attrib['Name']
65 > yield relpath + f.attrib['Name']
66 >
66 >
67 > def hgdirectory(relpath):
67 > def hgdirectory(relpath):
68 > '''generator of tracked files, rooted at relpath'''
68 > '''generator of tracked files, rooted at relpath'''
69 > hgdir = "%s/../mercurial" % (testdir)
69 > hgdir = "%s/../mercurial" % (testdir)
70 > args = ['hg', '--cwd', hgdir, 'files', relpath]
70 > args = ['hg', '--cwd', hgdir, 'files', relpath]
71 > proc = subprocess.Popen(args, stdout=subprocess.PIPE,
71 > proc = subprocess.Popen(args, stdout=subprocess.PIPE,
72 > stderr=subprocess.PIPE)
72 > stderr=subprocess.PIPE)
73 > output = proc.communicate()[0]
73 > output = proc.communicate()[0]
74 >
74 >
75 > slash = '/'
75 > slash = '/'
76 > for line in output.splitlines():
76 > for line in output.splitlines():
77 > if os.name == 'nt':
77 > if os.name == 'nt':
78 > yield line.replace(os.sep, slash)
78 > yield line.replace(os.sep, slash)
79 > else:
79 > else:
80 > yield line
80 > yield line
81 >
81 >
82 > tracked = [f for f in hgdirectory(sys.argv[1])]
82 > tracked = [f for f in hgdirectory(sys.argv[1])]
83 >
83 >
84 > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
84 > xml = ET.parse("%s/../contrib/wix/%s.wxs" % (testdir, sys.argv[1]))
85 > root = xml.getroot()
85 > root = xml.getroot()
86 > dir = root.find('.//wix:DirectoryRef', ns)
86 > dir = root.find('.//{%(wix)s}DirectoryRef' % ns)
87 >
87 >
88 > installed = [f for f in directory(dir, '')]
88 > installed = [f for f in directory(dir, '')]
89 >
89 >
90 > print('Not installed:')
90 > print('Not installed:')
91 > for f in sorted(set(tracked) - set(installed)):
91 > for f in sorted(set(tracked) - set(installed)):
92 > print(' %s' % f)
92 > print(' %s' % f)
93 >
93 >
94 > print('Not tracked:')
94 > print('Not tracked:')
95 > for f in sorted(set(installed) - set(tracked)):
95 > for f in sorted(set(installed) - set(tracked)):
96 > print(' %s' % f)
96 > print(' %s' % f)
97 > EOF
97 > EOF
98
98
99 $ python wixxml.py help
99 $ python wixxml.py help
100 Not installed:
100 Not installed:
101 help/common.txt
101 help/common.txt
102 help/hg.1.txt
102 help/hg.1.txt
103 help/hgignore.5.txt
103 help/hgignore.5.txt
104 help/hgrc.5.txt
104 help/hgrc.5.txt
105 help/internals/bundles.txt
105 help/internals/bundles.txt
106 help/internals/changegroups.txt
106 help/internals/changegroups.txt
107 Not tracked:
107 Not tracked:
108
108
109 $ python wixxml.py templates
109 $ python wixxml.py templates
110 Not installed:
110 Not installed:
111 Not tracked:
111 Not tracked:
112
112
113 #endif
113 #endif
General Comments 0
You need to be logged in to leave comments. Login now