comparison tests/test_util.py @ 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 26aa0172725b
children aa043f64d8b7
comparison
equal deleted inserted replaced
1002:117b3b421294 1003:6945d3359456
20 from mercurial import context 20 from mercurial import context
21 from mercurial import dispatch as dispatchmod 21 from mercurial import dispatch as dispatchmod
22 from mercurial import hg 22 from mercurial import hg
23 from mercurial import i18n 23 from mercurial import i18n
24 from mercurial import node 24 from mercurial import node
25 from mercurial import scmutil
25 from mercurial import ui 26 from mercurial import ui
26 from mercurial import util 27 from mercurial import util
27 from mercurial import extensions 28 from mercurial import extensions
28 29
29 try: 30 try:
256 self.oldwd = os.getcwd() 257 self.oldwd = os.getcwd()
257 self.tmpdir = tempfile.mkdtemp( 258 self.tmpdir = tempfile.mkdtemp(
258 'svnwrap_test', dir=os.environ.get('HGSUBVERSION_TEST_TEMP', None)) 259 'svnwrap_test', dir=os.environ.get('HGSUBVERSION_TEST_TEMP', None))
259 self.hgrc = os.path.join(self.tmpdir, '.hgrc') 260 self.hgrc = os.path.join(self.tmpdir, '.hgrc')
260 os.environ['HGRCPATH'] = self.hgrc 261 os.environ['HGRCPATH'] = self.hgrc
262 scmutil._rcpath = None
261 rc = open(self.hgrc, 'w') 263 rc = open(self.hgrc, 'w')
262 rc.write('[ui]\nusername=test-user\n') 264 rc.write('[ui]\nusername=test-user\n')
263 for l in '[extensions]', 'hgsubversion=': 265 for l in '[extensions]', 'hgsubversion=':
264 print >> rc, l 266 print >> rc, l
265 267