Patchwork [V3] commands: 'listening at' line when port specified (issue3976)

login
register
mail settings
Submitter Chinmay Joshi
Date March 24, 2014, 6:12 p.m.
Message ID <CAGwDGc2QcfYLhy-fLB5LwNDHxYQAOm8a9=JV=+DOsH51v8CmLw@mail.gmail.com>
Download mbox | patch
Permalink /patch/4044/
State Superseded
Headers show

Comments

Chinmay Joshi - March 24, 2014, 6:12 p.m.
# HG changeset patch
# User Chinmay Joshi <c@chinmayjoshi.com>
# Date 1395682982 -19800
#      Mon Mar 24 23:13:02 2014 +0530
# Node ID d3fe362ba10816cc6e2b3934437147c0eb2d67a7
# Parent  3d1d16b19e7dd5e96e242daed86512429bc1d3f6
commands: 'listening at' line when port specified (issue3976)

When hg serve is executed with -p <port>,  there output with
"listening at host ...." shown.

I modified commands.py and run-tests.py and 44 test files. I tested it
on multiple machines with fedora and ubuntu.

   $ hg debugwireargs http://localhost:$HGPORT/ un deux trois quatre
@@ -63,6 +64,7 @@
   $ . "$TESTDIR/notcapable"

   $ hg serve -R repo -p $HGPORT2 -d --pid-file=hg2.pid -E error2.log
-A access2.log
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat hg2.pid >> $DAEMON_PIDS

   $ hg debugwireargs http://localhost:$HGPORT2/ un deux trois quatre
Mads Kiilerich - March 24, 2014, 7:06 p.m.
On 03/24/2014 07:12 PM, Chinmay Joshi wrote:
> # HG changeset patch
> # User Chinmay Joshi <c@chinmayjoshi.com>
> # Date 1395682982 -19800
> #      Mon Mar 24 23:13:02 2014 +0530
> # Node ID d3fe362ba10816cc6e2b3934437147c0eb2d67a7
> # Parent  3d1d16b19e7dd5e96e242daed86512429bc1d3f6
> commands: 'listening at' line when port specified (issue3976)
>
> When hg serve is executed with -p <port>,  there output with
> "listening at host ...." shown.

The issue tracker has a brief discussion of the problem but do not 
discuss in detail how it should be solved.

I agree that it would be fine if it showed a status line when running in 
the foreground so the user knows that Mercurial is running. I am not 
convinced that it also should do that when running as a daemon. Whoever 
started it that way must have a clear expectation of what it will do and 
has no use of a status message and I think it should stay quiet in that 
case. (That would also make the changes to the test suite less invasive.)

Others might have other opinions ;-)

> diff -r 3d1d16b19e7d -r d3fe362ba108 mercurial/commands.py
> --- a/mercurial/commands.py Fri Feb 28 02:09:00 2014 +0100
> +++ b/mercurial/commands.py Mon Mar 24 23:13:02 2014 +0530
> @@ -5237,14 +5237,15 @@
>           self.httpd = hgweb_server.create_server(self.ui, self.app)
>
>           if self.opts['port'] and not self.ui.verbose:
> -            return
> +            port = ":%d" % self.opts['port']
> +        else:
> +            port = ':%d' % self.httpd.port
>
>           if self.httpd.prefix:
>               prefix = self.httpd.prefix.strip('/') + '/'
>           else:
>               prefix = ''
>
> -        port = ':%d' % self.httpd.port
>           if port == ':80':
>               port = ''
>
> diff -r 3d1d16b19e7d -r d3fe362ba108 tests/run-tests.py
> --- a/tests/run-tests.py Fri Feb 28 02:09:00 2014 +0100
> +++ b/tests/run-tests.py Mon Mar 24 23:13:02 2014 +0530
> @@ -57,6 +57,7 @@
>   import threading
>   import killdaemons as killmod
>   import Queue as queue
> +import socket
>
>   processlock = threading.Lock()
>
> @@ -359,6 +360,7 @@
>       env["HGPORT"] = str(port)
>       env["HGPORT1"] = str(port + 1)
>       env["HGPORT2"] = str(port + 2)
> +    env["HOSTNAME"] = socket.getfqdn()

Is this actually used? Or is it just to make $HOSTNAME more consistent?

