Submitter | Jun Wu |
---|---|
Date | March 19, 2016, 6:15 p.m. |
Message ID | <45e048623bd45fa3fa94.1458411343@x1c> |
Download | mbox | patch |
Permalink | /patch/13956/ |
State | Accepted |
Delegated to: | Yuya Nishihara |
Headers | show |
Comments
On Sat, 19 Mar 2016 11:15:43 -0700, Jun Wu wrote: > # HG changeset patch > # User Jun Wu <quark@fb.com> > # Date 1458239268 0 > # Thu Mar 17 18:27:48 2016 +0000 > # Node ID 45e048623bd45fa3fa949de743a4aaef18ffb5a0 > # Parent 1435a8e9b5fe38cfe900e0a75fefab046af73dd6 > chgserver: use old ui.system if fout is not stdout or needs to be captured Queued this, thanks!
Patch
diff --git a/hgext/chgserver.py b/hgext/chgserver.py --- a/hgext/chgserver.py +++ b/hgext/chgserver.py @@ -235,6 +235,15 @@ def system(self, cmd, environ=None, cwd=None, onerr=None, errprefix=None): + # fallback to the original system method if the output needs to be + # captured (to self._buffers), or the output stream is not stdout + # (e.g. stderr, cStringIO), because the chg client is not aware of + # these situations and will behave differently (write to stdout). + if any(s[1] for s in self._bufferstates) \ + or not util.safehasattr(self.fout, 'fileno') \ + or self.fout.fileno() != sys.stdout.fileno(): + return super(chgui, self).system(cmd, environ, cwd, onerr, + errprefix) # copied from mercurial/util.py:system() self.flush() def py2shell(val):