Merge with stable
authorChristian Ebert <blacktrash@gmx.net>
Fri, 19 Jul 2013 00:37:26 +0100
changeset 1288 2e9c41125820
parent 1277 3fbd928acf60 (current diff)
parent 1287 4b788bb2993d (diff)
child 1291 451cbdc0b353
Merge with stable
--- a/tests/hghave.py	Mon Jul 01 14:19:04 2013 +0100
+++ b/tests/hghave.py	Fri Jul 19 00:37:26 2013 +0100
@@ -105,7 +105,7 @@
     sock = socket.socket(socket.AF_UNIX)
     try:
         sock.bind(name)
-    except socket.error, err:
+    except socket.error:
         return False
     sock.close()
     os.unlink(name)
@@ -274,6 +274,9 @@
 def has_msys():
     return os.getenv('MSYSTEM')
 
+def has_aix():
+    return sys.platform.startswith("aix")
+
 checks = {
     "true": (lambda: True, "yak shaving"),
     "false": (lambda: False, "nail clipper"),
@@ -314,4 +317,5 @@
     "unix-permissions": (has_unix_permissions, "unix-style permissions"),
     "windows": (has_windows, "Windows"),
     "msys": (has_msys, "Windows with MSYS"),
+    "aix": (has_aix, "AIX"),
 }
--- a/tests/run-tests.py	Mon Jul 01 14:19:04 2013 +0100
+++ b/tests/run-tests.py	Fri Jul 19 00:37:26 2013 +0100
@@ -60,6 +60,12 @@
 
 processlock = threading.Lock()
 
+# subprocess._cleanup can race with any Popen.wait or Popen.poll on py24
+# http://bugs.python.org/issue1731717 for details. We shouldn't be producing
+# zombies but it's pretty harmless even if we do.
+if sys.version_info[1] < 5:
+    subprocess._cleanup = lambda: None
+
 closefds = os.name == 'posix'
 def Popen4(cmd, wd, timeout, env=None):
     processlock.acquire()
@@ -572,8 +578,6 @@
     py3kswitch = options.py3k_warnings and ' -3' or ''
     cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
     vlog("# Running", cmd)
-    if os.name == 'nt':
-        replacements.append((r'\r\n', '\n'))
     return run(cmd, wd, options, replacements, env)
 
 needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search
@@ -588,8 +592,6 @@
 def rematch(el, l):
     try:
         # use \Z to ensure that the regex matches to the end of the string
-        if os.name == 'nt':
-            return re.match(el + r'\r?\n\Z', l)
         return re.match(el + r'\n\Z', l)
     except re.error:
         # el is an invalid regex
@@ -599,7 +601,7 @@
     # The only supported special characters are * and ? plus / which also
     # matches \ on windows. Escaping of these caracters is supported.
     if el + '\n' == l:
-        if os.name == 'nt':
+        if os.altsep:
             # matching on "/" is not needed for this line
             log("\nInfo, unnecessary glob: %s (glob)" % el)
         return True
@@ -615,7 +617,7 @@
             res += '.*'
         elif c == '?':
             res += '.'
-        elif c == '/' and os.name == 'nt':
+        elif c == '/' and os.altsep:
             res += '[/\\\\]'
         else:
             res += re.escape(c)
@@ -627,8 +629,6 @@
     if el:
         if el.endswith(" (esc)\n"):
             el = el[:-7].decode('string-escape') + '\n'
-        if el == l or os.name == 'nt' and el[:-1] + '\r\n' == l:
-            return True
         if (el.endswith(" (re)\n") and rematch(el[:-6], l) or
             el.endswith(" (glob)\n") and globmatch(el[:-8], l)):
             return True
@@ -947,6 +947,7 @@
                      c.isdigit() and c or
                      '\\' + c
                      for c in testtmp), '$TESTTMP'))
+        replacements.append((r'\r\n', '\n'))
     else:
         replacements.append((re.escape(testtmp), '$TESTTMP'))