Show More
@@ -50,7 +50,7 b' from .utils import (' | |||||
50 |
|
50 | |||
51 | class request(object): |
|
51 | class request(object): | |
52 | def __init__(self, args, ui=None, repo=None, fin=None, fout=None, |
|
52 | def __init__(self, args, ui=None, repo=None, fin=None, fout=None, | |
53 | ferr=None, prereposetups=None): |
|
53 | ferr=None, fmsg=None, prereposetups=None): | |
54 | self.args = args |
|
54 | self.args = args | |
55 | self.ui = ui |
|
55 | self.ui = ui | |
56 | self.repo = repo |
|
56 | self.repo = repo | |
@@ -59,6 +59,8 b' class request(object):' | |||||
59 | self.fin = fin |
|
59 | self.fin = fin | |
60 | self.fout = fout |
|
60 | self.fout = fout | |
61 | self.ferr = ferr |
|
61 | self.ferr = ferr | |
|
62 | # separate stream for status/error messages | |||
|
63 | self.fmsg = fmsg | |||
62 |
|
64 | |||
63 | # remember options pre-parsed by _earlyparseopts() |
|
65 | # remember options pre-parsed by _earlyparseopts() | |
64 | self.earlyoptions = {} |
|
66 | self.earlyoptions = {} | |
@@ -205,6 +207,8 b' def dispatch(req):' | |||||
205 | req.ui.fout = req.fout |
|
207 | req.ui.fout = req.fout | |
206 | if req.ferr: |
|
208 | if req.ferr: | |
207 | req.ui.ferr = req.ferr |
|
209 | req.ui.ferr = req.ferr | |
|
210 | if req.fmsg: | |||
|
211 | req.ui.fmsg = req.fmsg | |||
208 | except error.Abort as inst: |
|
212 | except error.Abort as inst: | |
209 | ferr.write(_("abort: %s\n") % inst) |
|
213 | ferr.write(_("abort: %s\n") % inst) | |
210 | if inst.hint: |
|
214 | if inst.hint: | |
@@ -955,6 +959,7 b' def _dispatch(req):' | |||||
955 | repo.ui.fin = ui.fin |
|
959 | repo.ui.fin = ui.fin | |
956 | repo.ui.fout = ui.fout |
|
960 | repo.ui.fout = ui.fout | |
957 | repo.ui.ferr = ui.ferr |
|
961 | repo.ui.ferr = ui.ferr | |
|
962 | repo.ui.fmsg = ui.fmsg | |||
958 | else: |
|
963 | else: | |
959 | try: |
|
964 | try: | |
960 | repo = hg.repository(ui, path=path, |
|
965 | repo = hg.repository(ui, path=path, |
@@ -231,6 +231,7 b' class ui(object):' | |||||
231 | self._fout = src._fout |
|
231 | self._fout = src._fout | |
232 | self._ferr = src._ferr |
|
232 | self._ferr = src._ferr | |
233 | self._fin = src._fin |
|
233 | self._fin = src._fin | |
|
234 | self._fmsg = src._fmsg | |||
234 | self._fmsgout = src._fmsgout |
|
235 | self._fmsgout = src._fmsgout | |
235 | self._fmsgerr = src._fmsgerr |
|
236 | self._fmsgerr = src._fmsgerr | |
236 | self._finoutredirected = src._finoutredirected |
|
237 | self._finoutredirected = src._finoutredirected | |
@@ -258,6 +259,7 b' class ui(object):' | |||||
258 | self._fout = procutil.stdout |
|
259 | self._fout = procutil.stdout | |
259 | self._ferr = procutil.stderr |
|
260 | self._ferr = procutil.stderr | |
260 | self._fin = procutil.stdin |
|
261 | self._fin = procutil.stdin | |
|
262 | self._fmsg = None | |||
261 | self._fmsgout = self.fout # configurable |
|
263 | self._fmsgout = self.fout # configurable | |
262 | self._fmsgerr = self.ferr # configurable |
|
264 | self._fmsgerr = self.ferr # configurable | |
263 | self._finoutredirected = False |
|
265 | self._finoutredirected = False | |
@@ -912,6 +914,17 b' class ui(object):' | |||||
912 | def fin(self, f): |
|
914 | def fin(self, f): | |
913 | self._fin = f |
|
915 | self._fin = f | |
914 |
|
916 | |||
|
917 | @property | |||
|
918 | def fmsg(self): | |||
|
919 | """Stream dedicated for status/error messages; may be None if | |||
|
920 | fout/ferr are used""" | |||
|
921 | return self._fmsg | |||
|
922 | ||||
|
923 | @fmsg.setter | |||
|
924 | def fmsg(self, f): | |||
|
925 | self._fmsg = f | |||
|
926 | self._fmsgout, self._fmsgerr = _selectmsgdests(self) | |||
|
927 | ||||
915 | def pushbuffer(self, error=False, subproc=False, labeled=False): |
|
928 | def pushbuffer(self, error=False, subproc=False, labeled=False): | |
916 | """install a buffer to capture standard output of the ui object |
|
929 | """install a buffer to capture standard output of the ui object | |
917 |
|
930 |
General Comments 0
You need to be logged in to leave comments.
Login now