Show More
@@ -1,472 +1,556 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | # |
|
2 | # | |
3 | # run-tests.py - Run a set of tests on Mercurial |
|
3 | # run-tests.py - Run a set of tests on Mercurial | |
4 | # |
|
4 | # | |
5 | # Copyright 2006 Matt Mackall <mpm@selenic.com> |
|
5 | # Copyright 2006 Matt Mackall <mpm@selenic.com> | |
6 | # |
|
6 | # | |
7 | # This software may be used and distributed according to the terms |
|
7 | # This software may be used and distributed according to the terms | |
8 | # of the GNU General Public License, incorporated herein by reference. |
|
8 | # of the GNU General Public License, incorporated herein by reference. | |
9 |
|
9 | |||
10 | import difflib |
|
10 | import difflib | |
11 | import errno |
|
11 | import errno | |
12 | import optparse |
|
12 | import optparse | |
13 | import os |
|
13 | import os | |
14 | import popen2 |
|
14 | import popen2 | |
15 | import re |
|
15 | import re | |
16 | import shutil |
|
16 | import shutil | |
17 | import signal |
|
17 | import signal | |
18 | import sys |
|
18 | import sys | |
19 | import tempfile |
|
19 | import tempfile | |
20 | import time |
|
20 | import time | |
21 |
|
21 | |||
22 | # hghave reserved exit code to skip test |
|
22 | # hghave reserved exit code to skip test | |
23 | SKIPPED_STATUS = 80 |
|
23 | SKIPPED_STATUS = 80 | |
24 |
|
24 | |||
25 | required_tools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"] |
|
25 | required_tools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"] | |
26 |
|
26 | |||
27 | parser = optparse.OptionParser("%prog [options] [tests]") |
|
27 | parser = optparse.OptionParser("%prog [options] [tests]") | |
28 | parser.add_option("-v", "--verbose", action="store_true", |
|
|||
29 | help="output verbose messages") |
|
|||
30 | parser.add_option("-t", "--timeout", type="int", |
|
|||
31 | help="kill errant tests after TIMEOUT seconds") |
|
|||
32 | parser.add_option("-c", "--cover", action="store_true", |
|
|||
33 | help="print a test coverage report") |
|
|||
34 | parser.add_option("-s", "--cover_stdlib", action="store_true", |
|
|||
35 | help="print a test coverage report inc. standard libraries") |
|
|||
36 | parser.add_option("-C", "--annotate", action="store_true", |
|
28 | parser.add_option("-C", "--annotate", action="store_true", | |
37 | help="output files annotated with coverage") |
|
29 | help="output files annotated with coverage") | |
38 | parser.add_option("-r", "--retest", action="store_true", |
|
30 | parser.add_option("--child", type="int", | |
39 | help="retest failed tests") |
|
31 | help="run as child process, summary to given fd") | |
|
32 | parser.add_option("-c", "--cover", action="store_true", | |||
|
33 | help="print a test coverage report") | |||
40 | parser.add_option("-f", "--first", action="store_true", |
|
34 | parser.add_option("-f", "--first", action="store_true", | |
41 | help="exit on the first test failure") |
|
35 | help="exit on the first test failure") | |
|
36 | parser.add_option("-i", "--interactive", action="store_true", | |||
|
37 | help="prompt to accept changed output") | |||
|
38 | parser.add_option("-j", "--jobs", type="int", | |||
|
39 | help="number of jobs to run in parallel") | |||
42 | parser.add_option("-R", "--restart", action="store_true", |
|
40 | parser.add_option("-R", "--restart", action="store_true", | |
43 | help="restart at last error") |
|
41 | help="restart at last error") | |
44 | parser.add_option("-i", "--interactive", action="store_true", |
|
42 | parser.add_option("-p", "--port", type="int", | |
45 | help="prompt to accept changed output") |
|
43 | help="port on which servers should listen") | |
|
44 | parser.add_option("-r", "--retest", action="store_true", | |||
|
45 | help="retest failed tests") | |||
|
46 | parser.add_option("-s", "--cover_stdlib", action="store_true", | |||
|
47 | help="print a test coverage report inc. standard libraries") | |||
|
48 | parser.add_option("-t", "--timeout", type="int", | |||
|
49 | help="kill errant tests after TIMEOUT seconds") | |||
|
50 | parser.add_option("-v", "--verbose", action="store_true", | |||
|
51 | help="output verbose messages") | |||
|
52 | parser.add_option("--with-hg", type="string", | |||
|
53 | help="test existing install at given location") | |||
46 |
|
54 | |||
47 | parser.set_defaults(timeout=180) |
|
55 | parser.set_defaults(jobs=1, port=20059, timeout=180) | |
48 | (options, args) = parser.parse_args() |
|
56 | (options, args) = parser.parse_args() | |
49 | verbose = options.verbose |
|
57 | verbose = options.verbose | |
50 | coverage = options.cover or options.cover_stdlib or options.annotate |
|
58 | coverage = options.cover or options.cover_stdlib or options.annotate | |
51 | python = sys.executable |
|
59 | python = sys.executable | |
52 |
|
60 | |||
|
61 | if options.jobs < 1: | |||
|
62 | print >> sys.stderr, 'ERROR: -j/--jobs must be positive' | |||
|
63 | sys.exit(1) | |||
|
64 | if options.interactive and options.jobs > 1: | |||
|
65 | print >> sys.stderr, 'ERROR: cannot mix -interactive and --jobs > 1' | |||
|
66 | sys.exit(1) | |||
|
67 | ||||
53 | def vlog(*msg): |
|
68 | def vlog(*msg): | |
54 | if verbose: |
|
69 | if verbose: | |
55 | for m in msg: |
|
70 | for m in msg: | |
56 | print m, |
|
71 | print m, | |
57 |
|
72 | |||
58 |
|
73 | |||
59 | def splitnewlines(text): |
|
74 | def splitnewlines(text): | |
60 | '''like str.splitlines, but only split on newlines. |
|
75 | '''like str.splitlines, but only split on newlines. | |
61 | keep line endings.''' |
|
76 | keep line endings.''' | |
62 | i = 0 |
|
77 | i = 0 | |
63 | lines = [] |
|
78 | lines = [] | |
64 | while True: |
|
79 | while True: | |
65 | n = text.find('\n', i) |
|
80 | n = text.find('\n', i) | |
66 | if n == -1: |
|
81 | if n == -1: | |
67 | last = text[i:] |
|
82 | last = text[i:] | |
68 | if last: |
|
83 | if last: | |
69 | lines.append(last) |
|
84 | lines.append(last) | |
70 | return lines |
|
85 | return lines | |
71 | lines.append(text[i:n+1]) |
|
86 | lines.append(text[i:n+1]) | |
72 | i = n + 1 |
|
87 | i = n + 1 | |
73 |
|
88 | |||
74 | def extract_missing_features(lines): |
|
89 | def extract_missing_features(lines): | |
75 | '''Extract missing/unknown features log lines as a list''' |
|
90 | '''Extract missing/unknown features log lines as a list''' | |
76 | missing = [] |
|
91 | missing = [] | |
77 | for line in lines: |
|
92 | for line in lines: | |
78 | if not line.startswith('hghave: '): |
|
93 | if not line.startswith('hghave: '): | |
79 | continue |
|
94 | continue | |
80 | line = line.splitlines()[0] |
|
95 | line = line.splitlines()[0] | |
81 | missing.append(line[8:]) |
|
96 | missing.append(line[8:]) | |
82 |
|
97 | |||
83 | return missing |
|
98 | return missing | |
84 |
|
99 | |||
85 | def show_diff(expected, output): |
|
100 | def show_diff(expected, output): | |
86 | for line in difflib.unified_diff(expected, output, |
|
101 | for line in difflib.unified_diff(expected, output, | |
87 | "Expected output", "Test output"): |
|
102 | "Expected output", "Test output"): | |
88 | sys.stdout.write(line) |
|
103 | sys.stdout.write(line) | |
89 |
|
104 | |||
90 | def find_program(program): |
|
105 | def find_program(program): | |
91 | """Search PATH for a executable program""" |
|
106 | """Search PATH for a executable program""" | |
92 | for p in os.environ.get('PATH', os.defpath).split(os.pathsep): |
|
107 | for p in os.environ.get('PATH', os.defpath).split(os.pathsep): | |
93 | name = os.path.join(p, program) |
|
108 | name = os.path.join(p, program) | |
94 | if os.access(name, os.X_OK): |
|
109 | if os.access(name, os.X_OK): | |
95 | return name |
|
110 | return name | |
96 | return None |
|
111 | return None | |
97 |
|
112 | |||
98 | def check_required_tools(): |
|
113 | def check_required_tools(): | |
99 | # Before we go any further, check for pre-requisite tools |
|
114 | # Before we go any further, check for pre-requisite tools | |
100 | # stuff from coreutils (cat, rm, etc) are not tested |
|
115 | # stuff from coreutils (cat, rm, etc) are not tested | |
101 | for p in required_tools: |
|
116 | for p in required_tools: | |
102 | if os.name == 'nt': |
|
117 | if os.name == 'nt': | |
103 | p += '.exe' |
|
118 | p += '.exe' | |
104 | found = find_program(p) |
|
119 | found = find_program(p) | |
105 | if found: |
|
120 | if found: | |
106 | vlog("# Found prerequisite", p, "at", found) |
|
121 | vlog("# Found prerequisite", p, "at", found) | |
107 | else: |
|
122 | else: | |
108 | print "WARNING: Did not find prerequisite tool: "+p |
|
123 | print "WARNING: Did not find prerequisite tool: "+p | |
109 |
|
124 | |||
110 | def cleanup_exit(): |
|
125 | def cleanup_exit(): | |
111 | if verbose: |
|
126 | if verbose: | |
112 | print "# Cleaning up HGTMP", HGTMP |
|
127 | print "# Cleaning up HGTMP", HGTMP | |
113 | shutil.rmtree(HGTMP, True) |
|
128 | shutil.rmtree(HGTMP, True) | |
114 |
|
129 | |||
115 | def use_correct_python(): |
|
130 | def use_correct_python(): | |
116 | # some tests run python interpreter. they must use same |
|
131 | # some tests run python interpreter. they must use same | |
117 | # interpreter we use or bad things will happen. |
|
132 | # interpreter we use or bad things will happen. | |
118 | exedir, exename = os.path.split(sys.executable) |
|
133 | exedir, exename = os.path.split(sys.executable) | |
119 | if exename == 'python': |
|
134 | if exename == 'python': | |
120 | path = find_program('python') |
|
135 | path = find_program('python') | |
121 | if os.path.dirname(path) == exedir: |
|
136 | if os.path.dirname(path) == exedir: | |
122 | return |
|
137 | return | |
123 | vlog('# Making python executable in test path use correct Python') |
|
138 | vlog('# Making python executable in test path use correct Python') | |
124 | my_python = os.path.join(BINDIR, 'python') |
|
139 | my_python = os.path.join(BINDIR, 'python') | |
125 | try: |
|
140 | try: | |
126 | os.symlink(sys.executable, my_python) |
|
141 | os.symlink(sys.executable, my_python) | |
127 | except AttributeError: |
|
142 | except AttributeError: | |
128 | # windows fallback |
|
143 | # windows fallback | |
129 | shutil.copyfile(sys.executable, my_python) |
|
144 | shutil.copyfile(sys.executable, my_python) | |
130 | shutil.copymode(sys.executable, my_python) |
|
145 | shutil.copymode(sys.executable, my_python) | |
131 |
|
146 | |||
132 | def install_hg(): |
|
147 | def install_hg(): | |
133 | global python |
|
148 | global python | |
134 | vlog("# Performing temporary installation of HG") |
|
149 | vlog("# Performing temporary installation of HG") | |
135 | installerrs = os.path.join("tests", "install.err") |
|
150 | installerrs = os.path.join("tests", "install.err") | |
136 |
|
151 | |||
137 | # Run installer in hg root |
|
152 | # Run installer in hg root | |
138 | os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..')) |
|
153 | os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '..')) | |
139 | cmd = ('%s setup.py clean --all' |
|
154 | cmd = ('%s setup.py clean --all' | |
140 | ' install --force --home="%s" --install-lib="%s"' |
|
155 | ' install --force --home="%s" --install-lib="%s"' | |
141 | ' --install-scripts="%s" >%s 2>&1' |
|
156 | ' --install-scripts="%s" >%s 2>&1' | |
142 | % (sys.executable, INST, PYTHONDIR, BINDIR, installerrs)) |
|
157 | % (sys.executable, INST, PYTHONDIR, BINDIR, installerrs)) | |
143 | vlog("# Running", cmd) |
|
158 | vlog("# Running", cmd) | |
144 | if os.system(cmd) == 0: |
|
159 | if os.system(cmd) == 0: | |
145 | if not verbose: |
|
160 | if not verbose: | |
146 | os.remove(installerrs) |
|
161 | os.remove(installerrs) | |
147 | else: |
|
162 | else: | |
148 | f = open(installerrs) |
|
163 | f = open(installerrs) | |
149 | for line in f: |
|
164 | for line in f: | |
150 | print line, |
|
165 | print line, | |
151 | f.close() |
|
166 | f.close() | |
152 | sys.exit(1) |
|
167 | sys.exit(1) | |
153 | os.chdir(TESTDIR) |
|
168 | os.chdir(TESTDIR) | |
154 |
|
169 | |||
155 | os.environ["PATH"] = "%s%s%s" % (BINDIR, os.pathsep, os.environ["PATH"]) |
|
170 | os.environ["PATH"] = "%s%s%s" % (BINDIR, os.pathsep, os.environ["PATH"]) | |
156 |
|
171 | |||
157 | pydir = os.pathsep.join([PYTHONDIR, TESTDIR]) |
|
172 | pydir = os.pathsep.join([PYTHONDIR, TESTDIR]) | |
158 | pythonpath = os.environ.get("PYTHONPATH") |
|
173 | pythonpath = os.environ.get("PYTHONPATH") | |
159 | if pythonpath: |
|
174 | if pythonpath: | |
160 | pythonpath = pydir + os.pathsep + pythonpath |
|
175 | pythonpath = pydir + os.pathsep + pythonpath | |
161 | else: |
|
176 | else: | |
162 | pythonpath = pydir |
|
177 | pythonpath = pydir | |
163 | os.environ["PYTHONPATH"] = pythonpath |
|
178 | os.environ["PYTHONPATH"] = pythonpath | |
164 |
|
179 | |||
165 | use_correct_python() |
|
180 | use_correct_python() | |
166 |
|
181 | |||
167 | if coverage: |
|
182 | if coverage: | |
168 | vlog("# Installing coverage wrapper") |
|
183 | vlog("# Installing coverage wrapper") | |
169 | os.environ['COVERAGE_FILE'] = COVERAGE_FILE |
|
184 | os.environ['COVERAGE_FILE'] = COVERAGE_FILE | |
170 | if os.path.exists(COVERAGE_FILE): |
|
185 | if os.path.exists(COVERAGE_FILE): | |
171 | os.unlink(COVERAGE_FILE) |
|
186 | os.unlink(COVERAGE_FILE) | |
172 | # Create a wrapper script to invoke hg via coverage.py |
|
187 | # Create a wrapper script to invoke hg via coverage.py | |
173 | os.rename(os.path.join(BINDIR, "hg"), os.path.join(BINDIR, "_hg.py")) |
|
188 | os.rename(os.path.join(BINDIR, "hg"), os.path.join(BINDIR, "_hg.py")) | |
174 | f = open(os.path.join(BINDIR, 'hg'), 'w') |
|
189 | f = open(os.path.join(BINDIR, 'hg'), 'w') | |
175 | f.write('#!' + sys.executable + '\n') |
|
190 | f.write('#!' + sys.executable + '\n') | |
176 | f.write('import sys, os; os.execv(sys.executable, [sys.executable, ' |
|
191 | f.write('import sys, os; os.execv(sys.executable, [sys.executable, ' | |
177 | '"%s", "-x", "%s"] + sys.argv[1:])\n' % |
|
192 | '"%s", "-x", "%s"] + sys.argv[1:])\n' % | |
178 | (os.path.join(TESTDIR, 'coverage.py'), |
|
193 | (os.path.join(TESTDIR, 'coverage.py'), | |
179 | os.path.join(BINDIR, '_hg.py'))) |
|
194 | os.path.join(BINDIR, '_hg.py'))) | |
180 | f.close() |
|
195 | f.close() | |
181 | os.chmod(os.path.join(BINDIR, 'hg'), 0700) |
|
196 | os.chmod(os.path.join(BINDIR, 'hg'), 0700) | |
182 | python = '"%s" "%s" -x' % (sys.executable, |
|
197 | python = '"%s" "%s" -x' % (sys.executable, | |
183 | os.path.join(TESTDIR,'coverage.py')) |
|
198 | os.path.join(TESTDIR,'coverage.py')) | |
184 |
|
199 | |||
185 | def output_coverage(): |
|
200 | def output_coverage(): | |
186 | vlog("# Producing coverage report") |
|
201 | vlog("# Producing coverage report") | |
187 | omit = [BINDIR, TESTDIR, PYTHONDIR] |
|
202 | omit = [BINDIR, TESTDIR, PYTHONDIR] | |
188 | if not options.cover_stdlib: |
|
203 | if not options.cover_stdlib: | |
189 | # Exclude as system paths (ignoring empty strings seen on win) |
|
204 | # Exclude as system paths (ignoring empty strings seen on win) | |
190 | omit += [x for x in sys.path if x != ''] |
|
205 | omit += [x for x in sys.path if x != ''] | |
191 | omit = ','.join(omit) |
|
206 | omit = ','.join(omit) | |
192 | os.chdir(PYTHONDIR) |
|
207 | os.chdir(PYTHONDIR) | |
193 | cmd = '"%s" "%s" -i -r "--omit=%s"' % ( |
|
208 | cmd = '"%s" "%s" -i -r "--omit=%s"' % ( | |
194 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), omit) |
|
209 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), omit) | |
195 | vlog("# Running: "+cmd) |
|
210 | vlog("# Running: "+cmd) | |
196 | os.system(cmd) |
|
211 | os.system(cmd) | |
197 | if options.annotate: |
|
212 | if options.annotate: | |
198 | adir = os.path.join(TESTDIR, 'annotated') |
|
213 | adir = os.path.join(TESTDIR, 'annotated') | |
199 | if not os.path.isdir(adir): |
|
214 | if not os.path.isdir(adir): | |
200 | os.mkdir(adir) |
|
215 | os.mkdir(adir) | |
201 | cmd = '"%s" "%s" -i -a "--directory=%s" "--omit=%s"' % ( |
|
216 | cmd = '"%s" "%s" -i -a "--directory=%s" "--omit=%s"' % ( | |
202 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), |
|
217 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), | |
203 | adir, omit) |
|
218 | adir, omit) | |
204 | vlog("# Running: "+cmd) |
|
219 | vlog("# Running: "+cmd) | |
205 | os.system(cmd) |
|
220 | os.system(cmd) | |
206 |
|
221 | |||
207 | class Timeout(Exception): |
|
222 | class Timeout(Exception): | |
208 | pass |
|
223 | pass | |
209 |
|
224 | |||
210 | def alarmed(signum, frame): |
|
225 | def alarmed(signum, frame): | |
211 | raise Timeout |
|
226 | raise Timeout | |
212 |
|
227 | |||
213 | def run(cmd): |
|
228 | def run(cmd): | |
214 | """Run command in a sub-process, capturing the output (stdout and stderr). |
|
229 | """Run command in a sub-process, capturing the output (stdout and stderr). | |
215 | Return the exist code, and output.""" |
|
230 | Return the exist code, and output.""" | |
216 | # TODO: Use subprocess.Popen if we're running on Python 2.4 |
|
231 | # TODO: Use subprocess.Popen if we're running on Python 2.4 | |
217 | if os.name == 'nt': |
|
232 | if os.name == 'nt': | |
218 | tochild, fromchild = os.popen4(cmd) |
|
233 | tochild, fromchild = os.popen4(cmd) | |
219 | tochild.close() |
|
234 | tochild.close() | |
220 | output = fromchild.read() |
|
235 | output = fromchild.read() | |
221 | ret = fromchild.close() |
|
236 | ret = fromchild.close() | |
222 | if ret == None: |
|
237 | if ret == None: | |
223 | ret = 0 |
|
238 | ret = 0 | |
224 | else: |
|
239 | else: | |
225 | proc = popen2.Popen4(cmd) |
|
240 | proc = popen2.Popen4(cmd) | |
226 | try: |
|
241 | try: | |
227 | output = '' |
|
242 | output = '' | |
228 | proc.tochild.close() |
|
243 | proc.tochild.close() | |
229 | output = proc.fromchild.read() |
|
244 | output = proc.fromchild.read() | |
230 | ret = proc.wait() |
|
245 | ret = proc.wait() | |
231 | if os.WIFEXITED(ret): |
|
246 | if os.WIFEXITED(ret): | |
232 | ret = os.WEXITSTATUS(ret) |
|
247 | ret = os.WEXITSTATUS(ret) | |
233 | except Timeout: |
|
248 | except Timeout: | |
234 | vlog('# Process %d timed out - killing it' % proc.pid) |
|
249 | vlog('# Process %d timed out - killing it' % proc.pid) | |
235 | os.kill(proc.pid, signal.SIGTERM) |
|
250 | os.kill(proc.pid, signal.SIGTERM) | |
236 | ret = proc.wait() |
|
251 | ret = proc.wait() | |
237 | if ret == 0: |
|
252 | if ret == 0: | |
238 | ret = signal.SIGTERM << 8 |
|
253 | ret = signal.SIGTERM << 8 | |
239 | output += ("\n### Abort: timeout after %d seconds.\n" |
|
254 | output += ("\n### Abort: timeout after %d seconds.\n" | |
240 | % options.timeout) |
|
255 | % options.timeout) | |
241 | return ret, splitnewlines(output) |
|
256 | return ret, splitnewlines(output) | |
242 |
|
257 | |||
243 | def run_one(test): |
|
258 | def run_one(test): | |
244 | '''tristate output: |
|
259 | '''tristate output: | |
245 | None -> skipped |
|
260 | None -> skipped | |
246 | True -> passed |
|
261 | True -> passed | |
247 | False -> failed''' |
|
262 | False -> failed''' | |
248 |
|
263 | |||
249 | vlog("# Test", test) |
|
264 | vlog("# Test", test) | |
250 | if not verbose: |
|
265 | if not verbose: | |
251 | sys.stdout.write('.') |
|
266 | sys.stdout.write('.') | |
252 | sys.stdout.flush() |
|
267 | sys.stdout.flush() | |
253 |
|
268 | |||
254 | # create a fresh hgrc |
|
269 | # create a fresh hgrc | |
255 | hgrc = file(HGRCPATH, 'w+') |
|
270 | hgrc = file(HGRCPATH, 'w+') | |
256 | hgrc.write('[ui]\n') |
|
271 | hgrc.write('[ui]\n') | |
257 | hgrc.write('slash = True\n') |
|
272 | hgrc.write('slash = True\n') | |
258 | hgrc.close() |
|
273 | hgrc.close() | |
259 |
|
274 | |||
260 | err = os.path.join(TESTDIR, test+".err") |
|
275 | err = os.path.join(TESTDIR, test+".err") | |
261 | ref = os.path.join(TESTDIR, test+".out") |
|
276 | ref = os.path.join(TESTDIR, test+".out") | |
262 | testpath = os.path.join(TESTDIR, test) |
|
277 | testpath = os.path.join(TESTDIR, test) | |
263 |
|
278 | |||
264 | if os.path.exists(err): |
|
279 | if os.path.exists(err): | |
265 | os.remove(err) # Remove any previous output files |
|
280 | os.remove(err) # Remove any previous output files | |
266 |
|
281 | |||
267 | # Make a tmp subdirectory to work in |
|
282 | # Make a tmp subdirectory to work in | |
268 | tmpd = os.path.join(HGTMP, test) |
|
283 | tmpd = os.path.join(HGTMP, test) | |
269 | os.mkdir(tmpd) |
|
284 | os.mkdir(tmpd) | |
270 | os.chdir(tmpd) |
|
285 | os.chdir(tmpd) | |
271 |
|
286 | |||
272 | try: |
|
287 | try: | |
273 | tf = open(testpath) |
|
288 | tf = open(testpath) | |
274 | firstline = tf.readline().rstrip() |
|
289 | firstline = tf.readline().rstrip() | |
275 | tf.close() |
|
290 | tf.close() | |
276 | except: |
|
291 | except: | |
277 | firstline = '' |
|
292 | firstline = '' | |
278 | lctest = test.lower() |
|
293 | lctest = test.lower() | |
279 |
|
294 | |||
280 | if lctest.endswith('.py') or firstline == '#!/usr/bin/env python': |
|
295 | if lctest.endswith('.py') or firstline == '#!/usr/bin/env python': | |
281 | cmd = '%s "%s"' % (python, testpath) |
|
296 | cmd = '%s "%s"' % (python, testpath) | |
282 | elif lctest.endswith('.bat'): |
|
297 | elif lctest.endswith('.bat'): | |
283 | # do not run batch scripts on non-windows |
|
298 | # do not run batch scripts on non-windows | |
284 | if os.name != 'nt': |
|
299 | if os.name != 'nt': | |
285 | print '\nSkipping %s: batch script' % test |
|
300 | print '\nSkipping %s: batch script' % test | |
286 | return None |
|
301 | return None | |
287 | # To reliably get the error code from batch files on WinXP, |
|
302 | # To reliably get the error code from batch files on WinXP, | |
288 | # the "cmd /c call" prefix is needed. Grrr |
|
303 | # the "cmd /c call" prefix is needed. Grrr | |
289 | cmd = 'cmd /c call "%s"' % testpath |
|
304 | cmd = 'cmd /c call "%s"' % testpath | |
290 | else: |
|
305 | else: | |
291 | # do not run shell scripts on windows |
|
306 | # do not run shell scripts on windows | |
292 | if os.name == 'nt': |
|
307 | if os.name == 'nt': | |
293 | print '\nSkipping %s: shell script' % test |
|
308 | print '\nSkipping %s: shell script' % test | |
294 | return None |
|
309 | return None | |
295 | # do not try to run non-executable programs |
|
310 | # do not try to run non-executable programs | |
296 | if not os.access(testpath, os.X_OK): |
|
311 | if not os.access(testpath, os.X_OK): | |
297 | print '\nSkipping %s: not executable' % test |
|
312 | print '\nSkipping %s: not executable' % test | |
298 | return None |
|
313 | return None | |
299 | cmd = '"%s"' % testpath |
|
314 | cmd = '"%s"' % testpath | |
300 |
|
315 | |||
301 | if options.timeout > 0: |
|
316 | if options.timeout > 0: | |
302 | signal.alarm(options.timeout) |
|
317 | signal.alarm(options.timeout) | |
303 |
|
318 | |||
304 | vlog("# Running", cmd) |
|
319 | vlog("# Running", cmd) | |
305 | ret, out = run(cmd) |
|
320 | ret, out = run(cmd) | |
306 | vlog("# Ret was:", ret) |
|
321 | vlog("# Ret was:", ret) | |
307 |
|
322 | |||
308 | if options.timeout > 0: |
|
323 | if options.timeout > 0: | |
309 | signal.alarm(0) |
|
324 | signal.alarm(0) | |
310 |
|
325 | |||
311 | skipped = (ret == SKIPPED_STATUS) |
|
326 | skipped = (ret == SKIPPED_STATUS) | |
312 | diffret = 0 |
|
327 | diffret = 0 | |
313 | # If reference output file exists, check test output against it |
|
328 | # If reference output file exists, check test output against it | |
314 | if os.path.exists(ref): |
|
329 | if os.path.exists(ref): | |
315 | f = open(ref, "r") |
|
330 | f = open(ref, "r") | |
316 | ref_out = splitnewlines(f.read()) |
|
331 | ref_out = splitnewlines(f.read()) | |
317 | f.close() |
|
332 | f.close() | |
318 | else: |
|
333 | else: | |
319 | ref_out = [] |
|
334 | ref_out = [] | |
320 | if not skipped and out != ref_out: |
|
335 | if not skipped and out != ref_out: | |
321 | diffret = 1 |
|
336 | diffret = 1 | |
322 | print "\nERROR: %s output changed" % (test) |
|
337 | print "\nERROR: %s output changed" % (test) | |
323 | show_diff(ref_out, out) |
|
338 | show_diff(ref_out, out) | |
324 | if skipped: |
|
339 | if skipped: | |
325 | missing = extract_missing_features(out) |
|
340 | missing = extract_missing_features(out) | |
326 | if not missing: |
|
341 | if not missing: | |
327 | missing = ['irrelevant'] |
|
342 | missing = ['irrelevant'] | |
328 | print '\nSkipping %s: %s' % (test, missing[-1]) |
|
343 | print '\nSkipping %s: %s' % (test, missing[-1]) | |
329 | elif ret: |
|
344 | elif ret: | |
330 | print "\nERROR: %s failed with error code %d" % (test, ret) |
|
345 | print "\nERROR: %s failed with error code %d" % (test, ret) | |
331 | elif diffret: |
|
346 | elif diffret: | |
332 | ret = diffret |
|
347 | ret = diffret | |
333 |
|
348 | |||
334 | if ret != 0 and not skipped: |
|
349 | if ret != 0 and not skipped: | |
335 | # Save errors to a file for diagnosis |
|
350 | # Save errors to a file for diagnosis | |
336 | f = open(err, "wb") |
|
351 | f = open(err, "wb") | |
337 | for line in out: |
|
352 | for line in out: | |
338 | f.write(line) |
|
353 | f.write(line) | |
339 | f.close() |
|
354 | f.close() | |
340 |
|
355 | |||
341 | # Kill off any leftover daemon processes |
|
356 | # Kill off any leftover daemon processes | |
342 | try: |
|
357 | try: | |
343 | fp = file(DAEMON_PIDS) |
|
358 | fp = file(DAEMON_PIDS) | |
344 | for line in fp: |
|
359 | for line in fp: | |
345 | try: |
|
360 | try: | |
346 | pid = int(line) |
|
361 | pid = int(line) | |
347 | except ValueError: |
|
362 | except ValueError: | |
348 | continue |
|
363 | continue | |
349 | try: |
|
364 | try: | |
350 | os.kill(pid, 0) |
|
365 | os.kill(pid, 0) | |
351 | vlog('# Killing daemon process %d' % pid) |
|
366 | vlog('# Killing daemon process %d' % pid) | |
352 | os.kill(pid, signal.SIGTERM) |
|
367 | os.kill(pid, signal.SIGTERM) | |
353 | time.sleep(0.25) |
|
368 | time.sleep(0.25) | |
354 | os.kill(pid, 0) |
|
369 | os.kill(pid, 0) | |
355 | vlog('# Daemon process %d is stuck - really killing it' % pid) |
|
370 | vlog('# Daemon process %d is stuck - really killing it' % pid) | |
356 | os.kill(pid, signal.SIGKILL) |
|
371 | os.kill(pid, signal.SIGKILL) | |
357 | except OSError, err: |
|
372 | except OSError, err: | |
358 | if err.errno != errno.ESRCH: |
|
373 | if err.errno != errno.ESRCH: | |
359 | raise |
|
374 | raise | |
360 | fp.close() |
|
375 | fp.close() | |
361 | os.unlink(DAEMON_PIDS) |
|
376 | os.unlink(DAEMON_PIDS) | |
362 | except IOError: |
|
377 | except IOError: | |
363 | pass |
|
378 | pass | |
364 |
|
379 | |||
365 | os.chdir(TESTDIR) |
|
380 | os.chdir(TESTDIR) | |
366 | shutil.rmtree(tmpd, True) |
|
381 | shutil.rmtree(tmpd, True) | |
367 | if skipped: |
|
382 | if skipped: | |
368 | return None |
|
383 | return None | |
369 | return ret == 0 |
|
384 | return ret == 0 | |
370 |
|
385 | |||
|
386 | if not options.child: | |||
|
387 | os.umask(022) | |||
371 |
|
388 | |||
372 | os.umask(022) |
|
389 | check_required_tools() | |
373 |
|
||||
374 | check_required_tools() |
|
|||
375 |
|
390 | |||
376 | # Reset some environment variables to well-known values so that |
|
391 | # Reset some environment variables to well-known values so that | |
377 | # the tests produce repeatable output. |
|
392 | # the tests produce repeatable output. | |
378 | os.environ['LANG'] = os.environ['LC_ALL'] = 'C' |
|
393 | os.environ['LANG'] = os.environ['LC_ALL'] = 'C' | |
379 | os.environ['TZ'] = 'GMT' |
|
394 | os.environ['TZ'] = 'GMT' | |
380 |
|
395 | |||
381 | TESTDIR = os.environ["TESTDIR"] = os.getcwd() |
|
396 | TESTDIR = os.environ["TESTDIR"] = os.getcwd() | |
382 | HGTMP = os.environ["HGTMP"] = tempfile.mkdtemp("", "hgtests.") |
|
397 | HGTMP = os.environ["HGTMP"] = tempfile.mkdtemp("", "hgtests.") | |
383 | DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids') |
|
398 | DAEMON_PIDS = None | |
384 | HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc') |
|
399 | HGRCPATH = None | |
385 |
|
400 | |||
386 | os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"' |
|
401 | os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"' | |
387 | os.environ["HGMERGE"] = ('python "%s" -L my -L other' |
|
402 | os.environ["HGMERGE"] = ('python "%s" -L my -L other' | |
388 |
% os.path.join(TESTDIR, os.path.pardir, |
|
403 | % os.path.join(TESTDIR, os.path.pardir, | |
389 | 'simplemerge')) |
|
404 | 'contrib', 'simplemerge')) | |
390 | os.environ["HGUSER"] = "test" |
|
405 | os.environ["HGUSER"] = "test" | |
391 | os.environ["HGENCODING"] = "ascii" |
|
406 | os.environ["HGENCODING"] = "ascii" | |
392 | os.environ["HGENCODINGMODE"] = "strict" |
|
407 | os.environ["HGENCODINGMODE"] = "strict" | |
|
408 | os.environ["HGPORT"] = str(options.port) | |||
|
409 | os.environ["HGPORT1"] = str(options.port + 1) | |||
|
410 | os.environ["HGPORT2"] = str(options.port + 2) | |||
393 |
|
411 | |||
394 | vlog("# Using TESTDIR", TESTDIR) |
|
412 | if options.with_hg: | |
395 | vlog("# Using HGTMP", HGTMP) |
|
413 | INST = options.with_hg | |
396 |
|
414 | else: | ||
397 | INST = os.path.join(HGTMP, "install") |
|
415 | INST = os.path.join(HGTMP, "install") | |
398 | BINDIR = os.path.join(INST, "bin") |
|
416 | BINDIR = os.path.join(INST, "bin") | |
399 | PYTHONDIR = os.path.join(INST, "lib", "python") |
|
417 | PYTHONDIR = os.path.join(INST, "lib", "python") | |
400 | COVERAGE_FILE = os.path.join(TESTDIR, ".coverage") |
|
418 | COVERAGE_FILE = os.path.join(TESTDIR, ".coverage") | |
401 |
|
419 | |||
402 | try: |
|
420 | def run_children(tests): | |
|
421 | if not options.with_hg: | |||
|
422 | install_hg() | |||
|
423 | ||||
|
424 | optcopy = dict(options.__dict__) | |||
|
425 | optcopy['jobs'] = 1 | |||
|
426 | optcopy['with_hg'] = INST | |||
|
427 | opts = [] | |||
|
428 | for opt, value in optcopy.iteritems(): | |||
|
429 | name = '--' + opt.replace('_', '-') | |||
|
430 | if value is True: | |||
|
431 | opts.append(name) | |||
|
432 | elif value is not None: | |||
|
433 | opts.append(name + '=' + str(value)) | |||
|
434 | ||||
|
435 | tests.reverse() | |||
|
436 | jobs = [[] for j in xrange(options.jobs)] | |||
|
437 | while tests: | |||
|
438 | for j in xrange(options.jobs): | |||
|
439 | if not tests: break | |||
|
440 | jobs[j].append(tests.pop()) | |||
|
441 | fps = {} | |||
|
442 | for j in xrange(len(jobs)): | |||
|
443 | job = jobs[j] | |||
|
444 | if not job: | |||
|
445 | continue | |||
|
446 | rfd, wfd = os.pipe() | |||
|
447 | childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)] | |||
|
448 | cmdline = [python, sys.argv[0]] + opts + childopts + job | |||
|
449 | vlog(' '.join(cmdline)) | |||
|
450 | fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'r') | |||
|
451 | os.close(wfd) | |||
|
452 | failures = 0 | |||
|
453 | tested, skipped, failed = 0, 0, 0 | |||
|
454 | while fps: | |||
|
455 | pid, status = os.wait() | |||
|
456 | fp = fps.pop(pid) | |||
|
457 | test, skip, fail = map(int, fp.read().splitlines()) | |||
|
458 | tested += test | |||
|
459 | skipped += skip | |||
|
460 | failed += fail | |||
|
461 | vlog('pid %d exited, status %d' % (pid, status)) | |||
|
462 | failures |= status | |||
|
463 | print "\n# Ran %d tests, %d skipped, %d failed." % ( | |||
|
464 | tested, skipped, failed) | |||
|
465 | sys.exit(failures != 0) | |||
|
466 | ||||
|
467 | def run_tests(tests): | |||
|
468 | global DAEMON_PIDS, HGRCPATH | |||
|
469 | DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids') | |||
|
470 | HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc') | |||
|
471 | ||||
403 | try: |
|
472 | try: | |
404 | install_hg() |
|
473 | if not options.with_hg: | |
|
474 | install_hg() | |||
405 |
|
475 | |||
406 | if options.timeout > 0: |
|
476 | if options.timeout > 0: | |
407 | try: |
|
477 | try: | |
408 | signal.signal(signal.SIGALRM, alarmed) |
|
478 | signal.signal(signal.SIGALRM, alarmed) | |
409 | vlog('# Running tests with %d-second timeout' % |
|
479 | vlog('# Running tests with %d-second timeout' % | |
410 | options.timeout) |
|
480 | options.timeout) | |
411 | except AttributeError: |
|
481 | except AttributeError: | |
412 | print 'WARNING: cannot run tests with timeouts' |
|
482 | print 'WARNING: cannot run tests with timeouts' | |
413 | options.timeout = 0 |
|
483 | options.timeout = 0 | |
414 |
|
484 | |||
415 | tested = 0 |
|
485 | tested = 0 | |
416 | failed = 0 |
|
486 | failed = 0 | |
417 | skipped = 0 |
|
487 | skipped = 0 | |
418 |
|
488 | |||
419 | if len(args) == 0: |
|
|||
420 | args = os.listdir(".") |
|
|||
421 | args.sort() |
|
|||
422 |
|
||||
423 |
|
||||
424 | tests = [] |
|
|||
425 | for test in args: |
|
|||
426 | if (test.startswith("test-") and '~' not in test and |
|
|||
427 | ('.' not in test or test.endswith('.py') or |
|
|||
428 | test.endswith('.bat'))): |
|
|||
429 | tests.append(test) |
|
|||
430 |
|
||||
431 | if options.restart: |
|
489 | if options.restart: | |
432 | orig = list(tests) |
|
490 | orig = list(tests) | |
433 | while tests: |
|
491 | while tests: | |
434 | if os.path.exists(tests[0] + ".err"): |
|
492 | if os.path.exists(tests[0] + ".err"): | |
435 | break |
|
493 | break | |
436 | tests.pop(0) |
|
494 | tests.pop(0) | |
437 | if not tests: |
|
495 | if not tests: | |
438 | print "running all tests" |
|
496 | print "running all tests" | |
439 | tests = orig |
|
497 | tests = orig | |
440 |
|
498 | |||
441 | for test in tests: |
|
499 | for test in tests: | |
442 | if options.retest and not os.path.exists(test + ".err"): |
|
500 | if options.retest and not os.path.exists(test + ".err"): | |
443 | skipped += 1 |
|
501 | skipped += 1 | |
444 | continue |
|
502 | continue | |
445 | ret = run_one(test) |
|
503 | ret = run_one(test) | |
446 | if ret is None: |
|
504 | if ret is None: | |
447 | skipped += 1 |
|
505 | skipped += 1 | |
448 | elif not ret: |
|
506 | elif not ret: | |
449 | if options.interactive: |
|
507 | if options.interactive: | |
450 | print "Accept this change? [n] ", |
|
508 | print "Accept this change? [n] ", | |
451 | answer = sys.stdin.readline().strip() |
|
509 | answer = sys.stdin.readline().strip() | |
452 | if answer.lower() in "y yes".split(): |
|
510 | if answer.lower() in "y yes".split(): | |
453 | os.rename(test + ".err", test + ".out") |
|
511 | os.rename(test + ".err", test + ".out") | |
454 | tested += 1 |
|
512 | tested += 1 | |
455 | continue |
|
513 | continue | |
456 | failed += 1 |
|
514 | failed += 1 | |
457 | if options.first: |
|
515 | if options.first: | |
458 | break |
|
516 | break | |
459 | tested += 1 |
|
517 | tested += 1 | |
460 |
|
518 | |||
461 | print "\n# Ran %d tests, %d skipped, %d failed." % (tested, skipped, |
|
519 | if options.child: | |
462 | failed) |
|
520 | fp = os.fdopen(options.child, 'w') | |
|
521 | fp.write('%d\n%d\n%d\n' % (tested, skipped, failed)) | |||
|
522 | fp.close() | |||
|
523 | else: | |||
|
524 | print "\n# Ran %d tests, %d skipped, %d failed." % ( | |||
|
525 | tested, skipped, failed) | |||
|
526 | ||||
463 | if coverage: |
|
527 | if coverage: | |
464 | output_coverage() |
|
528 | output_coverage() | |
465 | except KeyboardInterrupt: |
|
529 | except KeyboardInterrupt: | |
466 | failed = True |
|
530 | failed = True | |
467 | print "\ninterrupted!" |
|
531 | print "\ninterrupted!" | |
|
532 | ||||
|
533 | if failed: | |||
|
534 | sys.exit(1) | |||
|
535 | ||||
|
536 | if len(args) == 0: | |||
|
537 | args = os.listdir(".") | |||
|
538 | args.sort() | |||
|
539 | ||||
|
540 | tests = [] | |||
|
541 | for test in args: | |||
|
542 | if (test.startswith("test-") and '~' not in test and | |||
|
543 | ('.' not in test or test.endswith('.py') or | |||
|
544 | test.endswith('.bat'))): | |||
|
545 | tests.append(test) | |||
|
546 | ||||
|
547 | vlog("# Using TESTDIR", TESTDIR) | |||
|
548 | vlog("# Using HGTMP", HGTMP) | |||
|
549 | ||||
|
550 | try: | |||
|
551 | if len(tests) > 1 and options.jobs > 1: | |||
|
552 | run_children(tests) | |||
|
553 | else: | |||
|
554 | run_tests(tests) | |||
468 | finally: |
|
555 | finally: | |
469 | cleanup_exit() |
|
556 | cleanup_exit() | |
470 |
|
||||
471 | if failed: |
|
|||
472 | sys.exit(1) |
|
@@ -1,76 +1,76 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | mkdir test |
|
3 | mkdir test | |
4 | cd test |
|
4 | cd test | |
5 | hg init |
|
5 | hg init | |
6 | echo foo>foo |
|
6 | echo foo>foo | |
7 | hg commit -Am 1 -d '1 0' |
|
7 | hg commit -Am 1 -d '1 0' | |
8 | echo bar>bar |
|
8 | echo bar>bar | |
9 | hg commit -Am 2 -d '2 0' |
|
9 | hg commit -Am 2 -d '2 0' | |
10 | mkdir baz |
|
10 | mkdir baz | |
11 | echo bletch>baz/bletch |
|
11 | echo bletch>baz/bletch | |
12 | hg commit -Am 3 -d '1000000000 0' |
|
12 | hg commit -Am 3 -d '1000000000 0' | |
13 | echo "[web]" >> .hg/hgrc |
|
13 | echo "[web]" >> .hg/hgrc | |
14 | echo "name = test-archive" >> .hg/hgrc |
|
14 | echo "name = test-archive" >> .hg/hgrc | |
15 | echo "allow_archive = gz bz2, zip" >> .hg/hgrc |
|
15 | echo "allow_archive = gz bz2, zip" >> .hg/hgrc | |
16 |
hg serve -p |
|
16 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
17 | cat hg.pid >> $DAEMON_PIDS |
|
17 | cat hg.pid >> $DAEMON_PIDS | |
18 |
|
18 | |||
19 | TIP=`hg id -v | cut -f1 -d' '` |
|
19 | TIP=`hg id -v | cut -f1 -d' '` | |
20 | QTIP=`hg id -q` |
|
20 | QTIP=`hg id -q` | |
21 | cat > getarchive.py <<EOF |
|
21 | cat > getarchive.py <<EOF | |
22 | import sys, urllib2 |
|
22 | import os, sys, urllib2 | |
23 | node, archive = sys.argv[1:] |
|
23 | node, archive = sys.argv[1:] | |
24 |
f = urllib2.urlopen('http://127.0.0.1: |
|
24 | f = urllib2.urlopen('http://127.0.0.1:%s/?cmd=archive;node=%s;type=%s' | |
25 | % (node, archive)) |
|
25 | % (os.environ['HGPORT'], node, archive)) | |
26 | sys.stdout.write(f.read()) |
|
26 | sys.stdout.write(f.read()) | |
27 | EOF |
|
27 | EOF | |
28 | http_proxy= python getarchive.py "$TIP" gz | gunzip | tar tf - | sed "s/$QTIP/TIP/" |
|
28 | http_proxy= python getarchive.py "$TIP" gz | gunzip | tar tf - | sed "s/$QTIP/TIP/" | |
29 | http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - | sed "s/$QTIP/TIP/" |
|
29 | http_proxy= python getarchive.py "$TIP" bz2 | bunzip2 | tar tf - | sed "s/$QTIP/TIP/" | |
30 | http_proxy= python getarchive.py "$TIP" zip > archive.zip |
|
30 | http_proxy= python getarchive.py "$TIP" zip > archive.zip | |
31 | unzip -t archive.zip | sed "s/$QTIP/TIP/" |
|
31 | unzip -t archive.zip | sed "s/$QTIP/TIP/" | |
32 |
|
32 | |||
33 | hg archive -t tar test.tar |
|
33 | hg archive -t tar test.tar | |
34 | tar tf test.tar |
|
34 | tar tf test.tar | |
35 |
|
35 | |||
36 | hg archive -t tbz2 -X baz test.tar.bz2 |
|
36 | hg archive -t tbz2 -X baz test.tar.bz2 | |
37 | bunzip2 -dc test.tar.bz2 | tar tf - |
|
37 | bunzip2 -dc test.tar.bz2 | tar tf - | |
38 |
|
38 | |||
39 | hg archive -t tgz -p %b-%h test-%h.tar.gz |
|
39 | hg archive -t tgz -p %b-%h test-%h.tar.gz | |
40 | gzip -dc test-$QTIP.tar.gz | tar tf - | sed "s/$QTIP/TIP/" |
|
40 | gzip -dc test-$QTIP.tar.gz | tar tf - | sed "s/$QTIP/TIP/" | |
41 |
|
41 | |||
42 | cat > md5comp.py <<EOF |
|
42 | cat > md5comp.py <<EOF | |
43 | import md5, sys |
|
43 | import md5, sys | |
44 | f1, f2 = sys.argv[1:3] |
|
44 | f1, f2 = sys.argv[1:3] | |
45 | h1 = md5.md5(file(f1, 'rb').read()).hexdigest() |
|
45 | h1 = md5.md5(file(f1, 'rb').read()).hexdigest() | |
46 | h2 = md5.md5(file(f2, 'rb').read()).hexdigest() |
|
46 | h2 = md5.md5(file(f2, 'rb').read()).hexdigest() | |
47 | print h1 == h2 or "md5 differ: " + repr((h1, h2)) |
|
47 | print h1 == h2 or "md5 differ: " + repr((h1, h2)) | |
48 | EOF |
|
48 | EOF | |
49 |
|
49 | |||
50 | # archive name is stored in the archive, so create similar |
|
50 | # archive name is stored in the archive, so create similar | |
51 | # archives and rename them afterwards. |
|
51 | # archives and rename them afterwards. | |
52 | hg archive -t tgz tip.tar.gz |
|
52 | hg archive -t tgz tip.tar.gz | |
53 | mv tip.tar.gz tip1.tar.gz |
|
53 | mv tip.tar.gz tip1.tar.gz | |
54 | sleep 1 |
|
54 | sleep 1 | |
55 | hg archive -t tgz tip.tar.gz |
|
55 | hg archive -t tgz tip.tar.gz | |
56 | mv tip.tar.gz tip2.tar.gz |
|
56 | mv tip.tar.gz tip2.tar.gz | |
57 | python md5comp.py tip1.tar.gz tip2.tar.gz |
|
57 | python md5comp.py tip1.tar.gz tip2.tar.gz | |
58 |
|
58 | |||
59 | hg archive -t zip -p /illegal test.zip |
|
59 | hg archive -t zip -p /illegal test.zip | |
60 | hg archive -t zip -p very/../bad test.zip |
|
60 | hg archive -t zip -p very/../bad test.zip | |
61 |
|
61 | |||
62 | hg archive -t zip -r 2 test.zip |
|
62 | hg archive -t zip -r 2 test.zip | |
63 | unzip -t test.zip |
|
63 | unzip -t test.zip | |
64 |
|
64 | |||
65 | hg archive -t tar - | tar tf - | sed "s/$QTIP/TIP/" |
|
65 | hg archive -t tar - | tar tf - | sed "s/$QTIP/TIP/" | |
66 |
|
66 | |||
67 | hg archive -r 0 -t tar rev-%r.tar |
|
67 | hg archive -r 0 -t tar rev-%r.tar | |
68 | if [ -f rev-0.tar ]; then |
|
68 | if [ -f rev-0.tar ]; then | |
69 | echo 'rev-0.tar created' |
|
69 | echo 'rev-0.tar created' | |
70 | fi |
|
70 | fi | |
71 |
|
71 | |||
72 | echo '% empty repo' |
|
72 | echo '% empty repo' | |
73 | hg init ../empty |
|
73 | hg init ../empty | |
74 | cd ../empty |
|
74 | cd ../empty | |
75 | hg archive ../test-empty |
|
75 | hg archive ../test-empty | |
76 | exit 0 |
|
76 | exit 0 |
@@ -1,30 +1,30 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 |
hg clone http://localhost: |
|
3 | hg clone http://localhost:$HGPORT/ copy | |
4 | echo $? |
|
4 | echo $? | |
5 | test -d copy || echo copy: No such file or directory |
|
5 | test -d copy || echo copy: No such file or directory | |
6 |
|
6 | |||
7 | cat > dumb.py <<EOF |
|
7 | cat > dumb.py <<EOF | |
8 | import BaseHTTPServer, SimpleHTTPServer, signal |
|
8 | import BaseHTTPServer, SimpleHTTPServer, os, signal | |
9 |
|
9 | |||
10 | def run(server_class=BaseHTTPServer.HTTPServer, |
|
10 | def run(server_class=BaseHTTPServer.HTTPServer, | |
11 | handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): |
|
11 | handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): | |
12 |
server_address = ('localhost', |
|
12 | server_address = ('localhost', int(os.environ['HGPORT'])) | |
13 | httpd = server_class(server_address, handler_class) |
|
13 | httpd = server_class(server_address, handler_class) | |
14 | httpd.serve_forever() |
|
14 | httpd.serve_forever() | |
15 |
|
15 | |||
16 | signal.signal(signal.SIGTERM, lambda x: sys.exit(0)) |
|
16 | signal.signal(signal.SIGTERM, lambda x: sys.exit(0)) | |
17 | run() |
|
17 | run() | |
18 | EOF |
|
18 | EOF | |
19 |
|
19 | |||
20 | python dumb.py 2>/dev/null & |
|
20 | python dumb.py 2>/dev/null & | |
21 | echo $! >> $DAEMON_PIDS |
|
21 | echo $! >> $DAEMON_PIDS | |
22 |
|
22 | |||
23 | # give the server some time to start running |
|
23 | # give the server some time to start running | |
24 | sleep 1 |
|
24 | sleep 1 | |
25 |
|
25 | |||
26 |
http_proxy= hg clone http://localhost: |
|
26 | http_proxy= hg clone http://localhost:$HGPORT/foo copy2 2>&1 | \ | |
27 | sed -e 's/404.*/404/' -e 's/Date:.*/Date:/' |
|
27 | sed -e 's/404.*/404/' -e 's/Date:.*/Date:/' | |
28 | echo $? |
|
28 | echo $? | |
29 |
|
29 | |||
30 | kill $! |
|
30 | kill $! |
@@ -1,13 +1,13 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hg init test |
|
3 | hg init test | |
4 | cd test |
|
4 | cd test | |
5 | mkdir da |
|
5 | mkdir da | |
6 | echo foo > da/foo |
|
6 | echo foo > da/foo | |
7 | echo foo > foo |
|
7 | echo foo > foo | |
8 | hg ci -Ambase -d '0 0' |
|
8 | hg ci -Ambase -d '0 0' | |
9 |
hg serve -p |
|
9 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
10 | echo % manifest |
|
10 | echo % manifest | |
11 |
("$TESTDIR/get-with-headers.py" localhost: |
|
11 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/?style=raw') | |
12 |
("$TESTDIR/get-with-headers.py" localhost: |
|
12 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/da?style=raw') | |
13 | kill `cat hg.pid` |
|
13 | kill `cat hg.pid` |
@@ -1,38 +1,38 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | cp "$TESTDIR"/printenv.py . |
|
3 | cp "$TESTDIR"/printenv.py . | |
4 |
|
4 | |||
5 | hg init test |
|
5 | hg init test | |
6 | cd test |
|
6 | cd test | |
7 | echo foo>foo |
|
7 | echo foo>foo | |
8 | hg commit -A -d '0 0' -m 1 |
|
8 | hg commit -A -d '0 0' -m 1 | |
9 |
hg --config server.uncompressed=True serve -p |
|
9 | hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=../hg1.pid | |
10 |
hg serve -p |
|
10 | hg serve -p $HGPORT1 -d --pid-file=../hg2.pid | |
11 | # Test server address cannot be reused |
|
11 | # Test server address cannot be reused | |
12 |
hg serve -p |
|
12 | hg serve -p $HGPORT1 2>&1 | sed -e 's/abort: cannot start server:.*/abort: cannot start server:/' | |
13 | cd .. |
|
13 | cd .. | |
14 | cat hg1.pid hg2.pid >> $DAEMON_PIDS |
|
14 | cat hg1.pid hg2.pid >> $DAEMON_PIDS | |
15 |
|
15 | |||
16 | echo % clone via stream |
|
16 | echo % clone via stream | |
17 |
http_proxy= hg clone --uncompressed http://localhost: |
|
17 | http_proxy= hg clone --uncompressed http://localhost:$HGPORT/ copy 2>&1 | \ | |
18 | sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/' |
|
18 | sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/' | |
19 | hg verify -R copy |
|
19 | hg verify -R copy | |
20 |
|
20 | |||
21 | echo % try to clone via stream, should use pull instead |
|
21 | echo % try to clone via stream, should use pull instead | |
22 |
http_proxy= hg clone --uncompressed http://localhost: |
|
22 | http_proxy= hg clone --uncompressed http://localhost:$HGPORT1/ copy2 | |
23 |
|
23 | |||
24 | echo % clone via pull |
|
24 | echo % clone via pull | |
25 |
http_proxy= hg clone http://localhost: |
|
25 | http_proxy= hg clone http://localhost:$HGPORT1/ copy-pull | |
26 | hg verify -R copy-pull |
|
26 | hg verify -R copy-pull | |
27 |
|
27 | |||
28 | cd test |
|
28 | cd test | |
29 | echo bar > bar |
|
29 | echo bar > bar | |
30 | hg commit -A -d '1 0' -m 2 |
|
30 | hg commit -A -d '1 0' -m 2 | |
31 | cd .. |
|
31 | cd .. | |
32 |
|
32 | |||
33 | echo % pull |
|
33 | echo % pull | |
34 | cd copy-pull |
|
34 | cd copy-pull | |
35 | echo '[hooks]' >> .hg/hgrc |
|
35 | echo '[hooks]' >> .hg/hgrc | |
36 | echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc |
|
36 | echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc | |
37 | hg pull |
|
37 | hg pull | sed -e 's,:[0-9][0-9]*/,/,' | |
38 | cd .. |
|
38 | cd .. |
@@ -1,78 +1,78 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hg init remote |
|
3 | hg init remote | |
4 | cd remote |
|
4 | cd remote | |
5 | echo "# creating 'remote'" |
|
5 | echo "# creating 'remote'" | |
6 | cat >>afile <<EOF |
|
6 | cat >>afile <<EOF | |
7 | 0 |
|
7 | 0 | |
8 | EOF |
|
8 | EOF | |
9 | hg add afile |
|
9 | hg add afile | |
10 | hg commit -m "0.0" |
|
10 | hg commit -m "0.0" | |
11 | cat >>afile <<EOF |
|
11 | cat >>afile <<EOF | |
12 | 1 |
|
12 | 1 | |
13 | EOF |
|
13 | EOF | |
14 | hg commit -m "0.1" |
|
14 | hg commit -m "0.1" | |
15 | cat >>afile <<EOF |
|
15 | cat >>afile <<EOF | |
16 | 2 |
|
16 | 2 | |
17 | EOF |
|
17 | EOF | |
18 | hg commit -m "0.2" |
|
18 | hg commit -m "0.2" | |
19 | cat >>afile <<EOF |
|
19 | cat >>afile <<EOF | |
20 | 3 |
|
20 | 3 | |
21 | EOF |
|
21 | EOF | |
22 | hg commit -m "0.3" |
|
22 | hg commit -m "0.3" | |
23 | hg update -C 0 |
|
23 | hg update -C 0 | |
24 | cat >>afile <<EOF |
|
24 | cat >>afile <<EOF | |
25 | 1 |
|
25 | 1 | |
26 | EOF |
|
26 | EOF | |
27 | hg commit -m "1.1" |
|
27 | hg commit -m "1.1" | |
28 | cat >>afile <<EOF |
|
28 | cat >>afile <<EOF | |
29 | 2 |
|
29 | 2 | |
30 | EOF |
|
30 | EOF | |
31 | hg commit -m "1.2" |
|
31 | hg commit -m "1.2" | |
32 | cat >fred <<EOF |
|
32 | cat >fred <<EOF | |
33 | a line |
|
33 | a line | |
34 | EOF |
|
34 | EOF | |
35 | cat >>afile <<EOF |
|
35 | cat >>afile <<EOF | |
36 | 3 |
|
36 | 3 | |
37 | EOF |
|
37 | EOF | |
38 | hg add fred |
|
38 | hg add fred | |
39 | hg commit -m "1.3" |
|
39 | hg commit -m "1.3" | |
40 | hg mv afile adifferentfile |
|
40 | hg mv afile adifferentfile | |
41 | hg commit -m "1.3m" |
|
41 | hg commit -m "1.3m" | |
42 | hg update -C 3 |
|
42 | hg update -C 3 | |
43 | hg mv afile anotherfile |
|
43 | hg mv afile anotherfile | |
44 | hg commit -m "0.3m" |
|
44 | hg commit -m "0.3m" | |
45 | hg debugindex .hg/store/data/afile.i |
|
45 | hg debugindex .hg/store/data/afile.i | |
46 | hg debugindex .hg/store/data/adifferentfile.i |
|
46 | hg debugindex .hg/store/data/adifferentfile.i | |
47 | hg debugindex .hg/store/data/anotherfile.i |
|
47 | hg debugindex .hg/store/data/anotherfile.i | |
48 | hg debugindex .hg/store/data/fred.i |
|
48 | hg debugindex .hg/store/data/fred.i | |
49 | hg debugindex .hg/store/00manifest.i |
|
49 | hg debugindex .hg/store/00manifest.i | |
50 | hg verify |
|
50 | hg verify | |
51 | echo "# Starting server" |
|
51 | echo "# Starting server" | |
52 |
hg serve -p |
|
52 | hg serve -p $HGPORT -d --pid-file=../hg1.pid | |
53 | cd .. |
|
53 | cd .. | |
54 | cat hg1.pid >> $DAEMON_PIDS |
|
54 | cat hg1.pid >> $DAEMON_PIDS | |
55 |
|
55 | |||
56 | echo "# clone remote via stream" |
|
56 | echo "# clone remote via stream" | |
57 | for i in 0 1 2 3 4 5 6 7 8; do |
|
57 | for i in 0 1 2 3 4 5 6 7 8; do | |
58 |
hg clone -r "$i" http://localhost: |
|
58 | hg clone -r "$i" http://localhost:$HGPORT/ test-"$i" 2>&1 | |
59 | if cd test-"$i"; then |
|
59 | if cd test-"$i"; then | |
60 | hg verify |
|
60 | hg verify | |
61 | cd .. |
|
61 | cd .. | |
62 | fi |
|
62 | fi | |
63 | done |
|
63 | done | |
64 | cd test-8 |
|
64 | cd test-8 | |
65 | hg pull ../test-7 |
|
65 | hg pull ../test-7 | |
66 | hg verify |
|
66 | hg verify | |
67 | cd .. |
|
67 | cd .. | |
68 | cd test-1 |
|
68 | cd test-1 | |
69 |
hg pull -r 4 http://localhost: |
|
69 | hg pull -r 4 http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,' | |
70 | hg verify |
|
70 | hg verify | |
71 | hg pull http://localhost:20061/ 2>&1 |
|
71 | hg pull http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,' | |
72 | cd .. |
|
72 | cd .. | |
73 | cd test-2 |
|
73 | cd test-2 | |
74 |
hg pull -r 5 http://localhost: |
|
74 | hg pull -r 5 http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,' | |
75 | hg verify |
|
75 | hg verify | |
76 | hg pull http://localhost:20061/ 2>&1 |
|
76 | hg pull http://localhost:$HGPORT/ 2>&1 | sed -e 's,:[0-9][0-9]*/,/,' | |
77 | hg verify |
|
77 | hg verify | |
78 | cd .. |
|
78 | cd .. |
@@ -1,183 +1,183 b'' | |||||
1 | # creating 'remote' |
|
1 | # creating 'remote' | |
2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
3 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
3 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
4 | rev offset length base linkrev nodeid p1 p2 |
|
4 | rev offset length base linkrev nodeid p1 p2 | |
5 | 0 0 3 0 0 362fef284ce2 000000000000 000000000000 |
|
5 | 0 0 3 0 0 362fef284ce2 000000000000 000000000000 | |
6 | 1 3 5 1 1 125144f7e028 362fef284ce2 000000000000 |
|
6 | 1 3 5 1 1 125144f7e028 362fef284ce2 000000000000 | |
7 | 2 8 7 2 2 4c982badb186 125144f7e028 000000000000 |
|
7 | 2 8 7 2 2 4c982badb186 125144f7e028 000000000000 | |
8 | 3 15 9 3 3 19b1fc555737 4c982badb186 000000000000 |
|
8 | 3 15 9 3 3 19b1fc555737 4c982badb186 000000000000 | |
9 | rev offset length base linkrev nodeid p1 p2 |
|
9 | rev offset length base linkrev nodeid p1 p2 | |
10 | 0 0 75 0 7 905359268f77 000000000000 000000000000 |
|
10 | 0 0 75 0 7 905359268f77 000000000000 000000000000 | |
11 | rev offset length base linkrev nodeid p1 p2 |
|
11 | rev offset length base linkrev nodeid p1 p2 | |
12 | 0 0 75 0 8 905359268f77 000000000000 000000000000 |
|
12 | 0 0 75 0 8 905359268f77 000000000000 000000000000 | |
13 | rev offset length base linkrev nodeid p1 p2 |
|
13 | rev offset length base linkrev nodeid p1 p2 | |
14 | 0 0 8 0 6 12ab3bcc5ea4 000000000000 000000000000 |
|
14 | 0 0 8 0 6 12ab3bcc5ea4 000000000000 000000000000 | |
15 | rev offset length base linkrev nodeid p1 p2 |
|
15 | rev offset length base linkrev nodeid p1 p2 | |
16 | 0 0 48 0 0 43eadb1d2d06 000000000000 000000000000 |
|
16 | 0 0 48 0 0 43eadb1d2d06 000000000000 000000000000 | |
17 | 1 48 48 1 1 8b89697eba2c 43eadb1d2d06 000000000000 |
|
17 | 1 48 48 1 1 8b89697eba2c 43eadb1d2d06 000000000000 | |
18 | 2 96 48 2 2 626a32663c2f 8b89697eba2c 000000000000 |
|
18 | 2 96 48 2 2 626a32663c2f 8b89697eba2c 000000000000 | |
19 | 3 144 48 3 3 f54c32f13478 626a32663c2f 000000000000 |
|
19 | 3 144 48 3 3 f54c32f13478 626a32663c2f 000000000000 | |
20 | 4 192 58 3 6 de68e904d169 626a32663c2f 000000000000 |
|
20 | 4 192 58 3 6 de68e904d169 626a32663c2f 000000000000 | |
21 | 5 250 68 3 7 3b45cc2ab868 de68e904d169 000000000000 |
|
21 | 5 250 68 3 7 3b45cc2ab868 de68e904d169 000000000000 | |
22 | 6 318 54 6 8 24d86153a002 f54c32f13478 000000000000 |
|
22 | 6 318 54 6 8 24d86153a002 f54c32f13478 000000000000 | |
23 | checking changesets |
|
23 | checking changesets | |
24 | checking manifests |
|
24 | checking manifests | |
25 | crosschecking files in changesets and manifests |
|
25 | crosschecking files in changesets and manifests | |
26 | checking files |
|
26 | checking files | |
27 | 4 files, 9 changesets, 7 total revisions |
|
27 | 4 files, 9 changesets, 7 total revisions | |
28 | # Starting server |
|
28 | # Starting server | |
29 | # clone remote via stream |
|
29 | # clone remote via stream | |
30 | requesting all changes |
|
30 | requesting all changes | |
31 | adding changesets |
|
31 | adding changesets | |
32 | adding manifests |
|
32 | adding manifests | |
33 | adding file changes |
|
33 | adding file changes | |
34 | added 1 changesets with 1 changes to 1 files |
|
34 | added 1 changesets with 1 changes to 1 files | |
35 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
35 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
36 | checking changesets |
|
36 | checking changesets | |
37 | checking manifests |
|
37 | checking manifests | |
38 | crosschecking files in changesets and manifests |
|
38 | crosschecking files in changesets and manifests | |
39 | checking files |
|
39 | checking files | |
40 | 1 files, 1 changesets, 1 total revisions |
|
40 | 1 files, 1 changesets, 1 total revisions | |
41 | requesting all changes |
|
41 | requesting all changes | |
42 | adding changesets |
|
42 | adding changesets | |
43 | adding manifests |
|
43 | adding manifests | |
44 | adding file changes |
|
44 | adding file changes | |
45 | added 2 changesets with 2 changes to 1 files |
|
45 | added 2 changesets with 2 changes to 1 files | |
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
46 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
47 | checking changesets |
|
47 | checking changesets | |
48 | checking manifests |
|
48 | checking manifests | |
49 | crosschecking files in changesets and manifests |
|
49 | crosschecking files in changesets and manifests | |
50 | checking files |
|
50 | checking files | |
51 | 1 files, 2 changesets, 2 total revisions |
|
51 | 1 files, 2 changesets, 2 total revisions | |
52 | requesting all changes |
|
52 | requesting all changes | |
53 | adding changesets |
|
53 | adding changesets | |
54 | adding manifests |
|
54 | adding manifests | |
55 | adding file changes |
|
55 | adding file changes | |
56 | added 3 changesets with 3 changes to 1 files |
|
56 | added 3 changesets with 3 changes to 1 files | |
57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 | checking changesets |
|
58 | checking changesets | |
59 | checking manifests |
|
59 | checking manifests | |
60 | crosschecking files in changesets and manifests |
|
60 | crosschecking files in changesets and manifests | |
61 | checking files |
|
61 | checking files | |
62 | 1 files, 3 changesets, 3 total revisions |
|
62 | 1 files, 3 changesets, 3 total revisions | |
63 | requesting all changes |
|
63 | requesting all changes | |
64 | adding changesets |
|
64 | adding changesets | |
65 | adding manifests |
|
65 | adding manifests | |
66 | adding file changes |
|
66 | adding file changes | |
67 | added 4 changesets with 4 changes to 1 files |
|
67 | added 4 changesets with 4 changes to 1 files | |
68 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
69 | checking changesets |
|
69 | checking changesets | |
70 | checking manifests |
|
70 | checking manifests | |
71 | crosschecking files in changesets and manifests |
|
71 | crosschecking files in changesets and manifests | |
72 | checking files |
|
72 | checking files | |
73 | 1 files, 4 changesets, 4 total revisions |
|
73 | 1 files, 4 changesets, 4 total revisions | |
74 | requesting all changes |
|
74 | requesting all changes | |
75 | adding changesets |
|
75 | adding changesets | |
76 | adding manifests |
|
76 | adding manifests | |
77 | adding file changes |
|
77 | adding file changes | |
78 | added 2 changesets with 2 changes to 1 files |
|
78 | added 2 changesets with 2 changes to 1 files | |
79 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
80 | checking changesets |
|
80 | checking changesets | |
81 | checking manifests |
|
81 | checking manifests | |
82 | crosschecking files in changesets and manifests |
|
82 | crosschecking files in changesets and manifests | |
83 | checking files |
|
83 | checking files | |
84 | 1 files, 2 changesets, 2 total revisions |
|
84 | 1 files, 2 changesets, 2 total revisions | |
85 | requesting all changes |
|
85 | requesting all changes | |
86 | adding changesets |
|
86 | adding changesets | |
87 | adding manifests |
|
87 | adding manifests | |
88 | adding file changes |
|
88 | adding file changes | |
89 | added 3 changesets with 3 changes to 1 files |
|
89 | added 3 changesets with 3 changes to 1 files | |
90 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
91 | checking changesets |
|
91 | checking changesets | |
92 | checking manifests |
|
92 | checking manifests | |
93 | crosschecking files in changesets and manifests |
|
93 | crosschecking files in changesets and manifests | |
94 | checking files |
|
94 | checking files | |
95 | 1 files, 3 changesets, 3 total revisions |
|
95 | 1 files, 3 changesets, 3 total revisions | |
96 | requesting all changes |
|
96 | requesting all changes | |
97 | adding changesets |
|
97 | adding changesets | |
98 | adding manifests |
|
98 | adding manifests | |
99 | adding file changes |
|
99 | adding file changes | |
100 | added 4 changesets with 5 changes to 2 files |
|
100 | added 4 changesets with 5 changes to 2 files | |
101 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
101 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
102 | checking changesets |
|
102 | checking changesets | |
103 | checking manifests |
|
103 | checking manifests | |
104 | crosschecking files in changesets and manifests |
|
104 | crosschecking files in changesets and manifests | |
105 | checking files |
|
105 | checking files | |
106 | 2 files, 4 changesets, 5 total revisions |
|
106 | 2 files, 4 changesets, 5 total revisions | |
107 | requesting all changes |
|
107 | requesting all changes | |
108 | adding changesets |
|
108 | adding changesets | |
109 | adding manifests |
|
109 | adding manifests | |
110 | adding file changes |
|
110 | adding file changes | |
111 | added 5 changesets with 6 changes to 3 files |
|
111 | added 5 changesets with 6 changes to 3 files | |
112 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
112 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
113 | checking changesets |
|
113 | checking changesets | |
114 | checking manifests |
|
114 | checking manifests | |
115 | crosschecking files in changesets and manifests |
|
115 | crosschecking files in changesets and manifests | |
116 | checking files |
|
116 | checking files | |
117 | 3 files, 5 changesets, 6 total revisions |
|
117 | 3 files, 5 changesets, 6 total revisions | |
118 | requesting all changes |
|
118 | requesting all changes | |
119 | adding changesets |
|
119 | adding changesets | |
120 | adding manifests |
|
120 | adding manifests | |
121 | adding file changes |
|
121 | adding file changes | |
122 | added 5 changesets with 5 changes to 2 files |
|
122 | added 5 changesets with 5 changes to 2 files | |
123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
124 | checking changesets |
|
124 | checking changesets | |
125 | checking manifests |
|
125 | checking manifests | |
126 | crosschecking files in changesets and manifests |
|
126 | crosschecking files in changesets and manifests | |
127 | checking files |
|
127 | checking files | |
128 | 2 files, 5 changesets, 5 total revisions |
|
128 | 2 files, 5 changesets, 5 total revisions | |
129 | pulling from ../test-7 |
|
129 | pulling from ../test-7 | |
130 | searching for changes |
|
130 | searching for changes | |
131 | adding changesets |
|
131 | adding changesets | |
132 | adding manifests |
|
132 | adding manifests | |
133 | adding file changes |
|
133 | adding file changes | |
134 | added 4 changesets with 2 changes to 3 files (+1 heads) |
|
134 | added 4 changesets with 2 changes to 3 files (+1 heads) | |
135 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
135 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
136 | checking changesets |
|
136 | checking changesets | |
137 | checking manifests |
|
137 | checking manifests | |
138 | crosschecking files in changesets and manifests |
|
138 | crosschecking files in changesets and manifests | |
139 | checking files |
|
139 | checking files | |
140 | 4 files, 9 changesets, 7 total revisions |
|
140 | 4 files, 9 changesets, 7 total revisions | |
141 |
pulling from http://localhost |
|
141 | pulling from http://localhost/ | |
142 | searching for changes |
|
142 | searching for changes | |
143 | adding changesets |
|
143 | adding changesets | |
144 | adding manifests |
|
144 | adding manifests | |
145 | adding file changes |
|
145 | adding file changes | |
146 | added 1 changesets with 0 changes to 1 files (+1 heads) |
|
146 | added 1 changesets with 0 changes to 1 files (+1 heads) | |
147 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
147 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
148 | checking changesets |
|
148 | checking changesets | |
149 | checking manifests |
|
149 | checking manifests | |
150 | crosschecking files in changesets and manifests |
|
150 | crosschecking files in changesets and manifests | |
151 | checking files |
|
151 | checking files | |
152 | 1 files, 3 changesets, 2 total revisions |
|
152 | 1 files, 3 changesets, 2 total revisions | |
153 |
pulling from http://localhost |
|
153 | pulling from http://localhost/ | |
154 | searching for changes |
|
154 | searching for changes | |
155 | adding changesets |
|
155 | adding changesets | |
156 | adding manifests |
|
156 | adding manifests | |
157 | adding file changes |
|
157 | adding file changes | |
158 | added 6 changesets with 5 changes to 4 files |
|
158 | added 6 changesets with 5 changes to 4 files | |
159 | (run 'hg update' to get a working copy) |
|
159 | (run 'hg update' to get a working copy) | |
160 |
pulling from http://localhost |
|
160 | pulling from http://localhost/ | |
161 | searching for changes |
|
161 | searching for changes | |
162 | adding changesets |
|
162 | adding changesets | |
163 | adding manifests |
|
163 | adding manifests | |
164 | adding file changes |
|
164 | adding file changes | |
165 | added 2 changesets with 0 changes to 1 files (+1 heads) |
|
165 | added 2 changesets with 0 changes to 1 files (+1 heads) | |
166 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
166 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
167 | checking changesets |
|
167 | checking changesets | |
168 | checking manifests |
|
168 | checking manifests | |
169 | crosschecking files in changesets and manifests |
|
169 | crosschecking files in changesets and manifests | |
170 | checking files |
|
170 | checking files | |
171 | 1 files, 5 changesets, 3 total revisions |
|
171 | 1 files, 5 changesets, 3 total revisions | |
172 |
pulling from http://localhost |
|
172 | pulling from http://localhost/ | |
173 | searching for changes |
|
173 | searching for changes | |
174 | adding changesets |
|
174 | adding changesets | |
175 | adding manifests |
|
175 | adding manifests | |
176 | adding file changes |
|
176 | adding file changes | |
177 | added 4 changesets with 4 changes to 4 files |
|
177 | added 4 changesets with 4 changes to 4 files | |
178 | (run 'hg update' to get a working copy) |
|
178 | (run 'hg update' to get a working copy) | |
179 | checking changesets |
|
179 | checking changesets | |
180 | checking manifests |
|
180 | checking manifests | |
181 | crosschecking files in changesets and manifests |
|
181 | crosschecking files in changesets and manifests | |
182 | checking files |
|
182 | checking files | |
183 | 4 files, 9 changesets, 7 total revisions |
|
183 | 4 files, 9 changesets, 7 total revisions |
@@ -1,41 +1,41 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hg init a |
|
3 | hg init a | |
4 | cd a |
|
4 | cd a | |
5 | echo a > a |
|
5 | echo a > a | |
6 | hg ci -Ama -d '1123456789 0' |
|
6 | hg ci -Ama -d '1123456789 0' | |
7 |
hg --config server.uncompressed=True serve -p |
|
7 | hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid | |
8 | cat hg.pid >> $DAEMON_PIDS |
|
8 | cat hg.pid >> $DAEMON_PIDS | |
9 |
|
9 | |||
10 | cd .. |
|
10 | cd .. | |
11 |
("$TESTDIR/tinyproxy.py" |
|
11 | ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null & | |
12 | echo $! > proxy.pid) |
|
12 | echo $! > proxy.pid) | |
13 | cat proxy.pid >> $DAEMON_PIDS |
|
13 | cat proxy.pid >> $DAEMON_PIDS | |
14 | sleep 2 |
|
14 | sleep 2 | |
15 |
|
15 | |||
16 | echo %% url for proxy, stream |
|
16 | echo %% url for proxy, stream | |
17 |
http_proxy=http://localhost: |
|
17 | http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --uncompressed http://localhost:$HGPORT/ b | \ | |
18 | sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/' |
|
18 | sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/' | |
19 | cd b |
|
19 | cd b | |
20 | hg verify |
|
20 | hg verify | |
21 | cd .. |
|
21 | cd .. | |
22 |
|
22 | |||
23 | echo %% url for proxy, pull |
|
23 | echo %% url for proxy, pull | |
24 |
http_proxy=http://localhost: |
|
24 | http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull | |
25 | cd b-pull |
|
25 | cd b-pull | |
26 | hg verify |
|
26 | hg verify | |
27 | cd .. |
|
27 | cd .. | |
28 |
|
28 | |||
29 | echo %% host:port for proxy |
|
29 | echo %% host:port for proxy | |
30 |
http_proxy=localhost: |
|
30 | http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c | |
31 |
|
31 | |||
32 | echo %% proxy url with user name and password |
|
32 | echo %% proxy url with user name and password | |
33 |
http_proxy=http://user:passwd@localhost: |
|
33 | http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d | |
34 |
|
34 | |||
35 | echo %% url with user name and password |
|
35 | echo %% url with user name and password | |
36 |
http_proxy=http://user:passwd@localhost: |
|
36 | http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e | |
37 |
|
37 | |||
38 | echo %% bad host:port for proxy |
|
38 | echo %% bad host:port for proxy | |
39 |
http_proxy=localhost:2 |
|
39 | http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f | |
40 |
|
40 | |||
41 | exit 0 |
|
41 | exit 0 |
@@ -1,41 +1,41 b'' | |||||
1 | adding foo |
|
1 | adding foo | |
2 | abort: cannot start server: |
|
2 | abort: cannot start server: | |
3 | % clone via stream |
|
3 | % clone via stream | |
4 | streaming all changes |
|
4 | streaming all changes | |
5 | XXX files to transfer, XXX bytes of data |
|
5 | XXX files to transfer, XXX bytes of data | |
6 | transferred XXX bytes in XXX seconds (XXX XB/sec) |
|
6 | transferred XXX bytes in XXX seconds (XXX XB/sec) | |
7 | XXX files updated, XXX files merged, XXX files removed, XXX files unresolved |
|
7 | XXX files updated, XXX files merged, XXX files removed, XXX files unresolved | |
8 | checking changesets |
|
8 | checking changesets | |
9 | checking manifests |
|
9 | checking manifests | |
10 | crosschecking files in changesets and manifests |
|
10 | crosschecking files in changesets and manifests | |
11 | checking files |
|
11 | checking files | |
12 | 1 files, 1 changesets, 1 total revisions |
|
12 | 1 files, 1 changesets, 1 total revisions | |
13 | % try to clone via stream, should use pull instead |
|
13 | % try to clone via stream, should use pull instead | |
14 | requesting all changes |
|
14 | requesting all changes | |
15 | adding changesets |
|
15 | adding changesets | |
16 | adding manifests |
|
16 | adding manifests | |
17 | adding file changes |
|
17 | adding file changes | |
18 | added 1 changesets with 1 changes to 1 files |
|
18 | added 1 changesets with 1 changes to 1 files | |
19 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
19 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
20 | % clone via pull |
|
20 | % clone via pull | |
21 | requesting all changes |
|
21 | requesting all changes | |
22 | adding changesets |
|
22 | adding changesets | |
23 | adding manifests |
|
23 | adding manifests | |
24 | adding file changes |
|
24 | adding file changes | |
25 | added 1 changesets with 1 changes to 1 files |
|
25 | added 1 changesets with 1 changes to 1 files | |
26 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
26 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
27 | checking changesets |
|
27 | checking changesets | |
28 | checking manifests |
|
28 | checking manifests | |
29 | crosschecking files in changesets and manifests |
|
29 | crosschecking files in changesets and manifests | |
30 | checking files |
|
30 | checking files | |
31 | 1 files, 1 changesets, 1 total revisions |
|
31 | 1 files, 1 changesets, 1 total revisions | |
32 | adding bar |
|
32 | adding bar | |
33 | % pull |
|
33 | % pull | |
34 |
changegroup hook: HG_NODE=cfbd11a1fa315300a080c3de8fe36b0fc5820acf HG_SOURCE=pull HG_URL=http://localhost |
|
34 | changegroup hook: HG_NODE=cfbd11a1fa315300a080c3de8fe36b0fc5820acf HG_SOURCE=pull HG_URL=http://localhost/ | |
35 |
pulling from http://localhost |
|
35 | pulling from http://localhost/ | |
36 | searching for changes |
|
36 | searching for changes | |
37 | adding changesets |
|
37 | adding changesets | |
38 | adding manifests |
|
38 | adding manifests | |
39 | adding file changes |
|
39 | adding file changes | |
40 | added 1 changesets with 1 changes to 1 files |
|
40 | added 1 changesets with 1 changes to 1 files | |
41 | (run 'hg update' to get a working copy) |
|
41 | (run 'hg update' to get a working copy) |
@@ -1,48 +1,48 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | mkdir test |
|
3 | mkdir test | |
4 | cd test |
|
4 | cd test | |
5 | hg init |
|
5 | hg init | |
6 | for i in 0 1 2 3 4 5 6 7 8; do |
|
6 | for i in 0 1 2 3 4 5 6 7 8; do | |
7 | echo $i >> foo |
|
7 | echo $i >> foo | |
8 | hg commit -A -m $i -d "1000000 0" |
|
8 | hg commit -A -m $i -d "1000000 0" | |
9 | done |
|
9 | done | |
10 | hg verify |
|
10 | hg verify | |
11 |
hg serve -p |
|
11 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
12 | cat hg.pid >> $DAEMON_PIDS |
|
12 | cat hg.pid >> $DAEMON_PIDS | |
13 | cd .. |
|
13 | cd .. | |
14 |
|
14 | |||
15 | hg init new |
|
15 | hg init new | |
16 | # http incoming |
|
16 | # http incoming | |
17 |
http_proxy= hg -R new incoming http://localhost: |
|
17 | http_proxy= hg -R new incoming http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' | |
18 |
http_proxy= hg -R new incoming -r 4 http://localhost: |
|
18 | http_proxy= hg -R new incoming -r 4 http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' | |
19 | # local incoming |
|
19 | # local incoming | |
20 | hg -R new incoming test |
|
20 | hg -R new incoming test | |
21 | hg -R new incoming -r 4 test |
|
21 | hg -R new incoming -r 4 test | |
22 |
|
22 | |||
23 | # test with --bundle |
|
23 | # test with --bundle | |
24 |
http_proxy= hg -R new incoming --bundle test.hg http://localhost: |
|
24 | http_proxy= hg -R new incoming --bundle test.hg http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' | |
25 | hg -R new incoming --bundle test2.hg test |
|
25 | hg -R new incoming --bundle test2.hg test | |
26 |
|
26 | |||
27 | # test the resulting bundles |
|
27 | # test the resulting bundles | |
28 | hg init temp |
|
28 | hg init temp | |
29 | hg init temp2 |
|
29 | hg init temp2 | |
30 | hg -R temp unbundle test.hg |
|
30 | hg -R temp unbundle test.hg | |
31 | hg -R temp2 unbundle test2.hg |
|
31 | hg -R temp2 unbundle test2.hg | |
32 | hg -R temp tip |
|
32 | hg -R temp tip | |
33 | hg -R temp2 tip |
|
33 | hg -R temp2 tip | |
34 |
|
34 | |||
35 | rm -r temp temp2 new |
|
35 | rm -r temp temp2 new | |
36 |
|
36 | |||
37 | # test outgoing |
|
37 | # test outgoing | |
38 | hg clone test test-dev |
|
38 | hg clone test test-dev | |
39 | cd test-dev |
|
39 | cd test-dev | |
40 | for i in 9 10 11 12 13; do |
|
40 | for i in 9 10 11 12 13; do | |
41 | echo $i >> foo |
|
41 | echo $i >> foo | |
42 | hg commit -A -m $i -d "1000000 0" |
|
42 | hg commit -A -m $i -d "1000000 0" | |
43 | done |
|
43 | done | |
44 | hg verify |
|
44 | hg verify | |
45 | cd .. |
|
45 | cd .. | |
46 | hg -R test-dev outgoing test |
|
46 | hg -R test-dev outgoing test | |
47 |
http_proxy= hg -R test-dev outgoing http://localhost: |
|
47 | http_proxy= hg -R test-dev outgoing http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' | |
48 |
http_proxy= hg -R test-dev outgoing -r 11 http://localhost: |
|
48 | http_proxy= hg -R test-dev outgoing -r 11 http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' |
@@ -1,348 +1,348 b'' | |||||
1 | adding foo |
|
1 | adding foo | |
2 | checking changesets |
|
2 | checking changesets | |
3 | checking manifests |
|
3 | checking manifests | |
4 | crosschecking files in changesets and manifests |
|
4 | crosschecking files in changesets and manifests | |
5 | checking files |
|
5 | checking files | |
6 | 1 files, 9 changesets, 9 total revisions |
|
6 | 1 files, 9 changesets, 9 total revisions | |
7 |
comparing with http://localhost |
|
7 | comparing with http://localhost/ | |
8 | changeset: 0:9cb21d99fe27 |
|
8 | changeset: 0:9cb21d99fe27 | |
9 | user: test |
|
9 | user: test | |
10 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
10 | date: Mon Jan 12 13:46:40 1970 +0000 | |
11 | summary: 0 |
|
11 | summary: 0 | |
12 |
|
12 | |||
13 | changeset: 1:d717f5dfad6a |
|
13 | changeset: 1:d717f5dfad6a | |
14 | user: test |
|
14 | user: test | |
15 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
15 | date: Mon Jan 12 13:46:40 1970 +0000 | |
16 | summary: 1 |
|
16 | summary: 1 | |
17 |
|
17 | |||
18 | changeset: 2:c0d6b86da426 |
|
18 | changeset: 2:c0d6b86da426 | |
19 | user: test |
|
19 | user: test | |
20 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
20 | date: Mon Jan 12 13:46:40 1970 +0000 | |
21 | summary: 2 |
|
21 | summary: 2 | |
22 |
|
22 | |||
23 | changeset: 3:dfacbd43b3fe |
|
23 | changeset: 3:dfacbd43b3fe | |
24 | user: test |
|
24 | user: test | |
25 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
25 | date: Mon Jan 12 13:46:40 1970 +0000 | |
26 | summary: 3 |
|
26 | summary: 3 | |
27 |
|
27 | |||
28 | changeset: 4:1f3a964b6022 |
|
28 | changeset: 4:1f3a964b6022 | |
29 | user: test |
|
29 | user: test | |
30 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
30 | date: Mon Jan 12 13:46:40 1970 +0000 | |
31 | summary: 4 |
|
31 | summary: 4 | |
32 |
|
32 | |||
33 | changeset: 5:c028bcc7a28a |
|
33 | changeset: 5:c028bcc7a28a | |
34 | user: test |
|
34 | user: test | |
35 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
35 | date: Mon Jan 12 13:46:40 1970 +0000 | |
36 | summary: 5 |
|
36 | summary: 5 | |
37 |
|
37 | |||
38 | changeset: 6:a0c0095f3389 |
|
38 | changeset: 6:a0c0095f3389 | |
39 | user: test |
|
39 | user: test | |
40 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
40 | date: Mon Jan 12 13:46:40 1970 +0000 | |
41 | summary: 6 |
|
41 | summary: 6 | |
42 |
|
42 | |||
43 | changeset: 7:d4be65f4e891 |
|
43 | changeset: 7:d4be65f4e891 | |
44 | user: test |
|
44 | user: test | |
45 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
45 | date: Mon Jan 12 13:46:40 1970 +0000 | |
46 | summary: 7 |
|
46 | summary: 7 | |
47 |
|
47 | |||
48 | changeset: 8:92b83e334ef8 |
|
48 | changeset: 8:92b83e334ef8 | |
49 | tag: tip |
|
49 | tag: tip | |
50 | user: test |
|
50 | user: test | |
51 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
51 | date: Mon Jan 12 13:46:40 1970 +0000 | |
52 | summary: 8 |
|
52 | summary: 8 | |
53 |
|
53 | |||
54 |
comparing with http://localhost |
|
54 | comparing with http://localhost/ | |
55 | changeset: 0:9cb21d99fe27 |
|
55 | changeset: 0:9cb21d99fe27 | |
56 | user: test |
|
56 | user: test | |
57 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
57 | date: Mon Jan 12 13:46:40 1970 +0000 | |
58 | summary: 0 |
|
58 | summary: 0 | |
59 |
|
59 | |||
60 | changeset: 1:d717f5dfad6a |
|
60 | changeset: 1:d717f5dfad6a | |
61 | user: test |
|
61 | user: test | |
62 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
62 | date: Mon Jan 12 13:46:40 1970 +0000 | |
63 | summary: 1 |
|
63 | summary: 1 | |
64 |
|
64 | |||
65 | changeset: 2:c0d6b86da426 |
|
65 | changeset: 2:c0d6b86da426 | |
66 | user: test |
|
66 | user: test | |
67 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
67 | date: Mon Jan 12 13:46:40 1970 +0000 | |
68 | summary: 2 |
|
68 | summary: 2 | |
69 |
|
69 | |||
70 | changeset: 3:dfacbd43b3fe |
|
70 | changeset: 3:dfacbd43b3fe | |
71 | user: test |
|
71 | user: test | |
72 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
72 | date: Mon Jan 12 13:46:40 1970 +0000 | |
73 | summary: 3 |
|
73 | summary: 3 | |
74 |
|
74 | |||
75 | changeset: 4:1f3a964b6022 |
|
75 | changeset: 4:1f3a964b6022 | |
76 | tag: tip |
|
76 | tag: tip | |
77 | user: test |
|
77 | user: test | |
78 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
78 | date: Mon Jan 12 13:46:40 1970 +0000 | |
79 | summary: 4 |
|
79 | summary: 4 | |
80 |
|
80 | |||
81 | comparing with test |
|
81 | comparing with test | |
82 | changeset: 0:9cb21d99fe27 |
|
82 | changeset: 0:9cb21d99fe27 | |
83 | user: test |
|
83 | user: test | |
84 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
84 | date: Mon Jan 12 13:46:40 1970 +0000 | |
85 | summary: 0 |
|
85 | summary: 0 | |
86 |
|
86 | |||
87 | changeset: 1:d717f5dfad6a |
|
87 | changeset: 1:d717f5dfad6a | |
88 | user: test |
|
88 | user: test | |
89 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
89 | date: Mon Jan 12 13:46:40 1970 +0000 | |
90 | summary: 1 |
|
90 | summary: 1 | |
91 |
|
91 | |||
92 | changeset: 2:c0d6b86da426 |
|
92 | changeset: 2:c0d6b86da426 | |
93 | user: test |
|
93 | user: test | |
94 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
94 | date: Mon Jan 12 13:46:40 1970 +0000 | |
95 | summary: 2 |
|
95 | summary: 2 | |
96 |
|
96 | |||
97 | changeset: 3:dfacbd43b3fe |
|
97 | changeset: 3:dfacbd43b3fe | |
98 | user: test |
|
98 | user: test | |
99 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
99 | date: Mon Jan 12 13:46:40 1970 +0000 | |
100 | summary: 3 |
|
100 | summary: 3 | |
101 |
|
101 | |||
102 | changeset: 4:1f3a964b6022 |
|
102 | changeset: 4:1f3a964b6022 | |
103 | user: test |
|
103 | user: test | |
104 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
104 | date: Mon Jan 12 13:46:40 1970 +0000 | |
105 | summary: 4 |
|
105 | summary: 4 | |
106 |
|
106 | |||
107 | changeset: 5:c028bcc7a28a |
|
107 | changeset: 5:c028bcc7a28a | |
108 | user: test |
|
108 | user: test | |
109 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
109 | date: Mon Jan 12 13:46:40 1970 +0000 | |
110 | summary: 5 |
|
110 | summary: 5 | |
111 |
|
111 | |||
112 | changeset: 6:a0c0095f3389 |
|
112 | changeset: 6:a0c0095f3389 | |
113 | user: test |
|
113 | user: test | |
114 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
114 | date: Mon Jan 12 13:46:40 1970 +0000 | |
115 | summary: 6 |
|
115 | summary: 6 | |
116 |
|
116 | |||
117 | changeset: 7:d4be65f4e891 |
|
117 | changeset: 7:d4be65f4e891 | |
118 | user: test |
|
118 | user: test | |
119 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
119 | date: Mon Jan 12 13:46:40 1970 +0000 | |
120 | summary: 7 |
|
120 | summary: 7 | |
121 |
|
121 | |||
122 | changeset: 8:92b83e334ef8 |
|
122 | changeset: 8:92b83e334ef8 | |
123 | tag: tip |
|
123 | tag: tip | |
124 | user: test |
|
124 | user: test | |
125 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
125 | date: Mon Jan 12 13:46:40 1970 +0000 | |
126 | summary: 8 |
|
126 | summary: 8 | |
127 |
|
127 | |||
128 | comparing with test |
|
128 | comparing with test | |
129 | changeset: 0:9cb21d99fe27 |
|
129 | changeset: 0:9cb21d99fe27 | |
130 | user: test |
|
130 | user: test | |
131 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
131 | date: Mon Jan 12 13:46:40 1970 +0000 | |
132 | summary: 0 |
|
132 | summary: 0 | |
133 |
|
133 | |||
134 | changeset: 1:d717f5dfad6a |
|
134 | changeset: 1:d717f5dfad6a | |
135 | user: test |
|
135 | user: test | |
136 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
136 | date: Mon Jan 12 13:46:40 1970 +0000 | |
137 | summary: 1 |
|
137 | summary: 1 | |
138 |
|
138 | |||
139 | changeset: 2:c0d6b86da426 |
|
139 | changeset: 2:c0d6b86da426 | |
140 | user: test |
|
140 | user: test | |
141 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
141 | date: Mon Jan 12 13:46:40 1970 +0000 | |
142 | summary: 2 |
|
142 | summary: 2 | |
143 |
|
143 | |||
144 | changeset: 3:dfacbd43b3fe |
|
144 | changeset: 3:dfacbd43b3fe | |
145 | user: test |
|
145 | user: test | |
146 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
146 | date: Mon Jan 12 13:46:40 1970 +0000 | |
147 | summary: 3 |
|
147 | summary: 3 | |
148 |
|
148 | |||
149 | changeset: 4:1f3a964b6022 |
|
149 | changeset: 4:1f3a964b6022 | |
150 | user: test |
|
150 | user: test | |
151 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
151 | date: Mon Jan 12 13:46:40 1970 +0000 | |
152 | summary: 4 |
|
152 | summary: 4 | |
153 |
|
153 | |||
154 |
comparing with http://localhost |
|
154 | comparing with http://localhost/ | |
155 | changeset: 0:9cb21d99fe27 |
|
155 | changeset: 0:9cb21d99fe27 | |
156 | user: test |
|
156 | user: test | |
157 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
157 | date: Mon Jan 12 13:46:40 1970 +0000 | |
158 | summary: 0 |
|
158 | summary: 0 | |
159 |
|
159 | |||
160 | changeset: 1:d717f5dfad6a |
|
160 | changeset: 1:d717f5dfad6a | |
161 | user: test |
|
161 | user: test | |
162 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
162 | date: Mon Jan 12 13:46:40 1970 +0000 | |
163 | summary: 1 |
|
163 | summary: 1 | |
164 |
|
164 | |||
165 | changeset: 2:c0d6b86da426 |
|
165 | changeset: 2:c0d6b86da426 | |
166 | user: test |
|
166 | user: test | |
167 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
167 | date: Mon Jan 12 13:46:40 1970 +0000 | |
168 | summary: 2 |
|
168 | summary: 2 | |
169 |
|
169 | |||
170 | changeset: 3:dfacbd43b3fe |
|
170 | changeset: 3:dfacbd43b3fe | |
171 | user: test |
|
171 | user: test | |
172 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
172 | date: Mon Jan 12 13:46:40 1970 +0000 | |
173 | summary: 3 |
|
173 | summary: 3 | |
174 |
|
174 | |||
175 | changeset: 4:1f3a964b6022 |
|
175 | changeset: 4:1f3a964b6022 | |
176 | user: test |
|
176 | user: test | |
177 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
177 | date: Mon Jan 12 13:46:40 1970 +0000 | |
178 | summary: 4 |
|
178 | summary: 4 | |
179 |
|
179 | |||
180 | changeset: 5:c028bcc7a28a |
|
180 | changeset: 5:c028bcc7a28a | |
181 | user: test |
|
181 | user: test | |
182 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
182 | date: Mon Jan 12 13:46:40 1970 +0000 | |
183 | summary: 5 |
|
183 | summary: 5 | |
184 |
|
184 | |||
185 | changeset: 6:a0c0095f3389 |
|
185 | changeset: 6:a0c0095f3389 | |
186 | user: test |
|
186 | user: test | |
187 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
187 | date: Mon Jan 12 13:46:40 1970 +0000 | |
188 | summary: 6 |
|
188 | summary: 6 | |
189 |
|
189 | |||
190 | changeset: 7:d4be65f4e891 |
|
190 | changeset: 7:d4be65f4e891 | |
191 | user: test |
|
191 | user: test | |
192 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
192 | date: Mon Jan 12 13:46:40 1970 +0000 | |
193 | summary: 7 |
|
193 | summary: 7 | |
194 |
|
194 | |||
195 | changeset: 8:92b83e334ef8 |
|
195 | changeset: 8:92b83e334ef8 | |
196 | tag: tip |
|
196 | tag: tip | |
197 | user: test |
|
197 | user: test | |
198 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
198 | date: Mon Jan 12 13:46:40 1970 +0000 | |
199 | summary: 8 |
|
199 | summary: 8 | |
200 |
|
200 | |||
201 | comparing with test |
|
201 | comparing with test | |
202 | changeset: 0:9cb21d99fe27 |
|
202 | changeset: 0:9cb21d99fe27 | |
203 | user: test |
|
203 | user: test | |
204 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
204 | date: Mon Jan 12 13:46:40 1970 +0000 | |
205 | summary: 0 |
|
205 | summary: 0 | |
206 |
|
206 | |||
207 | changeset: 1:d717f5dfad6a |
|
207 | changeset: 1:d717f5dfad6a | |
208 | user: test |
|
208 | user: test | |
209 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
209 | date: Mon Jan 12 13:46:40 1970 +0000 | |
210 | summary: 1 |
|
210 | summary: 1 | |
211 |
|
211 | |||
212 | changeset: 2:c0d6b86da426 |
|
212 | changeset: 2:c0d6b86da426 | |
213 | user: test |
|
213 | user: test | |
214 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
214 | date: Mon Jan 12 13:46:40 1970 +0000 | |
215 | summary: 2 |
|
215 | summary: 2 | |
216 |
|
216 | |||
217 | changeset: 3:dfacbd43b3fe |
|
217 | changeset: 3:dfacbd43b3fe | |
218 | user: test |
|
218 | user: test | |
219 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
219 | date: Mon Jan 12 13:46:40 1970 +0000 | |
220 | summary: 3 |
|
220 | summary: 3 | |
221 |
|
221 | |||
222 | changeset: 4:1f3a964b6022 |
|
222 | changeset: 4:1f3a964b6022 | |
223 | user: test |
|
223 | user: test | |
224 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
224 | date: Mon Jan 12 13:46:40 1970 +0000 | |
225 | summary: 4 |
|
225 | summary: 4 | |
226 |
|
226 | |||
227 | changeset: 5:c028bcc7a28a |
|
227 | changeset: 5:c028bcc7a28a | |
228 | user: test |
|
228 | user: test | |
229 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
229 | date: Mon Jan 12 13:46:40 1970 +0000 | |
230 | summary: 5 |
|
230 | summary: 5 | |
231 |
|
231 | |||
232 | changeset: 6:a0c0095f3389 |
|
232 | changeset: 6:a0c0095f3389 | |
233 | user: test |
|
233 | user: test | |
234 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
234 | date: Mon Jan 12 13:46:40 1970 +0000 | |
235 | summary: 6 |
|
235 | summary: 6 | |
236 |
|
236 | |||
237 | changeset: 7:d4be65f4e891 |
|
237 | changeset: 7:d4be65f4e891 | |
238 | user: test |
|
238 | user: test | |
239 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
239 | date: Mon Jan 12 13:46:40 1970 +0000 | |
240 | summary: 7 |
|
240 | summary: 7 | |
241 |
|
241 | |||
242 | changeset: 8:92b83e334ef8 |
|
242 | changeset: 8:92b83e334ef8 | |
243 | tag: tip |
|
243 | tag: tip | |
244 | user: test |
|
244 | user: test | |
245 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
245 | date: Mon Jan 12 13:46:40 1970 +0000 | |
246 | summary: 8 |
|
246 | summary: 8 | |
247 |
|
247 | |||
248 | adding changesets |
|
248 | adding changesets | |
249 | adding manifests |
|
249 | adding manifests | |
250 | adding file changes |
|
250 | adding file changes | |
251 | added 9 changesets with 9 changes to 1 files |
|
251 | added 9 changesets with 9 changes to 1 files | |
252 | (run 'hg update' to get a working copy) |
|
252 | (run 'hg update' to get a working copy) | |
253 | adding changesets |
|
253 | adding changesets | |
254 | adding manifests |
|
254 | adding manifests | |
255 | adding file changes |
|
255 | adding file changes | |
256 | added 9 changesets with 9 changes to 1 files |
|
256 | added 9 changesets with 9 changes to 1 files | |
257 | (run 'hg update' to get a working copy) |
|
257 | (run 'hg update' to get a working copy) | |
258 | changeset: 8:92b83e334ef8 |
|
258 | changeset: 8:92b83e334ef8 | |
259 | tag: tip |
|
259 | tag: tip | |
260 | user: test |
|
260 | user: test | |
261 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
261 | date: Mon Jan 12 13:46:40 1970 +0000 | |
262 | summary: 8 |
|
262 | summary: 8 | |
263 |
|
263 | |||
264 | changeset: 8:92b83e334ef8 |
|
264 | changeset: 8:92b83e334ef8 | |
265 | tag: tip |
|
265 | tag: tip | |
266 | user: test |
|
266 | user: test | |
267 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
267 | date: Mon Jan 12 13:46:40 1970 +0000 | |
268 | summary: 8 |
|
268 | summary: 8 | |
269 |
|
269 | |||
270 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
270 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
271 | checking changesets |
|
271 | checking changesets | |
272 | checking manifests |
|
272 | checking manifests | |
273 | crosschecking files in changesets and manifests |
|
273 | crosschecking files in changesets and manifests | |
274 | checking files |
|
274 | checking files | |
275 | 1 files, 14 changesets, 14 total revisions |
|
275 | 1 files, 14 changesets, 14 total revisions | |
276 | comparing with test |
|
276 | comparing with test | |
277 | searching for changes |
|
277 | searching for changes | |
278 | changeset: 9:3741c3ad1096 |
|
278 | changeset: 9:3741c3ad1096 | |
279 | user: test |
|
279 | user: test | |
280 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
280 | date: Mon Jan 12 13:46:40 1970 +0000 | |
281 | summary: 9 |
|
281 | summary: 9 | |
282 |
|
282 | |||
283 | changeset: 10:de4143c8d9a5 |
|
283 | changeset: 10:de4143c8d9a5 | |
284 | user: test |
|
284 | user: test | |
285 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
285 | date: Mon Jan 12 13:46:40 1970 +0000 | |
286 | summary: 10 |
|
286 | summary: 10 | |
287 |
|
287 | |||
288 | changeset: 11:0e1c188b9a7a |
|
288 | changeset: 11:0e1c188b9a7a | |
289 | user: test |
|
289 | user: test | |
290 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
290 | date: Mon Jan 12 13:46:40 1970 +0000 | |
291 | summary: 11 |
|
291 | summary: 11 | |
292 |
|
292 | |||
293 | changeset: 12:251354d0fdd3 |
|
293 | changeset: 12:251354d0fdd3 | |
294 | user: test |
|
294 | user: test | |
295 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
295 | date: Mon Jan 12 13:46:40 1970 +0000 | |
296 | summary: 12 |
|
296 | summary: 12 | |
297 |
|
297 | |||
298 | changeset: 13:bdaadd969642 |
|
298 | changeset: 13:bdaadd969642 | |
299 | tag: tip |
|
299 | tag: tip | |
300 | user: test |
|
300 | user: test | |
301 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
301 | date: Mon Jan 12 13:46:40 1970 +0000 | |
302 | summary: 13 |
|
302 | summary: 13 | |
303 |
|
303 | |||
304 |
comparing with http://localhost |
|
304 | comparing with http://localhost/ | |
305 | searching for changes |
|
305 | searching for changes | |
306 | changeset: 9:3741c3ad1096 |
|
306 | changeset: 9:3741c3ad1096 | |
307 | user: test |
|
307 | user: test | |
308 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
308 | date: Mon Jan 12 13:46:40 1970 +0000 | |
309 | summary: 9 |
|
309 | summary: 9 | |
310 |
|
310 | |||
311 | changeset: 10:de4143c8d9a5 |
|
311 | changeset: 10:de4143c8d9a5 | |
312 | user: test |
|
312 | user: test | |
313 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
313 | date: Mon Jan 12 13:46:40 1970 +0000 | |
314 | summary: 10 |
|
314 | summary: 10 | |
315 |
|
315 | |||
316 | changeset: 11:0e1c188b9a7a |
|
316 | changeset: 11:0e1c188b9a7a | |
317 | user: test |
|
317 | user: test | |
318 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
318 | date: Mon Jan 12 13:46:40 1970 +0000 | |
319 | summary: 11 |
|
319 | summary: 11 | |
320 |
|
320 | |||
321 | changeset: 12:251354d0fdd3 |
|
321 | changeset: 12:251354d0fdd3 | |
322 | user: test |
|
322 | user: test | |
323 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
323 | date: Mon Jan 12 13:46:40 1970 +0000 | |
324 | summary: 12 |
|
324 | summary: 12 | |
325 |
|
325 | |||
326 | changeset: 13:bdaadd969642 |
|
326 | changeset: 13:bdaadd969642 | |
327 | tag: tip |
|
327 | tag: tip | |
328 | user: test |
|
328 | user: test | |
329 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
329 | date: Mon Jan 12 13:46:40 1970 +0000 | |
330 | summary: 13 |
|
330 | summary: 13 | |
331 |
|
331 | |||
332 |
comparing with http://localhost |
|
332 | comparing with http://localhost/ | |
333 | searching for changes |
|
333 | searching for changes | |
334 | changeset: 9:3741c3ad1096 |
|
334 | changeset: 9:3741c3ad1096 | |
335 | user: test |
|
335 | user: test | |
336 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
336 | date: Mon Jan 12 13:46:40 1970 +0000 | |
337 | summary: 9 |
|
337 | summary: 9 | |
338 |
|
338 | |||
339 | changeset: 10:de4143c8d9a5 |
|
339 | changeset: 10:de4143c8d9a5 | |
340 | user: test |
|
340 | user: test | |
341 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
341 | date: Mon Jan 12 13:46:40 1970 +0000 | |
342 | summary: 10 |
|
342 | summary: 10 | |
343 |
|
343 | |||
344 | changeset: 11:0e1c188b9a7a |
|
344 | changeset: 11:0e1c188b9a7a | |
345 | user: test |
|
345 | user: test | |
346 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
346 | date: Mon Jan 12 13:46:40 1970 +0000 | |
347 | summary: 11 |
|
347 | summary: 11 | |
348 |
|
348 |
@@ -1,70 +1,70 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | mkdir repo |
|
3 | mkdir repo | |
4 | cd repo |
|
4 | cd repo | |
5 | hg init |
|
5 | hg init | |
6 | echo foo > bar |
|
6 | echo foo > bar | |
7 | hg add bar |
|
7 | hg add bar | |
8 | hg commit -m "test" -d "0 0" |
|
8 | hg commit -m "test" -d "0 0" | |
9 | hg tip |
|
9 | hg tip | |
10 |
|
10 | |||
11 | cat > request.py <<EOF |
|
11 | cat > request.py <<EOF | |
12 | from mercurial import dispatch |
|
12 | from mercurial import dispatch | |
13 | from mercurial.hgweb.hgweb_mod import hgweb |
|
13 | from mercurial.hgweb.hgweb_mod import hgweb | |
14 | from mercurial.hgweb.request import _wsgirequest |
|
14 | from mercurial.hgweb.request import _wsgirequest | |
15 | from mercurial.ui import ui |
|
15 | from mercurial.ui import ui | |
16 | from mercurial import hg |
|
16 | from mercurial import hg | |
17 | from StringIO import StringIO |
|
17 | from StringIO import StringIO | |
18 | import sys |
|
18 | import os, sys | |
19 |
|
19 | |||
20 | class FileLike(object): |
|
20 | class FileLike(object): | |
21 | def __init__(self, real): |
|
21 | def __init__(self, real): | |
22 | self.real = real |
|
22 | self.real = real | |
23 | def fileno(self): |
|
23 | def fileno(self): | |
24 | print >> sys.__stdout__, 'FILENO' |
|
24 | print >> sys.__stdout__, 'FILENO' | |
25 | return self.real.fileno() |
|
25 | return self.real.fileno() | |
26 | def read(self): |
|
26 | def read(self): | |
27 | print >> sys.__stdout__, 'READ' |
|
27 | print >> sys.__stdout__, 'READ' | |
28 | return self.real.read() |
|
28 | return self.real.read() | |
29 | def readline(self): |
|
29 | def readline(self): | |
30 | print >> sys.__stdout__, 'READLINE' |
|
30 | print >> sys.__stdout__, 'READLINE' | |
31 | return self.real.readline() |
|
31 | return self.real.readline() | |
32 | def isatty(self): |
|
32 | def isatty(self): | |
33 | print >> sys.__stdout__, 'ISATTY' |
|
33 | print >> sys.__stdout__, 'ISATTY' | |
34 | return False |
|
34 | return False | |
35 |
|
35 | |||
36 | sys.stdin = FileLike(sys.stdin) |
|
36 | sys.stdin = FileLike(sys.stdin) | |
37 | errors = StringIO() |
|
37 | errors = StringIO() | |
38 | input = StringIO() |
|
38 | input = StringIO() | |
39 | output = StringIO() |
|
39 | output = StringIO() | |
40 |
|
40 | |||
41 | def startrsp(headers, data): |
|
41 | def startrsp(headers, data): | |
42 | print '---- HEADERS' |
|
42 | print '---- HEADERS' | |
43 | print headers |
|
43 | print headers | |
44 | print '---- DATA' |
|
44 | print '---- DATA' | |
45 | print data |
|
45 | print data | |
46 | return output.write |
|
46 | return output.write | |
47 |
|
47 | |||
48 | env = { |
|
48 | env = { | |
49 | 'wsgi.version': (1, 0), |
|
49 | 'wsgi.version': (1, 0), | |
50 | 'wsgi.url_scheme': 'http', |
|
50 | 'wsgi.url_scheme': 'http', | |
51 | 'wsgi.errors': errors, |
|
51 | 'wsgi.errors': errors, | |
52 | 'wsgi.input': input, |
|
52 | 'wsgi.input': input, | |
53 | 'wsgi.multithread': False, |
|
53 | 'wsgi.multithread': False, | |
54 | 'wsgi.multiprocess': False, |
|
54 | 'wsgi.multiprocess': False, | |
55 | 'wsgi.run_once': False, |
|
55 | 'wsgi.run_once': False, | |
56 | 'REQUEST_METHOD': 'GET', |
|
56 | 'REQUEST_METHOD': 'GET', | |
57 | 'SCRIPT_NAME': '', |
|
57 | 'SCRIPT_NAME': '', | |
58 | 'PATH_INFO': '', |
|
58 | 'PATH_INFO': '', | |
59 | 'QUERY_STRING': '', |
|
59 | 'QUERY_STRING': '', | |
60 | 'SERVER_NAME': '127.0.0.1', |
|
60 | 'SERVER_NAME': '127.0.0.1', | |
61 |
'SERVER_PORT': |
|
61 | 'SERVER_PORT': os.environ['HGPORT'], | |
62 | 'SERVER_PROTOCOL': 'HTTP/1.0' |
|
62 | 'SERVER_PROTOCOL': 'HTTP/1.0' | |
63 | } |
|
63 | } | |
64 |
|
64 | |||
65 | _wsgirequest(hgweb('.'), env, startrsp) |
|
65 | _wsgirequest(hgweb('.'), env, startrsp) | |
66 | print '---- ERRORS' |
|
66 | print '---- ERRORS' | |
67 | print errors.getvalue() |
|
67 | print errors.getvalue() | |
68 | EOF |
|
68 | EOF | |
69 |
|
69 | |||
70 | python request.py |
|
70 | python request.py |
@@ -1,26 +1,26 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | mkdir test |
|
3 | mkdir test | |
4 | cd test |
|
4 | cd test | |
5 | echo foo>foo |
|
5 | echo foo>foo | |
6 | hg init |
|
6 | hg init | |
7 | hg addremove |
|
7 | hg addremove | |
8 | hg commit -m 1 |
|
8 | hg commit -m 1 | |
9 | hg verify |
|
9 | hg verify | |
10 |
hg serve -p |
|
10 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
11 | cat hg.pid >> $DAEMON_PIDS |
|
11 | cat hg.pid >> $DAEMON_PIDS | |
12 | cd .. |
|
12 | cd .. | |
13 |
|
13 | |||
14 |
http_proxy= hg clone --pull http://localhost: |
|
14 | http_proxy= hg clone --pull http://localhost:$HGPORT/ copy | sed -e 's,:[0-9][0-9]*/,/,' | |
15 | cd copy |
|
15 | cd copy | |
16 | hg verify |
|
16 | hg verify | |
17 | hg co |
|
17 | hg co | |
18 | cat foo |
|
18 | cat foo | |
19 | hg manifest --debug |
|
19 | hg manifest --debug | |
20 | hg pull |
|
20 | hg pull | sed -e 's,:[0-9][0-9]*/,/,' | |
21 |
|
21 | |||
22 | echo % issue 622 |
|
22 | echo % issue 622 | |
23 | cd .. |
|
23 | cd .. | |
24 | hg init empty |
|
24 | hg init empty | |
25 | cd empty |
|
25 | cd empty | |
26 | hg pull -u ../test |
|
26 | hg pull -u ../test |
@@ -1,31 +1,31 b'' | |||||
1 | adding foo |
|
1 | adding foo | |
2 | checking changesets |
|
2 | checking changesets | |
3 | checking manifests |
|
3 | checking manifests | |
4 | crosschecking files in changesets and manifests |
|
4 | crosschecking files in changesets and manifests | |
5 | checking files |
|
5 | checking files | |
6 | 1 files, 1 changesets, 1 total revisions |
|
6 | 1 files, 1 changesets, 1 total revisions | |
7 | requesting all changes |
|
7 | requesting all changes | |
8 | adding changesets |
|
8 | adding changesets | |
9 | adding manifests |
|
9 | adding manifests | |
10 | adding file changes |
|
10 | adding file changes | |
11 | added 1 changesets with 1 changes to 1 files |
|
11 | added 1 changesets with 1 changes to 1 files | |
12 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
12 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
13 | checking changesets |
|
13 | checking changesets | |
14 | checking manifests |
|
14 | checking manifests | |
15 | crosschecking files in changesets and manifests |
|
15 | crosschecking files in changesets and manifests | |
16 | checking files |
|
16 | checking files | |
17 | 1 files, 1 changesets, 1 total revisions |
|
17 | 1 files, 1 changesets, 1 total revisions | |
18 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
18 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
19 | foo |
|
19 | foo | |
20 | 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo |
|
20 | 2ed2a3912a0b24502043eae84ee4b279c18b90dd 644 foo | |
21 |
pulling from http://localhost |
|
21 | pulling from http://localhost/ | |
22 | searching for changes |
|
22 | searching for changes | |
23 | no changes found |
|
23 | no changes found | |
24 | % issue 622 |
|
24 | % issue 622 | |
25 | pulling from ../test |
|
25 | pulling from ../test | |
26 | requesting all changes |
|
26 | requesting all changes | |
27 | adding changesets |
|
27 | adding changesets | |
28 | adding manifests |
|
28 | adding manifests | |
29 | adding file changes |
|
29 | adding file changes | |
30 | added 1 changesets with 1 changes to 1 files |
|
30 | added 1 changesets with 1 changes to 1 files | |
31 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
31 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
@@ -1,65 +1,65 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | cp "$TESTDIR"/printenv.py . |
|
3 | cp "$TESTDIR"/printenv.py . | |
4 |
|
4 | |||
5 | hg init test |
|
5 | hg init test | |
6 | cd test |
|
6 | cd test | |
7 | echo a > a |
|
7 | echo a > a | |
8 | hg ci -Ama -d '0 0' |
|
8 | hg ci -Ama -d '0 0' | |
9 |
|
9 | |||
10 | cd .. |
|
10 | cd .. | |
11 | hg clone test test2 |
|
11 | hg clone test test2 | |
12 | cd test2 |
|
12 | cd test2 | |
13 | echo a >> a |
|
13 | echo a >> a | |
14 | hg ci -mb -d '0 0' |
|
14 | hg ci -mb -d '0 0' | |
15 |
|
15 | |||
16 | cd ../test |
|
16 | cd ../test | |
17 |
|
17 | |||
18 | echo % expect ssl error |
|
18 | echo % expect ssl error | |
19 |
hg serve -p |
|
19 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
20 | cat hg.pid >> $DAEMON_PIDS |
|
20 | cat hg.pid >> $DAEMON_PIDS | |
21 |
hg --cwd ../test2 push http://localhost: |
|
21 | hg --cwd ../test2 push http://localhost:$HGPORT/ | |
22 | kill `cat hg.pid` |
|
22 | kill `cat hg.pid` | |
23 |
|
23 | |||
24 | echo % expect authorization error |
|
24 | echo % expect authorization error | |
25 | echo '[web]' > .hg/hgrc |
|
25 | echo '[web]' > .hg/hgrc | |
26 | echo 'push_ssl = false' >> .hg/hgrc |
|
26 | echo 'push_ssl = false' >> .hg/hgrc | |
27 |
hg serve -p |
|
27 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
28 | cat hg.pid >> $DAEMON_PIDS |
|
28 | cat hg.pid >> $DAEMON_PIDS | |
29 |
hg --cwd ../test2 push http://localhost: |
|
29 | hg --cwd ../test2 push http://localhost:$HGPORT/ | |
30 | kill `cat hg.pid` |
|
30 | kill `cat hg.pid` | |
31 |
|
31 | |||
32 | echo % expect authorization error: must have authorized user |
|
32 | echo % expect authorization error: must have authorized user | |
33 | echo 'allow_push = unperson' >> .hg/hgrc |
|
33 | echo 'allow_push = unperson' >> .hg/hgrc | |
34 |
hg serve -p |
|
34 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
35 | cat hg.pid >> $DAEMON_PIDS |
|
35 | cat hg.pid >> $DAEMON_PIDS | |
36 |
hg --cwd ../test2 push http://localhost: |
|
36 | hg --cwd ../test2 push http://localhost:$HGPORT/ | |
37 | kill `cat hg.pid` |
|
37 | kill `cat hg.pid` | |
38 |
|
38 | |||
39 | echo % expect success |
|
39 | echo % expect success | |
40 | echo 'allow_push = *' >> .hg/hgrc |
|
40 | echo 'allow_push = *' >> .hg/hgrc | |
41 | echo '[hooks]' >> .hg/hgrc |
|
41 | echo '[hooks]' >> .hg/hgrc | |
42 | echo 'changegroup = python ../printenv.py changegroup 0 ../urls' >> .hg/hgrc |
|
42 | echo 'changegroup = python ../printenv.py changegroup 0 ../urls' >> .hg/hgrc | |
43 |
hg serve -p |
|
43 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
44 | cat hg.pid >> $DAEMON_PIDS |
|
44 | cat hg.pid >> $DAEMON_PIDS | |
45 |
hg --cwd ../test2 push http://localhost: |
|
45 | hg --cwd ../test2 push http://localhost:$HGPORT/ | |
46 | kill `cat hg.pid` |
|
46 | kill `cat hg.pid` | |
47 | hg rollback |
|
47 | hg rollback | |
48 |
|
48 | |||
49 | cat ../urls |
|
49 | cat ../urls | |
50 |
|
50 | |||
51 | echo % expect authorization error: all users denied |
|
51 | echo % expect authorization error: all users denied | |
52 | echo '[web]' > .hg/hgrc |
|
52 | echo '[web]' > .hg/hgrc | |
53 | echo 'push_ssl = false' >> .hg/hgrc |
|
53 | echo 'push_ssl = false' >> .hg/hgrc | |
54 | echo 'deny_push = *' >> .hg/hgrc |
|
54 | echo 'deny_push = *' >> .hg/hgrc | |
55 |
hg serve -p |
|
55 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
56 | cat hg.pid >> $DAEMON_PIDS |
|
56 | cat hg.pid >> $DAEMON_PIDS | |
57 |
hg --cwd ../test2 push http://localhost: |
|
57 | hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' | |
58 | kill `cat hg.pid` |
|
58 | kill `cat hg.pid` | |
59 |
|
59 | |||
60 | echo % expect authorization error: some users denied, users must be authenticated |
|
60 | echo % expect authorization error: some users denied, users must be authenticated | |
61 | echo 'deny_push = unperson' >> .hg/hgrc |
|
61 | echo 'deny_push = unperson' >> .hg/hgrc | |
62 |
hg serve -p |
|
62 | hg serve -p $HGPORT -d --pid-file=hg.pid | |
63 | cat hg.pid >> $DAEMON_PIDS |
|
63 | cat hg.pid >> $DAEMON_PIDS | |
64 |
hg --cwd ../test2 push http://localhost: |
|
64 | hg --cwd ../test2 push http://localhost:$HGPORT/ | sed -e 's,:[0-9][0-9]*/,/,' | |
65 | kill `cat hg.pid` |
|
65 | kill `cat hg.pid` |
@@ -1,31 +1,31 b'' | |||||
1 | adding a |
|
1 | adding a | |
2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
3 | % expect ssl error |
|
3 | % expect ssl error | |
4 |
pushing to http://localhost:2 |
|
4 | pushing to http://localhost:23451/ | |
5 | searching for changes |
|
5 | searching for changes | |
6 | ssl required |
|
6 | ssl required | |
7 | % expect authorization error |
|
7 | % expect authorization error | |
8 |
pushing to http://localhost:2 |
|
8 | pushing to http://localhost:23451/ | |
9 | searching for changes |
|
9 | searching for changes | |
10 | push not authorized |
|
10 | push not authorized | |
11 | % expect authorization error: must have authorized user |
|
11 | % expect authorization error: must have authorized user | |
12 |
pushing to http://localhost:2 |
|
12 | pushing to http://localhost:23451/ | |
13 | searching for changes |
|
13 | searching for changes | |
14 | push not authorized |
|
14 | push not authorized | |
15 | % expect success |
|
15 | % expect success | |
16 |
pushing to http://localhost:2 |
|
16 | pushing to http://localhost:23451/ | |
17 | searching for changes |
|
17 | searching for changes | |
18 | adding changesets |
|
18 | adding changesets | |
19 | adding manifests |
|
19 | adding manifests | |
20 | adding file changes |
|
20 | adding file changes | |
21 | added 1 changesets with 1 changes to 1 files |
|
21 | added 1 changesets with 1 changes to 1 files | |
22 | rolling back last transaction |
|
22 | rolling back last transaction | |
23 | changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http |
|
23 | changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http | |
24 | % expect authorization error: all users denied |
|
24 | % expect authorization error: all users denied | |
25 |
pushing to http://localhost |
|
25 | pushing to http://localhost/ | |
26 | searching for changes |
|
26 | searching for changes | |
27 | push not authorized |
|
27 | push not authorized | |
28 | % expect authorization error: some users denied, users must be authenticated |
|
28 | % expect authorization error: some users denied, users must be authenticated | |
29 |
pushing to http://localhost |
|
29 | pushing to http://localhost/ | |
30 | searching for changes |
|
30 | searching for changes | |
31 | push not authorized |
|
31 | push not authorized |
@@ -1,18 +1,18 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hg init test |
|
3 | hg init test | |
4 | cd test |
|
4 | cd test | |
5 |
|
5 | |||
6 | echo '[web]' > .hg/hgrc |
|
6 | echo '[web]' > .hg/hgrc | |
7 | echo 'accesslog = access.log' >> .hg/hgrc |
|
7 | echo 'accesslog = access.log' >> .hg/hgrc | |
8 |
|
8 | |||
9 | echo % Without -v |
|
9 | echo % Without -v | |
10 |
hg serve -a localhost -p |
|
10 | hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid | |
11 | cat hg.pid >> "$DAEMON_PIDS" |
|
11 | cat hg.pid >> "$DAEMON_PIDS" | |
12 | if [ -f access.log ]; then |
|
12 | if [ -f access.log ]; then | |
13 | echo 'access log created - .hg/hgrc respected' |
|
13 | echo 'access log created - .hg/hgrc respected' | |
14 | fi |
|
14 | fi | |
15 |
|
15 | |||
16 | echo % With -v |
|
16 | echo % With -v | |
17 |
hg serve -a localhost -p |
|
17 | hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid -v | sed -e 's,:[0-9][0-9]*/,/,' | |
18 | cat hg.pid >> "$DAEMON_PIDS" |
|
18 | cat hg.pid >> "$DAEMON_PIDS" |
@@ -1,4 +1,4 b'' | |||||
1 | % Without -v |
|
1 | % Without -v | |
2 | access log created - .hg/hgrc respected |
|
2 | access log created - .hg/hgrc respected | |
3 | % With -v |
|
3 | % With -v | |
4 |
listening at http://localhost |
|
4 | listening at http://localhost/ |
@@ -1,66 +1,66 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | cp "$TESTDIR"/printenv.py . |
|
3 | cp "$TESTDIR"/printenv.py . | |
4 |
|
4 | |||
5 |
http_proxy= hg clone static-http://localhost: |
|
5 | http_proxy= hg clone static-http://localhost:$HGPORT/ copy | |
6 | echo $? |
|
6 | echo $? | |
7 | test -d copy || echo copy: No such file or directory |
|
7 | test -d copy || echo copy: No such file or directory | |
8 |
|
8 | |||
9 | # This server doesn't do range requests so it's basically only good for |
|
9 | # This server doesn't do range requests so it's basically only good for | |
10 | # one pull |
|
10 | # one pull | |
11 | cat > dumb.py <<EOF |
|
11 | cat > dumb.py <<EOF | |
12 | import BaseHTTPServer, SimpleHTTPServer, signal |
|
12 | import BaseHTTPServer, SimpleHTTPServer, os, signal | |
13 |
|
13 | |||
14 | def run(server_class=BaseHTTPServer.HTTPServer, |
|
14 | def run(server_class=BaseHTTPServer.HTTPServer, | |
15 | handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): |
|
15 | handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): | |
16 |
server_address = ('localhost', |
|
16 | server_address = ('localhost', int(os.environ['HGPORT'])) | |
17 | httpd = server_class(server_address, handler_class) |
|
17 | httpd = server_class(server_address, handler_class) | |
18 | httpd.serve_forever() |
|
18 | httpd.serve_forever() | |
19 |
|
19 | |||
20 | signal.signal(signal.SIGTERM, lambda x: sys.exit(0)) |
|
20 | signal.signal(signal.SIGTERM, lambda x: sys.exit(0)) | |
21 | run() |
|
21 | run() | |
22 | EOF |
|
22 | EOF | |
23 |
|
23 | |||
24 | python dumb.py 2>/dev/null & |
|
24 | python dumb.py 2>/dev/null & | |
25 | echo $! >> $DAEMON_PIDS |
|
25 | echo $! >> $DAEMON_PIDS | |
26 |
|
26 | |||
27 | mkdir remote |
|
27 | mkdir remote | |
28 | cd remote |
|
28 | cd remote | |
29 | hg init |
|
29 | hg init | |
30 | echo foo > bar |
|
30 | echo foo > bar | |
31 | hg add bar |
|
31 | hg add bar | |
32 | hg commit -m"test" -d "1000000 0" |
|
32 | hg commit -m"test" -d "1000000 0" | |
33 | hg tip |
|
33 | hg tip | |
34 |
|
34 | |||
35 | cd .. |
|
35 | cd .. | |
36 |
|
36 | |||
37 |
http_proxy= hg clone static-http://localhost: |
|
37 | http_proxy= hg clone static-http://localhost:$HGPORT/remote local | sed -e 's,:[0-9][0-9]*/,/,' | |
38 |
|
38 | |||
39 | cd local |
|
39 | cd local | |
40 | hg verify |
|
40 | hg verify | |
41 | cat bar |
|
41 | cat bar | |
42 |
|
42 | |||
43 | cd ../remote |
|
43 | cd ../remote | |
44 | echo baz > quux |
|
44 | echo baz > quux | |
45 | hg commit -A -mtest2 -d '100000000 0' |
|
45 | hg commit -A -mtest2 -d '100000000 0' | |
46 |
|
46 | |||
47 | cd ../local |
|
47 | cd ../local | |
48 | echo '[hooks]' >> .hg/hgrc |
|
48 | echo '[hooks]' >> .hg/hgrc | |
49 | echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc |
|
49 | echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc | |
50 | http_proxy= hg pull |
|
50 | http_proxy= hg pull | sed -e 's,:[0-9][0-9]*/,/,' | |
51 |
|
51 | |||
52 | echo '% test with "/" URI (issue 747)' |
|
52 | echo '% test with "/" URI (issue 747)' | |
53 | cd .. |
|
53 | cd .. | |
54 | hg init |
|
54 | hg init | |
55 | echo a > a |
|
55 | echo a > a | |
56 | hg add a |
|
56 | hg add a | |
57 | hg ci -ma |
|
57 | hg ci -ma | |
58 |
|
58 | |||
59 |
http_proxy= hg clone static-http://localhost: |
|
59 | http_proxy= hg clone static-http://localhost:$HGPORT/ local2 | sed -e 's,:[0-9][0-9]*/,/,' | |
60 |
|
60 | |||
61 | cd local2 |
|
61 | cd local2 | |
62 | hg verify |
|
62 | hg verify | |
63 | cat a |
|
63 | cat a | |
64 | hg paths |
|
64 | hg paths | sed -e 's,:[0-9][0-9]*/,/,' | |
65 |
|
65 | |||
66 | kill $! |
|
66 | kill $! |
@@ -1,44 +1,44 b'' | |||||
1 | abort: Connection refused |
|
1 | abort: Connection refused | |
2 | 255 |
|
2 | 255 | |
3 | copy: No such file or directory |
|
3 | copy: No such file or directory | |
4 | changeset: 0:53e17d176ae6 |
|
4 | changeset: 0:53e17d176ae6 | |
5 | tag: tip |
|
5 | tag: tip | |
6 | user: test |
|
6 | user: test | |
7 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
7 | date: Mon Jan 12 13:46:40 1970 +0000 | |
8 | summary: test |
|
8 | summary: test | |
9 |
|
9 | |||
10 | requesting all changes |
|
10 | requesting all changes | |
11 | adding changesets |
|
11 | adding changesets | |
12 | adding manifests |
|
12 | adding manifests | |
13 | adding file changes |
|
13 | adding file changes | |
14 | added 1 changesets with 1 changes to 1 files |
|
14 | added 1 changesets with 1 changes to 1 files | |
15 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
15 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
16 | checking changesets |
|
16 | checking changesets | |
17 | checking manifests |
|
17 | checking manifests | |
18 | crosschecking files in changesets and manifests |
|
18 | crosschecking files in changesets and manifests | |
19 | checking files |
|
19 | checking files | |
20 | 1 files, 1 changesets, 1 total revisions |
|
20 | 1 files, 1 changesets, 1 total revisions | |
21 | foo |
|
21 | foo | |
22 | adding quux |
|
22 | adding quux | |
23 |
changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=static-http://localhost |
|
23 | changegroup hook: HG_NODE=34401e0e9971e9720b613d9089ffa9a6eefb3d2d HG_SOURCE=pull HG_URL=static-http://localhost/remote | |
24 |
pulling from static-http://localhost |
|
24 | pulling from static-http://localhost/remote | |
25 | searching for changes |
|
25 | searching for changes | |
26 | adding changesets |
|
26 | adding changesets | |
27 | adding manifests |
|
27 | adding manifests | |
28 | adding file changes |
|
28 | adding file changes | |
29 | added 1 changesets with 1 changes to 1 files |
|
29 | added 1 changesets with 1 changes to 1 files | |
30 | (run 'hg update' to get a working copy) |
|
30 | (run 'hg update' to get a working copy) | |
31 | % test with "/" URI (issue 747) |
|
31 | % test with "/" URI (issue 747) | |
32 | requesting all changes |
|
32 | requesting all changes | |
33 | adding changesets |
|
33 | adding changesets | |
34 | adding manifests |
|
34 | adding manifests | |
35 | adding file changes |
|
35 | adding file changes | |
36 | added 1 changesets with 1 changes to 1 files |
|
36 | added 1 changesets with 1 changes to 1 files | |
37 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
37 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
38 | checking changesets |
|
38 | checking changesets | |
39 | checking manifests |
|
39 | checking manifests | |
40 | crosschecking files in changesets and manifests |
|
40 | crosschecking files in changesets and manifests | |
41 | checking files |
|
41 | checking files | |
42 | 1 files, 1 changesets, 1 total revisions |
|
42 | 1 files, 1 changesets, 1 total revisions | |
43 | a |
|
43 | a | |
44 |
default = static-http://localhost |
|
44 | default = static-http://localhost/ |
@@ -1,98 +1,98 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | cat <<EOF >> $HGRCPATH |
|
3 | cat <<EOF >> $HGRCPATH | |
4 | [extensions] |
|
4 | [extensions] | |
5 | transplant= |
|
5 | transplant= | |
6 | EOF |
|
6 | EOF | |
7 |
|
7 | |||
8 | hg init t |
|
8 | hg init t | |
9 | cd t |
|
9 | cd t | |
10 | echo r1 > r1 |
|
10 | echo r1 > r1 | |
11 | hg ci -Amr1 -d'0 0' |
|
11 | hg ci -Amr1 -d'0 0' | |
12 | echo r2 > r2 |
|
12 | echo r2 > r2 | |
13 | hg ci -Amr2 -d'1 0' |
|
13 | hg ci -Amr2 -d'1 0' | |
14 | hg up 0 |
|
14 | hg up 0 | |
15 |
|
15 | |||
16 | echo b1 > b1 |
|
16 | echo b1 > b1 | |
17 | hg ci -Amb1 -d '0 0' |
|
17 | hg ci -Amb1 -d '0 0' | |
18 | echo b2 > b2 |
|
18 | echo b2 > b2 | |
19 | hg ci -Amb2 -d '1 0' |
|
19 | hg ci -Amb2 -d '1 0' | |
20 | echo b3 > b3 |
|
20 | echo b3 > b3 | |
21 | hg ci -Amb3 -d '2 0' |
|
21 | hg ci -Amb3 -d '2 0' | |
22 |
|
22 | |||
23 | hg log --template '{rev} {parents} {desc}\n' |
|
23 | hg log --template '{rev} {parents} {desc}\n' | |
24 |
|
24 | |||
25 | hg clone . ../rebase |
|
25 | hg clone . ../rebase | |
26 | cd ../rebase |
|
26 | cd ../rebase | |
27 |
|
27 | |||
28 | hg up -C 1 |
|
28 | hg up -C 1 | |
29 | echo '% rebase b onto r1' |
|
29 | echo '% rebase b onto r1' | |
30 | hg transplant -a -b tip |
|
30 | hg transplant -a -b tip | |
31 | hg log --template '{rev} {parents} {desc}\n' |
|
31 | hg log --template '{rev} {parents} {desc}\n' | |
32 |
|
32 | |||
33 | hg clone ../t ../prune |
|
33 | hg clone ../t ../prune | |
34 | cd ../prune |
|
34 | cd ../prune | |
35 |
|
35 | |||
36 | hg up -C 1 |
|
36 | hg up -C 1 | |
37 | echo '% rebase b onto r1, skipping b2' |
|
37 | echo '% rebase b onto r1, skipping b2' | |
38 | hg transplant -a -b tip -p 3 |
|
38 | hg transplant -a -b tip -p 3 | |
39 | hg log --template '{rev} {parents} {desc}\n' |
|
39 | hg log --template '{rev} {parents} {desc}\n' | |
40 |
|
40 | |||
41 | echo '% remote transplant' |
|
41 | echo '% remote transplant' | |
42 | hg clone -r 1 ../t ../remote |
|
42 | hg clone -r 1 ../t ../remote | |
43 | cd ../remote |
|
43 | cd ../remote | |
44 | hg transplant --log -s ../t 2 4 |
|
44 | hg transplant --log -s ../t 2 4 | |
45 | hg log --template '{rev} {parents} {desc}\n' |
|
45 | hg log --template '{rev} {parents} {desc}\n' | |
46 |
|
46 | |||
47 | echo '% skip previous transplants' |
|
47 | echo '% skip previous transplants' | |
48 | hg transplant -s ../t -a -b 4 |
|
48 | hg transplant -s ../t -a -b 4 | |
49 | hg log --template '{rev} {parents} {desc}\n' |
|
49 | hg log --template '{rev} {parents} {desc}\n' | |
50 |
|
50 | |||
51 | echo '% skip local changes transplanted to the source' |
|
51 | echo '% skip local changes transplanted to the source' | |
52 | echo b4 > b4 |
|
52 | echo b4 > b4 | |
53 | hg ci -Amb4 -d '3 0' |
|
53 | hg ci -Amb4 -d '3 0' | |
54 | hg clone ../t ../pullback |
|
54 | hg clone ../t ../pullback | |
55 | cd ../pullback |
|
55 | cd ../pullback | |
56 | hg transplant -s ../remote -a -b tip |
|
56 | hg transplant -s ../remote -a -b tip | |
57 |
|
57 | |||
58 | echo '% remote transplant with pull' |
|
58 | echo '% remote transplant with pull' | |
59 |
hg -R ../t serve -p |
|
59 | hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid | |
60 | cat ../t.pid >> $DAEMON_PIDS |
|
60 | cat ../t.pid >> $DAEMON_PIDS | |
61 |
|
61 | |||
62 | hg clone -r 0 ../t ../rp |
|
62 | hg clone -r 0 ../t ../rp | |
63 | cd ../rp |
|
63 | cd ../rp | |
64 |
hg transplant -s http://localhost: |
|
64 | hg transplant -s http://localhost:$HGPORT/ 2 4 | |
65 | hg log --template '{rev} {parents} {desc}\n' |
|
65 | hg log --template '{rev} {parents} {desc}\n' | |
66 |
|
66 | |||
67 | echo '% transplant --continue' |
|
67 | echo '% transplant --continue' | |
68 | hg init ../tc |
|
68 | hg init ../tc | |
69 | cd ../tc |
|
69 | cd ../tc | |
70 | cat <<EOF > foo |
|
70 | cat <<EOF > foo | |
71 | foo |
|
71 | foo | |
72 | bar |
|
72 | bar | |
73 | baz |
|
73 | baz | |
74 | EOF |
|
74 | EOF | |
75 | echo toremove > toremove |
|
75 | echo toremove > toremove | |
76 | hg ci -Amfoo -d '0 0' |
|
76 | hg ci -Amfoo -d '0 0' | |
77 | cat <<EOF > foo |
|
77 | cat <<EOF > foo | |
78 | foo2 |
|
78 | foo2 | |
79 | bar2 |
|
79 | bar2 | |
80 | baz2 |
|
80 | baz2 | |
81 | EOF |
|
81 | EOF | |
82 | rm toremove |
|
82 | rm toremove | |
83 | echo added > added |
|
83 | echo added > added | |
84 | hg ci -Amfoo2 -d '0 0' |
|
84 | hg ci -Amfoo2 -d '0 0' | |
85 | echo bar > bar |
|
85 | echo bar > bar | |
86 | hg ci -Ambar -d '0 0' |
|
86 | hg ci -Ambar -d '0 0' | |
87 | echo bar2 >> bar |
|
87 | echo bar2 >> bar | |
88 | hg ci -mbar2 -d '0 0' |
|
88 | hg ci -mbar2 -d '0 0' | |
89 | hg up 0 |
|
89 | hg up 0 | |
90 | echo foobar > foo |
|
90 | echo foobar > foo | |
91 | hg ci -mfoobar -d '0 0' |
|
91 | hg ci -mfoobar -d '0 0' | |
92 | hg transplant 1:3 |
|
92 | hg transplant 1:3 | |
93 | # transplant -c shouldn't use an old changeset |
|
93 | # transplant -c shouldn't use an old changeset | |
94 | hg up -C |
|
94 | hg up -C | |
95 | hg transplant 1 |
|
95 | hg transplant 1 | |
96 | hg transplant --continue |
|
96 | hg transplant --continue | |
97 | hg transplant 1:3 |
|
97 | hg transplant 1:3 | |
98 | hg locate |
|
98 | hg locate |
@@ -1,22 +1,22 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | hg init test |
|
3 | hg init test | |
4 | cd test |
|
4 | cd test | |
5 | cat >sometext.txt <<ENDSOME |
|
5 | cat >sometext.txt <<ENDSOME | |
6 | This is just some random text |
|
6 | This is just some random text | |
7 | that will go inside the file and take a few lines. |
|
7 | that will go inside the file and take a few lines. | |
8 | It is very boring to read, but computers don't |
|
8 | It is very boring to read, but computers don't | |
9 | care about things like that. |
|
9 | care about things like that. | |
10 | ENDSOME |
|
10 | ENDSOME | |
11 | hg add sometext.txt |
|
11 | hg add sometext.txt | |
12 | hg commit -d "1 0" -m "Just some text" |
|
12 | hg commit -d "1 0" -m "Just some text" | |
13 |
hg serve -p |
|
13 | hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid | |
14 | cat hg.pid >> $DAEMON_PIDS |
|
14 | cat hg.pid >> $DAEMON_PIDS | |
15 |
("$TESTDIR/get-with-headers.py" localhost: |
|
15 | ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=f165dc289438;file=sometext.txt;style=raw' content-type content-length content-disposition) >getoutput.txt & | |
16 |
|
16 | |||
17 | sleep 5 |
|
17 | sleep 5 | |
18 | kill `cat hg.pid` |
|
18 | kill `cat hg.pid` | |
19 | sleep 1 # wait for server to scream and die |
|
19 | sleep 1 # wait for server to scream and die | |
20 | cat getoutput.txt |
|
20 | cat getoutput.txt | |
21 | cat access.log error.log | \ |
|
21 | cat access.log error.log | \ | |
22 | sed 's/^[^ ]*\( [^[]*\[\)[^]]*\(\].*\)$/host\1date\2/' |
|
22 | sed 's/^[^ ]*\( [^[]*\[\)[^]]*\(\].*\)$/host\1date\2/' |
General Comments 0
You need to be logged in to leave comments.
Login now