Mercurial > hg-stable
comparison tests/test-serve.t @ 31772:594dd384803c
test-serve: make the 'listening at *' lines optional
The daemonized serve process doesn't print these lines out (see 448d0c452140).
I was able to get it to with the following hack:
diff --git a/mercurial/win32.py b/mercurial/win32.py
--- a/mercurial/win32.py
+++ b/mercurial/win32.py
@@ -418,6 +418,11 @@
return str(ppid)
def spawndetached(args):
+
+ import subprocess
+ return subprocess.Popen(args, cwd=pycompat.getcwd(), env=encoding.environ,
+ creationflags=subprocess.CREATE_NEW_PROCESS_GROUP).pid
+
# No standard library function really spawns a fully detached
# process under win32 because they allocate pipes or other objects
# to handle standard streams communications. Passing these objects
However, MSYS translates --prefixes starting with '/' to 'C:/MinGW/msys/1.0',
which changes the output. The output isn't so important that I want to spend a
bunch of time on this, and risk breaking some subtle behavior of `hg serve -d`
with the more complicated code.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 02 Apr 2017 00:56:52 -0400 |
parents | 636cf3f7620d |
children | 5e92ba77793c |
comparison
equal
deleted
inserted
replaced
31771:49e9124cfc23 | 31772:594dd384803c |
---|---|
32 $ cat errors.log | 32 $ cat errors.log |
33 | 33 |
34 With -v | 34 With -v |
35 | 35 |
36 $ hgserve | 36 $ hgserve |
37 listening at http://localhost/ (bound to *$LOCALIP*:HGPORT1) (glob) | 37 listening at http://localhost/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
38 % errors | 38 % errors |
39 | 39 |
40 With -v and -p HGPORT2 | 40 With -v and -p HGPORT2 |
41 | 41 |
42 $ hgserve -p "$HGPORT2" | 42 $ hgserve -p "$HGPORT2" |
43 listening at http://localhost/ (bound to *$LOCALIP*:HGPORT2) (glob) | 43 listening at http://localhost/ (bound to *$LOCALIP*:HGPORT2) (glob) (?) |
44 % errors | 44 % errors |
45 | 45 |
46 With -v and -p daytime (should fail because low port) | 46 With -v and -p daytime (should fail because low port) |
47 | 47 |
48 #if no-root | 48 #if no-root |
55 #endif | 55 #endif |
56 | 56 |
57 With --prefix foo | 57 With --prefix foo |
58 | 58 |
59 $ hgserve --prefix foo | 59 $ hgserve --prefix foo |
60 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) | 60 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
61 % errors | 61 % errors |
62 | 62 |
63 With --prefix /foo | 63 With --prefix /foo |
64 | 64 |
65 $ hgserve --prefix /foo | 65 $ hgserve --prefix /foo |
66 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) | 66 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
67 % errors | 67 % errors |
68 | 68 |
69 With --prefix foo/ | 69 With --prefix foo/ |
70 | 70 |
71 $ hgserve --prefix foo/ | 71 $ hgserve --prefix foo/ |
72 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) | 72 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
73 % errors | 73 % errors |
74 | 74 |
75 With --prefix /foo/ | 75 With --prefix /foo/ |
76 | 76 |
77 $ hgserve --prefix /foo/ | 77 $ hgserve --prefix /foo/ |
78 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) | 78 listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob) (?) |
79 % errors | 79 % errors |
80 | 80 |
81 $ cd .. | 81 $ cd .. |