>       env["HGRCPATH"] = os.path.join(threadtmp, '.hgrc')
>       env["DAEMON_PIDS"] = os.path.join(threadtmp, 'daemon.pids')
>       env["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
> @@ -961,6 +963,7 @@
>           (r':%s\b' % port, ':$HGPORT'),
>           (r':%s\b' % (port + 1), ':$HGPORT1'),
>           (r':%s\b' % (port + 2), ':$HGPORT2'),
> +        (r'%s\b' % socket.getfqdn(), '$HOSTNAME'),

I am a bit concerned that getfqdn actually calls out to "the os" and 
possibly the network twice for each test, no matter if it use web stuff 
or not. That could increase the test execution time on badly configured 
machines. It is probably not significant considering all the other 
things that happens, but I think it would be slightly more safe to have 
a global 'fqdn = socket.getfqdn()'.

A bigger concern is that this not exactly is the algorithm Mercurial 
uses to determine what to print out. The tests might thus fail on 
machines with odd (but not necessarily incorrect) configurations.

The actual hostname is not relevant for this change so I think I would 
suggest just using * globbing for the hostname in the tests (even though 
it will be a bit confusing when the lines already have $HGPORT 
substitutions and contain a *).

A follow-up patch could add a check for the globbing to check-code.py .

/Mads

Patch

diff -r 3d1d16b19e7d -r d3fe362ba108 mercurial/commands.py
--- a/mercurial/commands.py Fri Feb 28 02:09:00 2014 +0100
+++ b/mercurial/commands.py Mon Mar 24 23:13:02 2014 +0530
@@ -5237,14 +5237,15 @@ 
         self.httpd = hgweb_server.create_server(self.ui, self.app)

         if self.opts['port'] and not self.ui.verbose:
-            return
+            port = ":%d" % self.opts['port']
+        else:
+            port = ':%d' % self.httpd.port

         if self.httpd.prefix:
             prefix = self.httpd.prefix.strip('/') + '/'
         else:
             prefix = ''

-        port = ':%d' % self.httpd.port
         if port == ':80':
             port = ''

diff -r 3d1d16b19e7d -r d3fe362ba108 tests/run-tests.py
--- a/tests/run-tests.py Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/run-tests.py Mon Mar 24 23:13:02 2014 +0530
@@ -57,6 +57,7 @@ 
 import threading
 import killdaemons as killmod
 import Queue as queue
+import socket

 processlock = threading.Lock()

@@ -359,6 +360,7 @@ 
     env["HGPORT"] = str(port)
     env["HGPORT1"] = str(port + 1)
     env["HGPORT2"] = str(port + 2)
+    env["HOSTNAME"] = socket.getfqdn()
     env["HGRCPATH"] = os.path.join(threadtmp, '.hgrc')
     env["DAEMON_PIDS"] = os.path.join(threadtmp, 'daemon.pids')
     env["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
@@ -961,6 +963,7 @@ 
         (r':%s\b' % port, ':$HGPORT'),
         (r':%s\b' % (port + 1), ':$HGPORT1'),
         (r':%s\b' % (port + 2), ':$HGPORT2'),
+        (r'%s\b' % socket.getfqdn(), '$HOSTNAME'),
         ]
     if os.name == 'nt':
         replacements.append(
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-archive.t
--- a/tests/test-archive.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-archive.t Mon Mar 24 23:13:02 2014 +0530
@@ -32,18 +32,21 @@ 
 check http return codes

   $ test_archtype gz tar.gz tar.bz2 zip
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   % gz allowed should give 200
   200 Script output follows
   % tar.bz2 and zip disallowed should both give 403
   403 Archive type not allowed: bz2
   403 Archive type not allowed: zip
   $ test_archtype bz2 tar.bz2 zip tar.gz
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   % bz2 allowed should give 200
   200 Script output follows
   % zip and tar.gz disallowed should both give 403
   403 Archive type not allowed: zip
   403 Archive type not allowed: gz
   $ test_archtype zip zip tar.gz tar.bz2
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   % zip allowed should give 200
   200 Script output follows
   % tar.gz and tar.bz2 disallowed should both give 403
@@ -52,6 +55,7 @@ 

   $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 invalid arch type should give 404
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-bookmarks-pushpull.t Mon Mar 24 23:13:02 2014 +0530
@@ -269,6 +269,7 @@ 
   > EOF

   $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat ../hg2.pid >> $DAEMON_PIDS

   $ hg push http://localhost:$HGPORT2/
@@ -332,6 +333,7 @@ 
   > EOF

   $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat ../hg.pid >> $DAEMON_PIDS
   $ cd ../a

diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-fetch.t
--- a/tests/test-fetch.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-fetch.t Mon Mar 24 23:13:02 2014 +0530
@@ -65,6 +65,7 @@ 
   b
   c
   $ hg --cwd a serve -a localhost -p $HGPORT -d --pid-file=hg.pid
+  listening at http://localhost:$HGPORT/ (bound to 127.0.0.1:$HGPORT)
   $ cat a/hg.pid >> "$DAEMON_PIDS"

 fetch over http, no auth
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-getbundle.t
--- a/tests/test-getbundle.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-getbundle.t Mon Mar 24 23:13:02 2014 +0530
@@ -171,6 +171,7 @@ 
 Get everything:

   $ hg serve -R repo -p $HGPORT -d --pid-file=hg.pid -E error.log -A access.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg debuggetbundle http://localhost:$HGPORT/ bundle
   $ hg debugbundle bundle
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-help.t
--- a/tests/test-help.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-help.t Mon Mar 24 23:13:02 2014 +0530
@@ -1010,6 +1010,7 @@ 

   $ hg init "$TESTTMP/test"
   $ hg serve -R "$TESTTMP/test" -n test -p $HGPORT -d --pid-file=hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT "help"
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb-commands.t Mon Mar 24 23:13:02 2014 +0530
@@ -36,6 +36,7 @@ 
   $ echo stable.width = 3 >> .hg/hgrc
   $ echo stable.color = FF0000 >> .hg/hgrc
   $ hg serve --config server.uncompressed=False -n test -p $HGPORT -d
--pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg log -G --template '{rev}:{node|short} {desc}\n'
   @  3:cad8025a2e87 branch commit with null character: \x00 (esc)
@@ -1434,6 +1435,7 @@ 
   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
   $ HGENCODING=cp932 hg serve --config server.preferuncompressed=True -n test \
   >     -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 commit message with Japanese Kanji 'Noh', which ends with '\x5c'
@@ -1483,6 +1485,7 @@ 
   $ hg serve --config server.uncompressed=False \
   >          --config web.maxshortchanges=2 \
   >          -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg log -G --template '{rev}:{node|short} {desc}\n'
   @  5:aed2d9c1d0e7 5
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb-descend-empties.t
--- a/tests/test-hgweb-descend-empties.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb-descend-empties.t Mon Mar 24 23:13:02 2014 +0530
@@ -25,6 +25,7 @@ 
   adding d1/d2/d3/d4/foo
   adding d1/d2/foo
   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 manifest with descending
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb-diffs.t Mon Mar 24 23:13:02 2014 +0530
@@ -32,6 +32,7 @@ 
 set up hgweb

   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 revision
@@ -296,6 +297,7 @@ 

   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
   $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d
--pid-file=hg.pid -A access.log -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 revision
@@ -958,6 +960,7 @@ 
   > diffblock = 'Block: {blockno}\n{lines}\n'
   > EOF
   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'raw-rev/0'
   200 Script output follows
@@ -980,6 +983,7 @@ 
   $ rm .hg/hgrc rawdiff/map
   $ rmdir rawdiff
   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 errors
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb-empty.t
--- a/tests/test-hgweb-empty.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb-empty.t Mon Mar 24 23:13:02 2014 +0530
@@ -5,6 +5,7 @@ 
   $ hg init test
   $ cd test
   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT 'shortlog')
   200 Script output follows
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb-filelog.t
--- a/tests/test-hgweb-filelog.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb-filelog.t Mon Mar 24 23:13:02 2014 +0530
@@ -105,6 +105,7 @@ 
   +b

   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 tip - two revisions
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb-raw.t
--- a/tests/test-hgweb-raw.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb-raw.t Mon Mar 24 23:13:02 2014 +0530
@@ -15,6 +15,7 @@ 
   $ hg commit -d "1 0" -m "Just some text"

   $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)

   $ cat hg.pid >> $DAEMON_PIDS
   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT
