comparison hgext/fastannotate/__init__.py @ 43077:687b865b95ad

formatting: byteify all mercurial/ and hgext/ string literals Done with python3.7 contrib/byteify-strings.py -i $(hg files 'set:mercurial/**.py - mercurial/thirdparty/** + hgext/**.py - hgext/fsmonitor/pywatchman/** - mercurial/__init__.py') black -l 80 -t py33 -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**') # skip-blame mass-reformatting only Differential Revision: https://phab.mercurial-scm.org/D6972
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:48:39 -0400
parents 2372284d9457
children 6000f5b25c9b
comparison
equal deleted inserted replaced
43076:2372284d9457 43077:687b865b95ad
117 117
118 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for 118 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
119 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should 119 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
120 # be specifying the version(s) of Mercurial they are tested with, or 120 # be specifying the version(s) of Mercurial they are tested with, or
121 # leave the attribute unspecified. 121 # leave the attribute unspecified.
122 testedwith = 'ships-with-hg-core' 122 testedwith = b'ships-with-hg-core'
123 123
124 cmdtable = commands.cmdtable 124 cmdtable = commands.cmdtable
125 125
126 configtable = {} 126 configtable = {}
127 configitem = registrar.configitem(configtable) 127 configitem = registrar.configitem(configtable)
128 128
129 configitem('fastannotate', 'modes', default=['fastannotate']) 129 configitem(b'fastannotate', b'modes', default=[b'fastannotate'])
130 configitem('fastannotate', 'server', default=False) 130 configitem(b'fastannotate', b'server', default=False)
131 configitem('fastannotate', 'client', default=False) 131 configitem(b'fastannotate', b'client', default=False)
132 configitem('fastannotate', 'unfilteredrepo', default=True) 132 configitem(b'fastannotate', b'unfilteredrepo', default=True)
133 configitem('fastannotate', 'defaultformat', default=['number']) 133 configitem(b'fastannotate', b'defaultformat', default=[b'number'])
134 configitem('fastannotate', 'perfhack', default=False) 134 configitem(b'fastannotate', b'perfhack', default=False)
135 configitem('fastannotate', 'mainbranch') 135 configitem(b'fastannotate', b'mainbranch')
136 configitem('fastannotate', 'forcetext', default=True) 136 configitem(b'fastannotate', b'forcetext', default=True)
137 configitem('fastannotate', 'forcefollow', default=True) 137 configitem(b'fastannotate', b'forcefollow', default=True)
138 configitem('fastannotate', 'clientfetchthreshold', default=10) 138 configitem(b'fastannotate', b'clientfetchthreshold', default=10)
139 configitem('fastannotate', 'serverbuildondemand', default=True) 139 configitem(b'fastannotate', b'serverbuildondemand', default=True)
140 configitem('fastannotate', 'remotepath', default='default') 140 configitem(b'fastannotate', b'remotepath', default=b'default')
141 141
142 142
143 def uisetup(ui): 143 def uisetup(ui):
144 modes = set(ui.configlist('fastannotate', 'modes')) 144 modes = set(ui.configlist(b'fastannotate', b'modes'))
145 if 'fctx' in modes: 145 if b'fctx' in modes:
146 modes.discard('hgweb') 146 modes.discard(b'hgweb')
147 for name in modes: 147 for name in modes:
148 if name == 'fastannotate': 148 if name == b'fastannotate':
149 commands.registercommand() 149 commands.registercommand()
150 elif name == 'hgweb': 150 elif name == b'hgweb':
151 from . import support 151 from . import support
152 152
153 support.replacehgwebannotate() 153 support.replacehgwebannotate()
154 elif name == 'fctx': 154 elif name == b'fctx':
155 from . import support 155 from . import support
156 156
157 support.replacefctxannotate() 157 support.replacefctxannotate()
158 commands.wrapdefault() 158 commands.wrapdefault()
159 else: 159 else:
160 raise hgerror.Abort(_('fastannotate: invalid mode: %s') % name) 160 raise hgerror.Abort(_(b'fastannotate: invalid mode: %s') % name)
161 161
162 if ui.configbool('fastannotate', 'server'): 162 if ui.configbool(b'fastannotate', b'server'):
163 protocol.serveruisetup(ui) 163 protocol.serveruisetup(ui)
164 164
165 165
166 def extsetup(ui): 166 def extsetup(ui):
167 # fastannotate has its own locking, without depending on repo lock 167 # fastannotate has its own locking, without depending on repo lock
168 # TODO: avoid mutating this unless the specific repo has it enabled 168 # TODO: avoid mutating this unless the specific repo has it enabled
169 localrepo.localrepository._wlockfreeprefix.add('fastannotate/') 169 localrepo.localrepository._wlockfreeprefix.add(b'fastannotate/')
170 170
171 171
172 def reposetup(ui, repo): 172 def reposetup(ui, repo):
173 if ui.configbool('fastannotate', 'client'): 173 if ui.configbool(b'fastannotate', b'client'):
174 protocol.clientreposetup(ui, repo) 174 protocol.clientreposetup(ui, repo)