comparison mercurial/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 1b872599f39f
children b4c06b97dfe0
comparison
equal deleted inserted replaced
14881:2e54387976d4 14882:bb2cffe81a94
130 Listens for commands on stdin, runs them and writes the output on a channel 130 Listens for commands on stdin, runs them and writes the output on a channel
131 based stream to stdout. 131 based stream to stdout.
132 """ 132 """
133 def __init__(self, ui, repo, mode): 133 def __init__(self, ui, repo, mode):
134 self.cwd = os.getcwd() 134 self.cwd = os.getcwd()
135 self.ui = ui
136 135
137 logpath = ui.config("cmdserver", "log", None) 136 logpath = ui.config("cmdserver", "log", None)
138 if logpath: 137 if logpath:
139 global logfile 138 global logfile
140 if logpath == '-': 139 if logpath == '-':
141 # write log on a special 'd'ebug channel 140 # write log on a special 'd'ebug channel
142 logfile = channeledoutput(sys.stdout, sys.stdout, 'd') 141 logfile = channeledoutput(sys.stdout, sys.stdout, 'd')
143 else: 142 else:
144 logfile = open(logpath, 'a') 143 logfile = open(logpath, 'a')
145 144
145 # the ui here is really the repo ui so take its baseui so we don't end up
146 # with its local configuration
147 self.ui = repo.baseui
146 self.repo = repo 148 self.repo = repo
147 self.repoui = repo.ui 149 self.repoui = repo.ui
148 150
149 if mode == 'pipe': 151 if mode == 'pipe':
150 self.cerr = channeledoutput(sys.stderr, sys.stdout, 'e') 152 self.cerr = channeledoutput(sys.stderr, sys.stdout, 'e')