Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commandserver.py @ 27565:e7937438e3f7
commandserver: do not set nontty flag if channel is replaced by a real file
This prepares for porting the chg server. In chg, a server receives client's
stdio over a UNIX domain socket to override server channels. This is because
chg should behave as if it is a normal hg command attached to tty. "nontty"
is not wanted.
This patch is corresponding to the following change. This doesn't test the
identity of "cin" object because the current version of chg reopens stdio
to apply buffering mode.
https://bitbucket.org/yuja/chg/commits/c48c7aed5fc0
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Mon, 14 Dec 2015 23:13:42 +0900 |
parents | f4ca33e33781 |
children | 5d6f984c8375 |
comparison
equal
deleted
inserted
replaced
27564:80b53082a353 | 27565:e7937438e3f7 |
---|---|
213 uis.append(repoui) | 213 uis.append(repoui) |
214 self.repo.ui = self.repo.dirstate._ui = repoui | 214 self.repo.ui = self.repo.dirstate._ui = repoui |
215 self.repo.invalidateall() | 215 self.repo.invalidateall() |
216 | 216 |
217 for ui in uis: | 217 for ui in uis: |
218 # any kind of interaction must use server channels | 218 # any kind of interaction must use server channels, but chg may |
219 ui.setconfig('ui', 'nontty', 'true', 'commandserver') | 219 # replace channels by fully functional tty files. so nontty is |
220 # enforced only if cin is a channel. | |
221 if not util.safehasattr(self.cin, 'fileno'): | |
222 ui.setconfig('ui', 'nontty', 'true', 'commandserver') | |
220 | 223 |
221 req = dispatch.request(args[:], copiedui, self.repo, self.cin, | 224 req = dispatch.request(args[:], copiedui, self.repo, self.cin, |
222 self.cout, self.cerr) | 225 self.cout, self.cerr) |
223 | 226 |
224 ret = (dispatch.dispatch(req) or 0) & 255 # might return None | 227 ret = (dispatch.dispatch(req) or 0) & 255 # might return None |