run-tests: set a default largefiles usercache in the default hgrc file

This fixes a test failure introduced in 131ac757f996 on Windows and OS X, where
the cached largefile wasn't being deleted because the named .cache directory
didn't exist.  It only existed on Linux because the test suite sets $HOME to the
directory of the test being run, and Linux uses $HOME/.cache by default.

Most of the other largefiles tests explicitly set this value at the top of their
scripts, but test-largefiles-update.t didn't pick that up when it was created.
Those scripts that do set a value will override this.

We could just set the parameter in the test-largefiles-update.t script, but
there are a few other non obvious tests that exercise largefiles too.  These
largefiles end up being cached in the user's real cache, so proper hygiene
dictates that this not be left to each individual test script.
This commit is contained in:
Matt Harbison 2014-11-19 23:41:40 -05:00
parent 663d394fe9
commit 889536b207
3 changed files with 6 additions and 0 deletions

View File

@ -689,6 +689,10 @@ class Test(unittest.TestCase):
hgrc.write('commit = -d "0 0"\n')
hgrc.write('shelve = --date "0 0"\n')
hgrc.write('tag = -d "0 0"\n')
hgrc.write('[largefiles]\n')
hgrc.write('usercache = %s\n' %
(os.path.join(self._testtmp, '.cache/largefiles')))
for opt in self._extraconfigopts:
section, key = opt.split('.', 1)
assert '=' in key, ('extra config opt %s must '

View File

@ -5,6 +5,7 @@ Create a repository:
defaults.commit=-d "0 0"
defaults.shelve=--date "0 0"
defaults.tag=-d "0 0"
largefiles.usercache=$TESTTMP/.cache/largefiles (glob)
ui.slash=True
ui.interactive=False
ui.mergemarkers=detailed

View File

@ -178,6 +178,7 @@ check that local configs for the cached repo aren't inherited when -R is used:
defaults.commit=-d "0 0"
defaults.shelve=--date "0 0"
defaults.tag=-d "0 0"
largefiles.usercache=$TESTTMP/.cache/largefiles
ui.slash=True
ui.interactive=False
ui.mergemarkers=detailed