changeset 1003:6945d3359456

testutil: clear rcpath when we update HGRCPATH env var hg maintains a global cache of the HGRCPATH that doesn't get updated when HGRCPATH is changed. Nuke said global cache when we change the HGRCPATH.
author David Schleimer <dschleimer@fb.com>
date Fri, 12 Apr 2013 15:41:51 -0700
parents 117b3b421294
children b2d89ba6b871
files tests/test_util.py tests/test_utility_commands.py
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -22,6 +22,7 @@ from mercurial import dispatch as dispat
 from mercurial import hg
 from mercurial import i18n
 from mercurial import node
+from mercurial import scmutil
 from mercurial import ui
 from mercurial import util
 from mercurial import extensions
@@ -258,6 +259,7 @@ class TestBase(unittest.TestCase):
             'svnwrap_test', dir=os.environ.get('HGSUBVERSION_TEST_TEMP', None))
         self.hgrc = os.path.join(self.tmpdir, '.hgrc')
         os.environ['HGRCPATH'] = self.hgrc
+        scmutil._rcpath = None
         rc = open(self.hgrc, 'w')
         rc.write('[ui]\nusername=test-user\n')
         for l in '[extensions]', 'hgsubversion=':
--- a/tests/test_utility_commands.py
+++ b/tests/test_utility_commands.py
@@ -341,7 +341,7 @@ missing file: binary3
         # rebuildmeta --unsafe-skip-uuid-check with unrelated repo
         svncommands.rebuildmeta(self.ui(), repo=self.repo, args=[otherurl],
                                 unsafe_skip_uuid_check=True)
-        
+
 def suite():
     all_tests = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests),
           ]