Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commandserver.py @ 14751:712954a67be3 stable
cmdserver: assign repo.baseui before running commands
There are places in the code that use localrepository.baseui (see hg.remoteui),
we need the ui descriptors (and possibly other things) to be set
correctly on it, so output written to the remoteui descriptors ends up at the
right place.
Before this change, tests such as 'test-bookmarks-pushpull.t' didn't work.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Fri, 24 Jun 2011 19:44:17 +0300 |
parents | f5f97a0f983f |
children | 1b872599f39f |
comparison
equal
deleted
inserted
replaced
14750:f5f97a0f983f | 14751:712954a67be3 |
---|---|
177 else: | 177 else: |
178 args = self._read(length).split('\0') | 178 args = self._read(length).split('\0') |
179 | 179 |
180 # copy the uis so changes (e.g. --config or --verbose) don't | 180 # copy the uis so changes (e.g. --config or --verbose) don't |
181 # persist between requests | 181 # persist between requests |
182 copiedui = self.ui.copy() | |
183 self.repo.baseui = copiedui | |
182 self.repo.ui = self.repo.dirstate._ui = self.repoui.copy() | 184 self.repo.ui = self.repo.dirstate._ui = self.repoui.copy() |
183 req = dispatch.request(args, self.ui.copy(), self.repo, self.cin, | 185 |
186 req = dispatch.request(args, copiedui, self.repo, self.cin, | |
184 self.cout, self.cerr) | 187 self.cout, self.cerr) |
185 | 188 |
186 ret = dispatch.dispatch(req) or 0 # might return None | 189 ret = dispatch.dispatch(req) or 0 # might return None |
187 | 190 |
188 self.cresult.write(struct.pack('>i', int(ret))) | 191 self.cresult.write(struct.pack('>i', int(ret))) |