changeset 29531:b439a2a268eb

chgserver: drop repo at chgunixservice.__init__() Since it isn't expensive operation, we don't have to delay it to init().
author Yuya Nishihara <yuya@tcha.org>
date Sat, 21 May 2016 17:06:39 +0900
parents 3239e2fdd2e2
children dda6bf886839
files hgext/chgserver.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/chgserver.py	Sat May 21 16:52:04 2016 +0900
+++ b/hgext/chgserver.py	Sat May 21 17:06:39 2016 +0900
@@ -606,11 +606,13 @@
                 raise
 
 class chgunixservice(commandserver.unixservice):
-    def init(self):
-        if self.repo:
+    def __init__(self, ui, repo, opts):
+        super(chgunixservice, self).__init__(ui, repo=None, opts=opts)
+        if repo:
             # one chgserver can serve multiple repos. drop repo infomation
             self.ui.setconfig('bundle', 'mainreporoot', '', 'repo')
-            self.repo = None
+
+    def init(self):
         self._inithashstate()
         self._checkextensions()
         class cls(AutoExitMixIn, socketserver.ForkingMixIn,