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