Show More
@@ -846,9 +846,18 b' unix domain socket:' | |||
|
846 | 846 | if server crashed before hello, traceback will be sent to 'e' channel as |
|
847 | 847 | last ditch: |
|
848 | 848 | |
|
849 | $ cat <<'EOF' > ../earlycrasher.py | |
|
850 | > from mercurial import commandserver, extensions | |
|
851 | > def _serverequest(orig, ui, repo, conn, createcmdserver): | |
|
852 | > def createcmdserver(*args, **kwargs): | |
|
853 | > raise Exception('crash') | |
|
854 | > return orig(ui, repo, conn, createcmdserver) | |
|
855 | > def extsetup(ui): | |
|
856 | > extensions.wrapfunction(commandserver, b'_serverequest', _serverequest) | |
|
857 | > EOF | |
|
849 | 858 | $ cat <<EOF >> .hg/hgrc |
|
850 | > [cmdserver] | |
|
851 | > log = inexistent/path.log | |
|
859 | > [extensions] | |
|
860 | > earlycrasher = ../earlycrasher.py | |
|
852 | 861 | > EOF |
|
853 | 862 | >>> from hgclient import bprint, check, readchannel, unixserver |
|
854 | 863 | >>> server = unixserver(b'.hg/server.sock', b'.hg/server.log') |
@@ -863,13 +872,13 b' unix domain socket:' | |||
|
863 | 872 | ... break |
|
864 | 873 | >>> check(earlycrash, server.connect) |
|
865 | 874 | e, 'Traceback (most recent call last):\n' |
|
866 | e, "(IOError|FileNotFoundError): .*" (re) | |
|
875 | e, 'Exception: crash\n' | |
|
867 | 876 | >>> server.shutdown() |
|
868 | 877 | |
|
869 | 878 | $ cat .hg/server.log | grep -v '^ ' |
|
870 | 879 | listening at .hg/server.sock |
|
871 | 880 | Traceback (most recent call last): |
|
872 | (IOError|FileNotFoundError): .* (re) | |
|
881 | Exception: crash | |
|
873 | 882 | killed! |
|
874 | 883 | #endif |
|
875 | 884 | #if no-unix-socket |
General Comments 0
You need to be logged in to leave comments.
Login now