'?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw' content-type
content-length content-disposition) >getoutput.txt
@@ -37,6 +38,7 @@ 
   $ rm access.log error.log
   $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid \
   > --config web.guessmime=True
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)

   $ cat hg.pid >> $DAEMON_PIDS
   $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT
'?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw' content-type
content-length content-disposition) >getoutput.txt
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb-removed.t Mon Mar 24 23:13:02 2014 +0530
@@ -13,6 +13,7 @@ 
 set up hgweb

   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 revision
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgweb.t
--- a/tests/test-hgweb.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgweb.t Mon Mar 24 23:13:02 2014 +0530
@@ -11,6 +11,7 @@ 
   adding da/foo
   adding foo
   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 manifest
@@ -303,6 +304,7 @@ 

   $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 Test the access/error files are opened in append mode
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgwebdir.t
--- a/tests/test-hgwebdir.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgwebdir.t Mon Mar 24 23:13:02 2014 +0530
@@ -73,6 +73,7 @@ 
   > EOF
   $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-1.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 should give a 404 - file does not exist
@@ -134,6 +135,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-2.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS

 should succeed, slashy names
@@ -845,6 +847,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-3.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/?style=raw'
   200 Script output follows
@@ -910,6 +913,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-4.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 'coll/?style=raw'
   200 Script output follows
