Mercurial > public > mercurial-scm > hg-stable
comparison hgext/fastannotate/protocol.py @ 39560:2182e67ea912
fastannotate: use repo.local()
This is the proper way to check whether we're dealing with a local
repository, since extensions should be coding to an interface and
not testing for exact types.
Differential Revision: https://phab.mercurial-scm.org/D4542
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 07 Sep 2018 18:35:54 -0700 |
parents | bb2b462f81da |
children | b220851999b5 |
comparison
equal
deleted
inserted
replaced
39559:0a5f7e16ec96 | 39560:2182e67ea912 |
---|---|
12 from mercurial.i18n import _ | 12 from mercurial.i18n import _ |
13 from mercurial import ( | 13 from mercurial import ( |
14 error, | 14 error, |
15 extensions, | 15 extensions, |
16 hg, | 16 hg, |
17 localrepo, | |
18 util, | 17 util, |
19 wireprotov1peer, | 18 wireprotov1peer, |
20 wireprotov1server, | 19 wireprotov1server, |
21 ) | 20 ) |
22 from . import context | 21 from . import context |
219 self.ui.debug('fastannotate: prefetch failed: %r\n' % ex) | 218 self.ui.debug('fastannotate: prefetch failed: %r\n' % ex) |
220 repo.__class__ = fastannotaterepo | 219 repo.__class__ = fastannotaterepo |
221 | 220 |
222 def clientreposetup(ui, repo): | 221 def clientreposetup(ui, repo): |
223 _registerwireprotocommand() | 222 _registerwireprotocommand() |
224 if isinstance(repo, localrepo.localrepository): | 223 if repo.local(): |
225 localreposetup(ui, repo) | 224 localreposetup(ui, repo) |
226 # TODO: this mutates global state, but only if at least one repo | 225 # TODO: this mutates global state, but only if at least one repo |
227 # has the extension enabled. This is probably bad for hgweb. | 226 # has the extension enabled. This is probably bad for hgweb. |
228 if peersetup not in hg.wirepeersetupfuncs: | 227 if peersetup not in hg.wirepeersetupfuncs: |
229 hg.wirepeersetupfuncs.append(peersetup) | 228 hg.wirepeersetupfuncs.append(peersetup) |