# HG changeset patch # User Christian Ebert # Date 1340283855 -3600 # Node ID df702ad9b3148ad2d370027035f632f07e9045e2 # Parent 9459951761fbe2c7c1e618d1595a206be09babc5# Parent d5b3404b82cea4a6e7defebdee79abe7d654c8eb Merge with stable diff -r 9459951761fb -r df702ad9b314 tests/get-with-headers.py --- a/tests/get-with-headers.py Tue Jun 19 16:00:31 2012 +0100 +++ b/tests/get-with-headers.py Thu Jun 21 14:04:15 2012 +0100 @@ -21,14 +21,14 @@ tag = None def request(host, path, show): - + assert not path.startswith('/'), path global tag headers = {} if tag: headers['If-None-Match'] = tag conn = httplib.HTTPConnection(host) - conn.request("GET", path, None, headers) + conn.request("GET", '/' + path, None, headers) response = conn.getresponse() print response.status, reasons.get(response.reason, response.reason) for h in [h.lower() for h in show]: diff -r 9459951761fb -r df702ad9b314 tests/heredoctest.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/heredoctest.py Thu Jun 21 14:04:15 2012 +0100 @@ -0,0 +1,19 @@ +import sys + +globalvars = {} +localvars = {} +lines = sys.stdin.readlines() +while lines: + l = lines.pop(0) + if l.startswith('SALT'): + print l[:-1] + elif l.startswith('>>> '): + snippet = l[4:] + while lines and lines[0].startswith('... '): + l = lines.pop(0) + snippet += "\n" + l[4:] + c = compile(snippet, '', 'single') + try: + exec c in globalvars, localvars + except Exception, inst: + print repr(inst) diff -r 9459951761fb -r df702ad9b314 tests/hghave.py --- a/tests/hghave.py Tue Jun 19 16:00:31 2012 +0100 +++ b/tests/hghave.py Thu Jun 21 14:04:15 2012 +0100 @@ -239,7 +239,9 @@ return False def has_outer_repo(): - return matchoutput('hg root 2>&1', r'') + # failing for other reasons than 'no repo' imply that there is a repo + return not matchoutput('hg root 2>&1', + r'abort: no repository found', True) def has_ssl(): try: diff -r 9459951761fb -r df702ad9b314 tests/test-keyword.t --- a/tests/test-keyword.t Tue Jun 19 16:00:31 2012 +0100 +++ b/tests/test-keyword.t Thu Jun 21 14:04:15 2012 +0100 @@ -11,6 +11,9 @@ > interactive = true > EOF +hide outer repo + $ hg init + Run kwdemo before [keyword] files are set up as it would succeed without uisetup otherwise @@ -929,14 +932,14 @@ $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS - $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/a/?style=raw' + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw' 200 Script output follows expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ do not process $Id: xxx $ $Xinfo: User Name : firstline $ - $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/a/?style=raw' + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw' 200 Script output follows @@ -948,7 +951,7 @@ - $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw' + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw' 200 Script output follows @@ -968,7 +971,7 @@ +xxx $ +$Xinfo$ - $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw' + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw' 200 Script output follows