comparison hgext/fastannotate/protocol.py @ 39242:8da20fc9fc07

fastannotate: move some global state mutation to extsetup() Differential Revision: https://phab.mercurial-scm.org/D4202
author Augie Fackler <augie@google.com>
date Thu, 09 Aug 2018 15:08:32 -0400
parents 303dae0136b0
children eaa14dff3226
comparison
equal deleted inserted replaced
39241:303dae0136b0 39242:8da20fc9fc07
221 221
222 def clientreposetup(ui, repo): 222 def clientreposetup(ui, repo):
223 _registerwireprotocommand() 223 _registerwireprotocommand()
224 if isinstance(repo, localrepo.localrepository): 224 if isinstance(repo, localrepo.localrepository):
225 localreposetup(ui, repo) 225 localreposetup(ui, repo)
226 # TODO: this mutates global state, but only if at least one repo
227 # has the extension enabled. This is probably bad for hgweb.
226 if peersetup not in hg.wirepeersetupfuncs: 228 if peersetup not in hg.wirepeersetupfuncs:
227 hg.wirepeersetupfuncs.append(peersetup) 229 hg.wirepeersetupfuncs.append(peersetup)