@@ -974,6 +978,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-5.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
@@ -1000,6 +1005,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-6.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
@@ -1024,6 +1030,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-7.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
@@ -1046,6 +1053,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf paths.conf \
   >     -A access-paths.log -E error-paths-8.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS

 test inexistent and inaccessible repo should be ignored silently
@@ -1101,6 +1109,7 @@ 
   $ hg serve --config web.baseurl=http://hg.example.com:8080/ -p $HGPORT2 -d \
   >     --pid-file=hg.pid --webdir-conf collections.conf \
   >     -A access-collections.log -E error-collections.log
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat hg.pid >> $DAEMON_PIDS

 collections: should succeed
@@ -1144,6 +1153,7 @@ 
   $ hg serve --config web.baseurl=http://hg.example.com:8080/foo/ -p
$HGPORT2 -d \
   >     --pid-file=hg.pid --webdir-conf collections.conf \
   >     -A access-collections-2.log -E error-collections-2.log
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat hg.pid >> $DAEMON_PIDS

 atom-log with basedir /foo/
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-hgwebdirsym.t
--- a/tests/test-hgwebdirsym.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-hgwebdirsym.t Mon Mar 24 23:13:02 2014 +0530
@@ -29,6 +29,7 @@ 
   > EOF
   $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
   >     -A access-collections.log -E error-collections.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 should succeed
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-highlight.t
--- a/tests/test-highlight.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-highlight.t Mon Mar 24 23:13:02 2014 +0530
@@ -51,6 +51,7 @@ 
 hg serve

   $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 hgweb filerevision, html
@@ -558,6 +559,7 @@ 
 hg serve again

   $ hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 hgweb highlightcss fruity
@@ -593,14 +595,17 @@ 
   > }
   $ hgserveget euc-jp eucjp.txt
   % HGENCODING=euc-jp hg serve
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   % hgweb filerevision, html
   % errors encountered
   $ hgserveget utf-8 eucjp.txt
   % HGENCODING=utf-8 hg serve
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   % hgweb filerevision, html
   % errors encountered
   $ hgserveget us-ascii eucjp.txt
   % HGENCODING=us-ascii hg serve
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   % hgweb filerevision, html
   % errors encountered

diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-http-clone-r.t
--- a/tests/test-http-clone-r.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-http-clone-r.t Mon Mar 24 23:13:02 2014 +0530
@@ -16,6 +16,7 @@ 
 Starting server

   $ hg serve -p $HGPORT -E ../error.log -d --pid-file=../hg1.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cd ..
   $ cat hg1.pid >> $DAEMON_PIDS

diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-http-proxy.t
--- a/tests/test-http-proxy.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-http-proxy.t Mon Mar 24 23:13:02 2014 +0530
@@ -6,6 +6,7 @@ 
   $ hg ci -Ama -d '1123456789 0'
   adding a
   $ hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ cd ..
   $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-http.t
--- a/tests/test-http.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-http.t Mon Mar 24 23:13:02 2014 +0530
@@ -13,7 +13,9 @@ 
   adding foo.d/baR.d.hg/bAR
   adding foo.d/foo
   $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ hg --config server.uncompressed=False serve -p $HGPORT1 -d
--pid-file=../hg2.pid
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)

 Test server address cannot be reused

