Bug 899818 - Don't add quotes to values when writing Mercurial configs; r=Gijs
authorGregory Szorc <gps@mozilla.com>
Wed, 31 Jul 2013 00:07:57 -0700
changeset 140709 5aab1bae4fb44d5eb232aa90ac138f59cf52cf6a
parent 140708 d27067519f79582da974d732ca9fe8f52b3fa409
child 140710 7bbbb13502563c01b50b0ba6182cbcb6d3738c4d
push id31839
push usergszorc@mozilla.com
push dateWed, 31 Jul 2013 07:08:17 +0000
treeherdermozilla-inbound@5aab1bae4fb4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs899818
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 899818 - Don't add quotes to values when writing Mercurial configs; r=Gijs DONTBUILD (NPOTB)
tools/mercurial/hgsetup/config.py
--- a/tools/mercurial/hgsetup/config.py
+++ b/tools/mercurial/hgsetup/config.py
@@ -12,18 +12,22 @@ HG_FINGERPRINT = '10:78:e8:57:2d:95:de:7
 
 
 class MercurialConfig(object):
     """Interface for manipulating a Mercurial config file."""
 
     def __init__(self, infile=None):
         """Create a new instance, optionally from an existing hgrc file."""
 
+        # write_empty_values is necessary to prevent built-in extensions (which
+        # have no value) from being dropped on write.
+        # list_values aren't needed by Mercurial and disabling them prevents
+        # quotes from being added.
         self._c = ConfigObj(infile=infile, encoding='utf-8',
-            write_empty_values=True)
+            write_empty_values=True, list_values=False)
 
     @property
     def config(self):
         return self._c
 
     @property
     def extensions(self):
         """Returns the set of currently enabled extensions (by name)."""