Mercurial > public > mercurial-scm > hg-stable
diff tests/test-commandserver.py @ 14882:bb2cffe81a94 stable
cmdserver: take repo.baseui as our ui
The ui passed to server() is really repo.ui, that is it contains its local
configuration as well.
When running commands that use a different repo than the servers cached repo,
we don't want to use that ui as the baseui for the new repo.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Thu, 14 Jul 2011 11:46:15 +0300 |
parents | 5233df79deed |
children | a59058fd074a |
line wrap: on
line diff
--- 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)