@@ -155,6 +157,7 @@ 
   $ hg --config extensions.x=userpass.py serve -p $HGPORT2 -d --pid-file=pid \
   >    --config server.preferuncompressed=True \
   >    --config web.push_ssl=False --config web.allow_push=* -A ../access.log
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat pid >> $DAEMON_PIDS

   $ cat << EOF > get_pass.py
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-https.t
--- a/tests/test-https.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-https.t Mon Mar 24 23:13:02 2014 +0530
@@ -94,6 +94,7 @@ 
   adding foo.d/baR.d.hg/bAR
   adding foo.d/foo
   $ hg serve -p $HGPORT -d --pid-file=../hg0.pid --certificate=$PRIV
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat ../hg0.pid >> $DAEMON_PIDS

 cacert not found
@@ -204,6 +205,7 @@ 
 Test server cert which isn't valid yet

   $ hg -R test serve -p $HGPORT1 -d --pid-file=hg1.pid
--certificate=server-not-yet.pem
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg1.pid >> $DAEMON_PIDS
   $ hg -R copy-pull pull --config web.cacerts=pub-not-yet.pem
https://localhost:$HGPORT1/
   abort: error: *:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (glob)
@@ -212,6 +214,7 @@ 
 Test server cert which no longer is valid

   $ hg -R test serve -p $HGPORT2 -d --pid-file=hg2.pid
--certificate=server-expired.pem
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat hg2.pid >> $DAEMON_PIDS
   $ hg -R copy-pull pull --config web.cacerts=pub-expired.pem
https://localhost:$HGPORT2/
   abort: error: *:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (glob)
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-identify.t
--- a/tests/test-identify.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-identify.t Mon Mar 24 23:13:02 2014 +0530
@@ -64,6 +64,7 @@ 

   $ cd test
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg id http://localhost:$HGPORT1/
   cb9a9f314b8b
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-incoming-outgoing.t
--- a/tests/test-incoming-outgoing.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-incoming-outgoing.t Mon Mar 24 23:13:02 2014 +0530
@@ -14,6 +14,7 @@ 
   checking files
   1 files, 9 changesets, 9 total revisions
   $ hg serve -p $HGPORT -d --pid-file=hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ cd ..

diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-keyword.t
--- a/tests/test-keyword.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-keyword.t Mon Mar 24 23:13:02 2014 +0530
@@ -951,6 +951,7 @@ 
  - check errors

   $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
   200 Script output follows
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-known.t
--- a/tests/test-known.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-known.t Mon Mar 24 23:13:02 2014 +0530
@@ -27,6 +27,7 @@ 
 Test via HTTP:

   $ hg serve -R repo -p $HGPORT -d --pid-file=hg.pid -E error.log -A access.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg debugknown http://localhost:$HGPORT/
991a3460af53952d10ec8a295d3d2cc2e5fa9690
0e067c57feba1a5694ca4844f05588bb1bf82342
3903775176ed42b1458a6281db4a0ccf4d9f287a
   111
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-largefiles-cache.t
--- a/tests/test-largefiles-cache.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-largefiles-cache.t Mon Mar 24 23:13:02 2014 +0530
@@ -119,6 +119,7 @@ 

   $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
   >          --config "web.allow_push=*" --config web.push_ssl=no
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

   $ echo change >> large
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-largefiles.t
--- a/tests/test-largefiles.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-largefiles.t Mon Mar 24 23:13:02 2014 +0530
@@ -221,6 +221,7 @@ 
 Test display of largefiles in hgweb

   $ hg serve -d -p $HGPORT --pid-file ../hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat ../hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
   200 Script output follows
@@ -1543,6 +1544,7 @@ 
   A f1
   $ cd ..
   $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
   requesting all changes
@@ -1555,6 +1557,7 @@ 

 largefiles clients still work with vanilla servers
   $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1
--pid-file hg.pid
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT1 r3
   requesting all changes
@@ -1609,6 +1612,7 @@ 

 #if serve
   $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
   abort: remote error:
@@ -1658,6 +1662,7 @@ 
   Invoking status precommit hook
   A f2
   $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT
--pid-file ../hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat ../hg.pid >> $DAEMON_PIDS
   $ hg push http://localhost:$HGPORT
   pushing to http://localhost:$HGPORT/
