Show More
@@ -5168,7 +5168,6 b' def serve(ui, repo, **opts):' | |||||
5168 | s.serve_forever() |
|
5168 | s.serve_forever() | |
5169 |
|
5169 | |||
5170 | if opts["cmdserver"]: |
|
5170 | if opts["cmdserver"]: | |
5171 | checkrepo() |
|
|||
5172 | s = commandserver.server(ui, repo, opts["cmdserver"]) |
|
5171 | s = commandserver.server(ui, repo, opts["cmdserver"]) | |
5173 | return s.serve() |
|
5172 | return s.serve() | |
5174 |
|
5173 |
@@ -142,11 +142,15 b' class server(object):' | |||||
142 | else: |
|
142 | else: | |
143 | logfile = open(logpath, 'a') |
|
143 | logfile = open(logpath, 'a') | |
144 |
|
144 | |||
145 | # the ui here is really the repo ui so take its baseui so we don't end |
|
145 | if repo: | |
146 | # up with its local configuration |
|
146 | # the ui here is really the repo ui so take its baseui so we don't | |
|
147 | # end up with its local configuration | |||
147 | self.ui = repo.baseui |
|
148 | self.ui = repo.baseui | |
148 | self.repo = repo |
|
149 | self.repo = repo | |
149 | self.repoui = repo.ui |
|
150 | self.repoui = repo.ui | |
|
151 | else: | |||
|
152 | self.ui = ui | |||
|
153 | self.repo = self.repoui = None | |||
150 |
|
154 | |||
151 | if mode == 'pipe': |
|
155 | if mode == 'pipe': | |
152 | self.cerr = channeledoutput(sys.stderr, sys.stdout, 'e') |
|
156 | self.cerr = channeledoutput(sys.stderr, sys.stdout, 'e') | |
@@ -183,6 +187,7 b' class server(object):' | |||||
183 | # copy the uis so changes (e.g. --config or --verbose) don't |
|
187 | # copy the uis so changes (e.g. --config or --verbose) don't | |
184 | # persist between requests |
|
188 | # persist between requests | |
185 | copiedui = self.ui.copy() |
|
189 | copiedui = self.ui.copy() | |
|
190 | if self.repo: | |||
186 | self.repo.baseui = copiedui |
|
191 | self.repo.baseui = copiedui | |
187 | # clone ui without using ui.copy because this is protected |
|
192 | # clone ui without using ui.copy because this is protected | |
188 | repoui = self.repoui.__class__(self.repoui) |
|
193 | repoui = self.repoui.__class__(self.repoui) |
@@ -294,6 +294,11 b' def mqoutsidechanges(server):' | |||||
294 | # repo.mq should be recreated to point to new queue |
|
294 | # repo.mq should be recreated to point to new queue | |
295 | runcommand(server, ['qqueue', '--active']) |
|
295 | runcommand(server, ['qqueue', '--active']) | |
296 |
|
296 | |||
|
297 | def startwithoutrepo(server): | |||
|
298 | readchannel(server) | |||
|
299 | runcommand(server, ['init', 'repo2']) | |||
|
300 | runcommand(server, ['id', '-R', 'repo2']) | |||
|
301 | ||||
297 | if __name__ == '__main__': |
|
302 | if __name__ == '__main__': | |
298 | os.system('hg init repo') |
|
303 | os.system('hg init repo') | |
299 | os.chdir('repo') |
|
304 | os.chdir('repo') | |
@@ -329,3 +334,7 b" if __name__ == '__main__':" | |||||
329 | hgrc.write('[extensions]\nmq=\n') |
|
334 | hgrc.write('[extensions]\nmq=\n') | |
330 | hgrc.close() |
|
335 | hgrc.close() | |
331 | check(mqoutsidechanges) |
|
336 | check(mqoutsidechanges) | |
|
337 | ||||
|
338 | os.chdir('..') | |||
|
339 | check(hellomessage) | |||
|
340 | check(startwithoutrepo) |
@@ -237,3 +237,16 b' popping 0.diff' | |||||
237 | patch queue now empty |
|
237 | patch queue now empty | |
238 | runcommand qqueue --active |
|
238 | runcommand qqueue --active | |
239 | foo |
|
239 | foo | |
|
240 | ||||
|
241 | testing hellomessage: | |||
|
242 | ||||
|
243 | o, 'capabilities: getencoding runcommand\nencoding: ***' | |||
|
244 | runcommand id | |||
|
245 | abort: there is no Mercurial repository here (.hg not found) | |||
|
246 | [255] | |||
|
247 | ||||
|
248 | testing startwithoutrepo: | |||
|
249 | ||||
|
250 | runcommand init repo2 | |||
|
251 | runcommand id -R repo2 | |||
|
252 | 000000000000 tip |
General Comments 0
You need to be logged in to leave comments.
Login now