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