##// END OF EJS Templates
fastannotate: move some global state mutation to extsetup()...
Augie Fackler -
r39247:8da20fc9 default
parent child Browse files
Show More
@@ -100,8 +100,6 b' annotate cache greatly. Run "debugbuildl'
100 #
100 #
101 # * rename the config knob for updating the local cache from a remote server
101 # * rename the config knob for updating the local cache from a remote server
102 #
102 #
103 # * move various global-setup bits to extsetup() or reposetup()
104 #
105 # * move `flock` based locking to a common area
103 # * move `flock` based locking to a common area
106 #
104 #
107 # * revise wireprotocol for sharing annotate files
105 # * revise wireprotocol for sharing annotate files
@@ -185,7 +183,9 b' def uisetup(ui):'
185 if ui.configbool('fastannotate', 'useflock', _flockavailable()):
183 if ui.configbool('fastannotate', 'useflock', _flockavailable()):
186 context.pathhelper.lock = context.pathhelper._lockflock
184 context.pathhelper.lock = context.pathhelper._lockflock
187
185
186 def extsetup(ui):
188 # fastannotate has its own locking, without depending on repo lock
187 # fastannotate has its own locking, without depending on repo lock
188 # TODO: avoid mutating this unless the specific repo has it enabled
189 localrepo.localrepository._wlockfreeprefix.add('fastannotate/')
189 localrepo.localrepository._wlockfreeprefix.add('fastannotate/')
190
190
191 def reposetup(ui, repo):
191 def reposetup(ui, repo):
@@ -223,5 +223,7 b' 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)
General Comments 0
You need to be logged in to leave comments. Login now