Patchwork D1476: run-tests: make --extra-config-opt work with Python 3

login
register
mail settings
Submitter phabricator
Date Dec. 2, 2017, 3:11 a.m.
Message ID <ad1fbf7061230f70bc047ed548948266@localhost.localdomain>
Download mbox | patch
Permalink /patch/25880/
State Not Applicable
Headers show

Comments

phabricator - Dec. 2, 2017, 3:11 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG073843b5e353: run-tests: make --extra-config-opt work with Python 3 (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1476?vs=3716&id=4072

REVISION DETAIL
  https://phab.mercurial-scm.org/D1476

AFFECTED FILES
  tests/run-tests.py
  tests/test-run-tests.t

CHANGE DETAILS




To: indygreg, #hg-reviewers, yuja
Cc: mercurial-devel

Patch

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -1566,3 +1566,14 @@ 
   # Ran 1 tests, 0 skipped, 1 failed.
   python hash seed: * (glob)
   [1]
+
+--extra-config-opt works
+
+  $ cat << EOF >> test-config-opt.t
+  >   $ hg init test-config-opt
+  >   $ hg -R test-config-opt purge
+  > EOF
+
+  $ rt --extra-config-opt extensions.purge= test-config-opt.t
+  .
+  # Ran 1 tests, 0 skipped, 0 failed.
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1105,9 +1105,9 @@ 
         hgrc.write(b'ipv6 = %s\n' % str(self._useipv6).encode('ascii'))
 
         for opt in self._extraconfigopts:
-            section, key = opt.split('.', 1)
-            assert '=' in key, ('extra config opt %s must '
-                                'have an = for assignment' % opt)
+            section, key = opt.encode('utf-8').split(b'.', 1)
+            assert b'=' in key, ('extra config opt %s must '
+                                 'have an = for assignment' % opt)
             hgrc.write(b'[%s]\n%s\n' % (section, key))
         hgrc.close()