Merge with stable
authorChristian Ebert <blacktrash@gmx.net>
Thu, 21 Jun 2012 14:04:15 +0100
changeset 1111 df702ad9b314
parent 1103 9459951761fb (current diff)
parent 1110 d5b3404b82ce (diff)
child 1113 1e477be3b6c8
Merge with stable
--- 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]:
--- /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, '<heredoc>', 'single')
+        try:
+            exec c in globalvars, localvars
+        except Exception, inst:
+            print repr(inst)
--- 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:
--- 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 <user@example.com>: 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