Bug 3746 - zeroconf extension advertises wrong port number with "hg serve -p 0"
Summary: zeroconf extension advertises wrong port number with "hg serve -p 0"
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: earlier
Hardware: PC Linux
: normal bug
Assignee: Benoit Boissinot
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-29 12:13 UTC by Bill Trost
Modified: 2017-11-01 18:05 UTC (History)
3 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Trost 2012-12-29 12:13 UTC
As the transcript below shows, the zeroconf extensions uses the port number supplied on the command line rather than the port actually bound by "hg serve".

$ hg serve -p 0 
listening at http://thunder:43195/ (bound to *:43195)
^Z
[1]+  Stopped                 hg serve -p 0
$ bg
[1]+ hg serve -p 0 &
$ hg paths
default = http://hg.moinmo.in/moin/2.0
zc-thunder-moin-2 = http://192.168.1.101:0/
Comment 1 Benoit Boissinot 2012-12-30 13:56 UTC
Patch sent.
Comment 2 HG Bot 2013-01-02 01:49 UTC
Fixed by http://selenic.com/repo/hg/rev/d57879e72e18
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
zeroconf: use port from server instead of picking port from config (issue3746)

In order to get the port, wrap create server instead of
hgweb_mod/hgwebdir_mod.

(please test the fix)
Comment 3 HG Bot 2013-01-02 01:49 UTC
Fixed by http://selenic.com/repo/hg/rev/120e1160d17e
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
zeroconf: use port from server instead of picking port from config (issue3746)

In order to get the port, wrap create server instead of
hgweb_mod/hgwebdir_mod.

(please test the fix)