314 |
314 |
315 # experimental config: perf.run-limits |
315 # experimental config: perf.run-limits |
316 limitspec = ui.configlist(b"perf", b"run-limits", []) |
316 limitspec = ui.configlist(b"perf", b"run-limits", []) |
317 limits = [] |
317 limits = [] |
318 for item in limitspec: |
318 for item in limitspec: |
319 parts = item.split('-', 1) |
319 parts = item.split(b'-', 1) |
320 if len(parts) < 2: |
320 if len(parts) < 2: |
321 ui.warn(('malformatted run limit entry, missing "-": %s\n' |
321 ui.warn((b'malformatted run limit entry, missing "-": %s\n' |
322 % item)) |
322 % item)) |
323 continue |
323 continue |
324 try: |
324 try: |
325 time_limit = float(parts[0]) |
325 time_limit = float(pycompat.sysstr(parts[0])) |
326 except ValueError as e: |
326 except ValueError as e: |
327 ui.warn(('malformatted run limit entry, %s: %s\n' |
327 ui.warn((b'malformatted run limit entry, %s: %s\n' |
328 % (e, item))) |
328 % (pycompat.bytestr(e), item))) |
329 continue |
329 continue |
330 try: |
330 try: |
331 run_limit = int(parts[1]) |
331 run_limit = int(pycompat.sysstr(parts[1])) |
332 except ValueError as e: |
332 except ValueError as e: |
333 ui.warn(('malformatted run limit entry, %s: %s\n' |
333 ui.warn((b'malformatted run limit entry, %s: %s\n' |
334 % (e, item))) |
334 % (pycompat.bytestr(e), item))) |
335 continue |
335 continue |
336 limits.append((time_limit, run_limit)) |
336 limits.append((time_limit, run_limit)) |
337 if not limits: |
337 if not limits: |
338 limits = DEFAULTLIMITS |
338 limits = DEFAULTLIMITS |
339 |
339 |