diff -r 2e54387976d4 -r bb2cffe81a94 tests/test-commandserver.py --- a/tests/test-commandserver.py Fri Jul 15 10:18:24 2011 +0200 +++ b/tests/test-commandserver.py Thu Jul 14 11:46:15 2011 +0300 @@ -1,4 +1,4 @@ -import sys, os, struct, subprocess, cStringIO, re +import sys, os, struct, subprocess, cStringIO, re, shutil def connect(path=None): cmdline = ['hg', 'serve', '--cmdserver', 'pipe'] @@ -131,6 +131,19 @@ runcommand(server, ['st', 'foo/bar']) os.remove('foo/bar') +def localhgrc(server): + """ check that local configs for the cached repo aren't inherited when -R + is used """ + readchannel(server) + + # the cached repo local hgrc contains ui.foo=bar, so showconfig should show it + runcommand(server, ['showconfig']) + + # but not for this repo + runcommand(server, ['init', 'foo']) + runcommand(server, ['-R', 'foo', 'showconfig']) + shutil.rmtree('foo') + if __name__ == '__main__': os.system('hg init') @@ -140,3 +153,8 @@ check(inputeof) check(serverinput) check(cwd) + + hgrc = open('.hg/hgrc', 'a') + hgrc.write('[ui]\nfoo=bar\n') + hgrc.close() + check(localhgrc)