Show More
@@ -50,7 +50,7 b' from .utils import (' | |||
|
50 | 50 | |
|
51 | 51 | class request(object): |
|
52 | 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 | 54 | self.args = args |
|
55 | 55 | self.ui = ui |
|
56 | 56 | self.repo = repo |
@@ -59,6 +59,8 b' class request(object):' | |||
|
59 | 59 | self.fin = fin |
|
60 | 60 | self.fout = fout |
|
61 | 61 | self.ferr = ferr |
|
62 | # separate stream for status/error messages | |
|
63 | self.fmsg = fmsg | |
|
62 | 64 | |
|
63 | 65 | # remember options pre-parsed by _earlyparseopts() |
|
64 | 66 | self.earlyoptions = {} |
@@ -205,6 +207,8 b' def dispatch(req):' | |||
|
205 | 207 | req.ui.fout = req.fout |
|
206 | 208 | if req.ferr: |
|
207 | 209 | req.ui.ferr = req.ferr |
|
210 | if req.fmsg: | |
|
211 | req.ui.fmsg = req.fmsg | |
|
208 | 212 | except error.Abort as inst: |
|
209 | 213 | ferr.write(_("abort: %s\n") % inst) |
|
210 | 214 | if inst.hint: |
@@ -955,6 +959,7 b' def _dispatch(req):' | |||
|
955 | 959 | repo.ui.fin = ui.fin |
|
956 | 960 | repo.ui.fout = ui.fout |
|
957 | 961 | repo.ui.ferr = ui.ferr |
|
962 | repo.ui.fmsg = ui.fmsg | |
|
958 | 963 | else: |
|
959 | 964 | try: |
|
960 | 965 | repo = hg.repository(ui, path=path, |
@@ -231,6 +231,7 b' class ui(object):' | |||
|
231 | 231 | self._fout = src._fout |
|
232 | 232 | self._ferr = src._ferr |
|
233 | 233 | self._fin = src._fin |
|
234 | self._fmsg = src._fmsg | |
|
234 | 235 | self._fmsgout = src._fmsgout |
|
235 | 236 | self._fmsgerr = src._fmsgerr |
|
236 | 237 | self._finoutredirected = src._finoutredirected |
@@ -258,6 +259,7 b' class ui(object):' | |||
|
258 | 259 | self._fout = procutil.stdout |
|
259 | 260 | self._ferr = procutil.stderr |
|
260 | 261 | self._fin = procutil.stdin |
|
262 | self._fmsg = None | |
|
261 | 263 | self._fmsgout = self.fout # configurable |
|
262 | 264 | self._fmsgerr = self.ferr # configurable |
|
263 | 265 | self._finoutredirected = False |
@@ -912,6 +914,17 b' class ui(object):' | |||
|
912 | 914 | def fin(self, f): |
|
913 | 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 | 928 | def pushbuffer(self, error=False, subproc=False, labeled=False): |
|
916 | 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