@@ -1674,6 +1679,7 @@ 
   $ hg init empty
   $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
   >   --config 'web.allow_push=*' --config web.push_ssl=False
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg push -R r7 http://localhost:$HGPORT1
   pushing to http://localhost:$HGPORT1/
@@ -1706,6 +1712,7 @@ 
   $ hg init empty
   $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
   >   --config 'web.allow_push=*' --config web.push_ssl=False
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat hg.pid >> $DAEMON_PIDS
   $ rm "${USERCACHE}"/*
   $ hg push -R r8 http://localhost:$HGPORT2/#default
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-mq-qclone-http.t
--- a/tests/test-mq-qclone-http.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-mq-qclone-http.t Mon Mar 24 23:13:02 2014 +0530
@@ -33,6 +33,7 @@ 
   > EOF
   $ hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
   >     -A access-paths.log -E error-paths-1.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '?style=raw'
   200 Script output follows
@@ -72,6 +73,7 @@ 
   > EOF
   $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections1.conf \
   >     -A access-paths.log -E error-paths-1.log
+  listening at http://$HOSTNAME:$HGPORT1/ (bound to *:$HGPORT1)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '?style=raw'
   200 Script output follows
@@ -111,6 +113,7 @@ 
   > EOF
   $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \
   >     -A access-paths.log -E error-paths-1.log
+  listening at http://$HOSTNAME:$HGPORT2/ (bound to *:$HGPORT2)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '?style=raw'
   200 Script output follows
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-mq-qimport.t
--- a/tests/test-mq-qimport.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-mq-qimport.t Mon Mar 24 23:13:02 2014 +0530
@@ -255,6 +255,7 @@ 
   $ hg ci -Am patch
   adding a
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

   $ cd ../repo
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-obsolete.t
--- a/tests/test-obsolete.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-obsolete.t Mon Mar 24 23:13:02 2014 +0530
@@ -725,6 +725,7 @@ 
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved

   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 check changelog view
@@ -757,6 +758,7 @@ 
   > EOF
   $ wait
   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67'
   200 Script output follows
   $ "$TESTDIR/killdaemons.py" hg.pid
@@ -842,6 +844,7 @@ 
 #if serve

   $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d
--pid-file=hg.pid -A access.log -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

   $ hg incoming http://localhost:$HGPORT
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-phases-exchange.t
--- a/tests/test-phases-exchange.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-phases-exchange.t Mon Mar 24 23:13:02 2014 +0530
@@ -972,6 +972,7 @@ 

   $ cd ../beta
   $ hg serve -p $HGPORT -d --pid-file=../beta.pid -E ../beta-error.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat ../beta.pid >> $DAEMON_PIDS
   $ cd ../gamma

diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-pull-http.t
--- a/tests/test-pull-http.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-pull-http.t Mon Mar 24 23:13:02 2014 +0530
@@ -16,6 +16,7 @@ 
 Cloning with a password in the URL should not save the password in .hg/hgrc:

   $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg clone http://foo:xyzzy@localhost:$HGPORT/ test3
   requesting all changes
@@ -35,6 +36,7 @@ 
   $ echo '[web]' > .hg/hgrc
   $ echo 'allowpull = false' >> .hg/hgrc
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg clone http://localhost:$HGPORT/ test4
   requesting all changes
@@ -57,6 +59,7 @@ 
 expect error, pulling not allowed

   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pulling from http://localhost:$HGPORT/
   abort: authorization failed
   % serve errors
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-pull.t
--- a/tests/test-pull.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-pull.t Mon Mar 24 23:13:02 2014 +0530
@@ -16,6 +16,7 @@ 
   1 files, 1 changesets, 1 total revisions

   $ hg serve -p $HGPORT -d --pid-file=hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ cd ..

diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-push-http.t
--- a/tests/test-push-http.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-push-http.t Mon Mar 24 23:13:02 2014 +0530
@@ -27,6 +27,7 @@ 
 expect ssl error

   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   abort: HTTP Error 403: ssl required
@@ -38,6 +39,7 @@ 
   $ echo '[web]' > .hg/hgrc
   $ echo 'push_ssl = false' >> .hg/hgrc
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   abort: authorization failed
@@ -48,6 +50,7 @@ 

   $ echo 'allow_push = unperson' >> .hg/hgrc
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   abort: authorization failed
@@ -61,13 +64,14 @@ 
   $ echo "changegroup = python \"$TESTDIR/printenv.py\" changegroup
0" >> .hg/hgrc
   $ echo "pushkey = python \"$TESTDIR/printenv.py\" pushkey 0" >> .hg/hgrc
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: changegroup hook:
HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
HG_URL=remote:http:*: (glob)
+  remote: changegroup hook:
HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
HG_URL=remote:http:127.0.0.1:
   remote: pushkey hook:
HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
HG_NEW=0 HG_OLD=1 HG_RET=1
   % serve errors
   $ hg rollback
@@ -78,13 +82,14 @@ 
   $ CAP=httpheader
   $ . "$TESTDIR/notcapable"
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: changegroup hook:
HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
HG_URL=remote:http:*: (glob)
+  remote: changegroup hook:
HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
HG_URL=remote:http:127.0.0.1:
   remote: pushkey hook:
HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
HG_NEW=0 HG_OLD=1 HG_RET=1
   % serve errors
   $ hg rollback
@@ -95,13 +100,14 @@ 
   $ CAP=unbundlehash
   $ . "$TESTDIR/notcapable"
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: changegroup hook:
HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
HG_URL=remote:http:*: (glob)
+  remote: changegroup hook:
HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve
HG_URL=remote:http:127.0.0.1:
   remote: pushkey hook:
HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases
HG_NEW=0 HG_OLD=1 HG_RET=1
   % serve errors
   $ hg rollback
@@ -117,6 +123,7 @@ 
   > prepushkey = python "$TESTDIR/printenv.py" prepushkey 1
   > EOF
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   remote: adding changesets
@@ -131,6 +138,7 @@ 

   $ echo "prepushkey = python \"$TESTDIR/printenv.py\" prepushkey 0"
>> .hg/hgrc
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   no changes found
@@ -146,6 +154,7 @@ 
   $ echo 'push_ssl = false' >> .hg/hgrc
   $ echo 'deny_push = *' >> .hg/hgrc
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   abort: authorization failed
@@ -156,6 +165,7 @@ 

   $ echo 'deny_push = unperson' >> .hg/hgrc
   $ req
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   pushing to http://localhost:$HGPORT/
   searching for changes
   abort: authorization failed
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-rollback.t
--- a/tests/test-rollback.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-rollback.t Mon Mar 24 23:13:02 2014 +0530
@@ -125,6 +125,7 @@ 
 #if serve
   $ hg commit -m "precious commit message"
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ cd ..
   $ hg clone http://localhost:$HGPORT u
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-schemes.t
--- a/tests/test-schemes.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-schemes.t Mon Mar 24 23:13:02 2014 +0530
@@ -24,6 +24,7 @@ 
 http scheme

   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ hg incoming l://
   comparing with l://
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-serve.t
--- a/tests/test-serve.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-serve.t Mon Mar 24 23:13:02 2014 +0530
@@ -21,6 +21,7 @@ 
 Without -v

   $ hg serve -a localhost -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  listening at http://localhost:$HGPORT/ (bound to 127.0.0.1:$HGPORT)
   $ cat hg.pid >> "$DAEMON_PIDS"
   $ if [ -f access.log ]; then
   >     echo 'access log created - .hg/hgrc respected'
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-share.t
--- a/tests/test-share.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-share.t Mon Mar 24 23:13:02 2014 +0530
@@ -98,6 +98,7 @@ 
 hg serve shared clone

   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS
   $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'raw-file/'
   200 Script output follows
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-subrepo-relative-path.t
--- a/tests/test-subrepo-relative-path.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-subrepo-relative-path.t Mon Mar 24 23:13:02 2014 +0530
@@ -37,6 +37,7 @@ 
   $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
   $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
   >    -A /dev/null -E /dev/null --pid-file hg.pid -d
+  listening at http://localhost:$HGPORT/ (bound to 127.0.0.1:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 Clone main from hgweb
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-transplant.t
--- a/tests/test-transplant.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-transplant.t Mon Mar 24 23:13:02 2014 +0530
@@ -264,6 +264,7 @@ 
 remote transplant with pull

   $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat ../t.pid >> $DAEMON_PIDS

   $ hg clone -r 0 ../t ../rp
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-treediscovery-legacy.t
--- a/tests/test-treediscovery-legacy.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-treediscovery-legacy.t Mon Mar 24 23:13:02 2014 +0530
@@ -42,6 +42,7 @@ 
   $ hg init empty1
   $ hg init empty2
   $ tstart empty2
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ hg incoming -R empty1 $remote
   comparing with http://localhost:$HGPORT/
   no changes found
@@ -91,6 +92,7 @@ 

   $ cd ..
   $ tstart main
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)

 Full clone:

@@ -211,6 +213,7 @@ 
 Remote is empty:

   $ tstop ; tstart empty2
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cd main
   $ hg incoming $remote
   comparing with http://localhost:$HGPORT/
@@ -261,6 +264,7 @@ 
   updating to branch name2
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ tstart subset2
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cd main
   $ hg incoming $remote
   comparing with http://localhost:$HGPORT/
@@ -303,6 +307,7 @@ 
 Partial pull:

   $ tstop ; tstart main
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ hg clone $remote partial --rev name2
   abort: partial pull cannot be done because other repository doesn't
support changegroupsubset.
   [255]
@@ -337,6 +342,7 @@ 
   adding B
   $ cd ..
   $ tstart rremote
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)

   $ cd rlocal
   $ hg incoming $remote
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-treediscovery.t
--- a/tests/test-treediscovery.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-treediscovery.t Mon Mar 24 23:13:02 2014 +0530
@@ -29,6 +29,7 @@ 
   $ hg init empty1
   $ hg init empty2
   $ tstart empty2
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ hg incoming -R empty1 $remote
   comparing with http://localhost:$HGPORT/
   no changes found
@@ -78,6 +79,7 @@ 

   $ cd ..
   $ tstart main
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)

 Full clone:

@@ -192,6 +194,7 @@ 
 Remote is empty:

   $ tstop ; tstart empty2
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cd main
   $ hg incoming $remote
   comparing with http://localhost:$HGPORT/
@@ -242,6 +245,7 @@ 
   updating to branch name2
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ tstart subset2
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cd main
   $ hg incoming $remote
   comparing with http://localhost:$HGPORT/
@@ -284,6 +288,7 @@ 
 Partial pull:

   $ tstop ; tstart main
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ hg clone $remote partial --rev name2
   adding changesets
   adding manifests
@@ -331,6 +336,7 @@ 
   $ hg clone main repo2a --rev name2 -q
   $ hg clone repo2a repo2b -q
   $ tstart repo1a
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)

   $ cd repo2a
   $ hg incoming $remote
@@ -374,6 +380,7 @@ 
   $ cd ..

   $ tstop ; tstart repo1b
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cd repo2b
   $ hg incoming $remote
   comparing with http://localhost:$HGPORT/
@@ -424,6 +431,7 @@ 
   $ hg clone main repo2a --rev 4 --rev 7 -q
   $ hg clone repo2a repo2b -q
   $ tstart repo1a
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)

   $ cd repo2a
   $ hg incoming $remote
@@ -462,6 +470,7 @@ 
   $ cd ..

   $ tstop ; tstart repo1b
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cd repo2b
   $ hg incoming $remote
   comparing with http://localhost:$HGPORT/
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-unbundlehash.t
--- a/tests/test-unbundlehash.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-unbundlehash.t Mon Mar 24 23:13:02 2014 +0530
@@ -6,6 +6,7 @@ 

   $ hg init remote
   $ hg serve -R remote --config web.push_ssl=False --config
web.allow_push=* -p $HGPORT -d --pid-file=hg1.pid -E error.log -A
access.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg1.pid >> $DAEMON_PIDS

 Clone the repository and push a change.
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-websub.t
--- a/tests/test-websub.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-websub.t Mon Mar 24 23:13:02 2014 +0530
@@ -23,6 +23,7 @@ 
   $ hg commit -d '1 0' -m 'Issue123: fixed the bug!'

   $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E
errors.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg.pid >> $DAEMON_PIDS

 log
diff -r 3d1d16b19e7d -r d3fe362ba108 tests/test-wireproto.t
--- a/tests/test-wireproto.t Fri Feb 28 02:09:00 2014 +0100
+++ b/tests/test-wireproto.t Mon Mar 24 23:13:02 2014 +0530
@@ -20,6 +20,7 @@ 
 HTTP:

   $ hg serve -R repo -p $HGPORT -d --pid-file=hg1.pid -E error.log -A
access.log
+  listening at http://$HOSTNAME:$HGPORT/ (bound to *:$HGPORT)
   $ cat hg1.pid >> $DAEMON_PIDS