Patchwork [1,of,4] chgserver: store csystem separately

login
register
mail settings
Submitter Jun Wu
Date Dec. 16, 2016, 3:01 p.m.
Message ID <5d314c588c67b0e06515.1481900478@x1c>
Download mbox | patch
Permalink /patch/17935/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Jun Wu - Dec. 16, 2016, 3:01 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1481899594 0
#      Fri Dec 16 14:46:34 2016 +0000
# Node ID 5d314c588c67b0e0651557610d68e3705fc61f1d
# Parent  be520fe3a3e95edb4a8db75d424ed067cb5bf706
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 5d314c588c67
chgserver: store csystem separately

Previously, the "system" channel is inside the ui object. In the future, chg
will let dispatch to create a new ui object from scratch, to maximize
compatibility. And chgserver will use a "uisetup" like an extension to wrap
ui.system. To be able to do that cleanly, the system channel needs to be
accessed directly.

Patch

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -329,6 +329,7 @@  class channeledsystem(object):
 class chgcmdserver(commandserver.server):
     def __init__(self, ui, repo, fin, fout, sock, hashstate, baseaddress):
+        self._csystem = channeledsystem(fin, fout, 'S')
         super(chgcmdserver, self).__init__(
-            _newchgui(ui, channeledsystem(fin, fout, 'S')), repo, fin, fout)
+            _newchgui(ui, self._csystem), repo, fin, fout)
         self.clientsock = sock
         self._oldios = []  # original (self.ch, ui.fp, fd) before "attachio"