diff hgext/chgserver.py @ 28454:8062869860b8

chg: remove manual reload logic chgserver now validates and reloads configs automatically. Manually reloading is no longer necessary. Besides, we are deprecating pid files since the server will periodically check its ownership of the socket file and exit if it does not own the socket file any longer, which works more reliable than a pid file. This patch removes the SIGHUP reload logic from both chg server and client.
author Jun Wu <quark@fb.com>
date Thu, 10 Mar 2016 00:12:33 +0000
parents 8f9661d1637b
children e6e183687545
line wrap: on
line diff
--- a/hgext/chgserver.py	Wed Mar 09 01:20:57 2016 +0000
+++ b/hgext/chgserver.py	Thu Mar 10 00:12:33 2016 +0000
@@ -28,9 +28,6 @@
 'validate' command
     reload the config and check if the server is up to date
 
-'SIGHUP' signal
-    reload configuration files
-
 Config
 ------
 
@@ -48,7 +45,6 @@
 import inspect
 import os
 import re
-import signal
 import struct
 import sys
 import threading
@@ -616,7 +612,6 @@
 
 class chgunixservice(commandserver.unixservice):
     def init(self):
-        signal.signal(signal.SIGHUP, self._reloadconfig)
         self._inithashstate()
         class cls(AutoExitMixIn, SocketServer.ForkingMixIn,
                   SocketServer.UnixStreamServer):
@@ -647,9 +642,6 @@
         os.symlink(os.path.basename(self.address), tempaddress)
         util.rename(tempaddress, self.baseaddress)
 
-    def _reloadconfig(self, signum, frame):
-        self.ui = self.server.ui = _renewui(self.ui)
-
     def run(self):
         try:
             self.server.serve_forever()