comparison hgext/fastannotate/commands.py @ 43115:4aa72cdf616f

py3: delete b'' prefix from safehasattr arguments Differential Revision: https://phab.mercurial-scm.org/D7029
author Martin von Zweigbergk <martinvonz@google.com>
date Sun, 06 Oct 2019 20:17:41 -0700
parents 687b865b95ad
children 8ff1ecfadcd1
comparison
equal deleted inserted replaced
43114:8197b395710e 43115:4aa72cdf616f
216 216
217 # paths will be used for prefetching and the real annotating 217 # paths will be used for prefetching and the real annotating
218 paths = list(_matchpaths(repo, rev, pats, opts, aopts)) 218 paths = list(_matchpaths(repo, rev, pats, opts, aopts))
219 219
220 # for client, prefetch from the server 220 # for client, prefetch from the server
221 if util.safehasattr(repo, b'prefetchfastannotate'): 221 if util.safehasattr(repo, 'prefetchfastannotate'):
222 repo.prefetchfastannotate(paths) 222 repo.prefetchfastannotate(paths)
223 223
224 for path in paths: 224 for path in paths:
225 result = lines = existinglines = None 225 result = lines = existinglines = None
226 while True: 226 while True:
271 if ui.configbool(b'fastannotate', b'forcetext'): 271 if ui.configbool(b'fastannotate', b'forcetext'):
272 opts[r'text'] = True 272 opts[r'text'] = True
273 273
274 # check if we need to do prefetch (client-side) 274 # check if we need to do prefetch (client-side)
275 rev = opts.get(r'rev') 275 rev = opts.get(r'rev')
276 if util.safehasattr(repo, b'prefetchfastannotate') and rev is not None: 276 if util.safehasattr(repo, 'prefetchfastannotate') and rev is not None:
277 paths = list(_matchpaths(repo, rev, pats, pycompat.byteskwargs(opts))) 277 paths = list(_matchpaths(repo, rev, pats, pycompat.byteskwargs(opts)))
278 repo.prefetchfastannotate(paths) 278 repo.prefetchfastannotate(paths)
279 279
280 return orig(ui, repo, *pats, **opts) 280 return orig(ui, repo, *pats, **opts)
281 281
318 if ui.configbool(b'fastannotate', b'unfilteredrepo'): 318 if ui.configbool(b'fastannotate', b'unfilteredrepo'):
319 repo = repo.unfiltered() 319 repo = repo.unfiltered()
320 ctx = scmutil.revsingle(repo, rev) 320 ctx = scmutil.revsingle(repo, rev)
321 m = scmutil.match(ctx, pats, opts) 321 m = scmutil.match(ctx, pats, opts)
322 paths = list(ctx.walk(m)) 322 paths = list(ctx.walk(m))
323 if util.safehasattr(repo, b'prefetchfastannotate'): 323 if util.safehasattr(repo, 'prefetchfastannotate'):
324 # client 324 # client
325 if opts.get(b'REV'): 325 if opts.get(b'REV'):
326 raise error.Abort(_(b'--rev cannot be used for client')) 326 raise error.Abort(_(b'--rev cannot be used for client'))
327 repo.prefetchfastannotate(paths) 327 repo.prefetchfastannotate(paths)
328 else: 328 else: