##// END OF EJS Templates
zeroconf: notify the Zeroconf threads when hg exits...
Nicolas Dumazet -
r14104:23fc62e0 stable
parent child Browse files
Show More
@@ -27,7 +27,7 b' You can discover Zeroconf-enabled reposi'
27 27 import socket, time, os
28 28
29 29 import Zeroconf
30 from mercurial import ui, hg, encoding, util
30 from mercurial import ui, hg, encoding, util, dispatch
31 31 from mercurial import extensions
32 32 from mercurial.hgweb import hgweb_mod
33 33 from mercurial.hgweb import hgwebdir_mod
@@ -166,6 +166,18 b' def defaultdest(orig, source):'
166 166 return name.encode(encoding.encoding)
167 167 return orig(source)
168 168
169 def cleanupafterdispatch(orig, ui, options, cmd, cmdfunc):
170 try:
171 return orig(ui, options, cmd, cmdfunc)
172 finally:
173 # we need to call close() on the server to notify() the various
174 # threading Conditions and allow the background threads to exit
175 global server
176 if server:
177 server.close()
178
179 extensions.wrapfunction(dispatch, '_runcommand', cleanupafterdispatch)
180
169 181 extensions.wrapfunction(ui.ui, 'config', config)
170 182 extensions.wrapfunction(ui.ui, 'configitems', configitems)
171 183 extensions.wrapfunction(hg, 'defaultdest', defaultdest)
General Comments 0
You need to be logged in to leave comments. Login now