diff tests/hghave.py @ 22994:840be5ca03e1

cmdserver: add service that listens on unix domain socket and forks process Typical use case of 'unix' mode is a background hg daemon. $ hg serve --cmdserver unix --cwd / -a /tmp/hg-`id -u`.sock Unlike 'pipe' mode in which parent process keeps stdio channel, 'unix' server can be detached. So clients can freely connect and disconnect from server, saving Python start-up time. It might be better to write "--cmdserver socket -a unix:/sockpath" instead of "--cmdserver unix -a /sockpath" in case hgweb gets the ability to listen on unix domain socket.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 04 Oct 2014 16:46:50 +0900
parents 36a940d82f88
children 86a8658c77ff
line wrap: on
line diff
--- a/tests/hghave.py	Sat Sep 27 19:18:20 2014 +0900
+++ b/tests/hghave.py	Sat Oct 04 16:46:50 2014 +0900
@@ -1,5 +1,6 @@
 import os, stat
 import re
+import socket
 import sys
 import tempfile
 
@@ -258,6 +259,10 @@
     finally:
         os.rmdir(d)
 
+@check("unix-socket", "AF_UNIX socket family")
+def has_unix_socket():
+    return getattr(socket, 'AF_UNIX', None) is not None
+
 @check("root", "root permissions")
 def has_root():
     return getattr(os, 'geteuid', None) and os.geteuid() == 0