[PATCH 5 of 8 ipv6] runtests: always set web.ipv6

Jun Wu quark at fb.com
Thu Feb 16 12:39:17 EST 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1487263439 28800
#      Thu Feb 16 08:43:59 2017 -0800
# Node ID b38591e034d5508ddfc73d50b95d6b29d6370671
# Parent  91137c500c4f8761c2d70bab7438d8d87959bd15
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r b38591e034d5
runtests: always set web.ipv6

Previously, we only set web.ipv6 if IPv6 is used, but not on the IPv4 case.

Since we already have set web.address, it makes sense to move "web.ipv6" out
from "extra config options".

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -595,9 +595,4 @@ class Test(unittest.TestCase):
         self._chgsockdir = None
 
-        # If IPv6 is used, set web.ipv6=1 in hgrc so servers will use IPv6
-        if useipv6:
-            self._extraconfigopts = list(self._extraconfigopts)
-            self._extraconfigopts.append('web.ipv6 = True')
-
         # If we're not in --debug mode and reference output file exists,
         # check test output against it.
@@ -920,4 +915,5 @@ class Test(unittest.TestCase):
         hgrc.write(b'[web]\n')
         hgrc.write(b'address = localhost\n')
+        hgrc.write(b'ipv6 = %s\n' % self._useipv6)
 
         for opt in self._extraconfigopts:
diff --git a/tests/test-basic.t b/tests/test-basic.t
--- a/tests/test-basic.t
+++ b/tests/test-basic.t
@@ -13,5 +13,5 @@ Create a repository:
   ui.promptecho=True
   web.address=localhost
-  web.ipv6=True (?)
+  web\.ipv6=(?:True|False) (re)
   $ hg init t
   $ cd t
diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -201,5 +201,5 @@ check that local configs for the cached 
   ui.nontty=true
   web.address=localhost
-  web.ipv6=True (?)
+  web\.ipv6=(?:True|False) (re)
   *** runcommand init foo
   *** runcommand -R foo showconfig ui defaults


More information about the Mercurial-devel mailing list