[PATCH] chgserver: wrap ui without calling its constructor

Yuya Nishihara yuya at tcha.org
Mon Mar 14 10:02:34 EDT 2016

On Sun, 13 Mar 2016 19:33:21 +0000, Jun Wu wrote:
> On 03/13/2016 03:52 PM, Yuya Nishihara wrote:
> > Or should I send patches that will remove chgui completely? I didn't write
> > them yet, but it should be possible. Basic idea is to move ui-layer code
> > from util.system() to ui.system(), and make ui._csystem swappable.
> Do you mean adding a parameter "csystem" (name not decided) to util.system and
> pass "self._system" in "ui.system" ? It can solve the __init__ exception issue
> and get rid of duplicated code, which I think is reasonable. I can write this
> patch if you are busy with other stuff.

My idea is somewhat different:

  ui._system = util.system  # default
  ui._system = channeledsystem(fin, fout, 'S')  # chg

I haven't started writing the patches yet for two reasons:

 a) I considered it would be a pure clean-up series.
 b) I might want to extend the 'S' channel to handle pager request. If the
    pager extension gets into the core, it might have more precise logic when
    to start a pager, such as ui.startpager(). Current "getpager" command can't
    handle such situation.

More information about the Mercurial-devel mailing list