Comments
Patch
@@ -67,6 +67,16 @@ def safehasattr(thing, attr):
setattr(util, 'safehasattr', safehasattr)
# for "historical portability":
+# define util.timer forcibly, because util.timer has been available
+# since ae5d60bb70c9
+if safehasattr(time, 'perf_counter'):
+ util.timer = time.perf_counter
+elif os.name == 'nt':
+ util.timer = time.clock
+else:
+ util.timer = time.time
+
+# for "historical portability":
# use locally defined empty option list, if formatteropts isn't
# available, because commands.formatteropts has been available since
# 3.2 (or 7a7eed5176a4), even though formatting itself has been
@@ -9,7 +9,7 @@ New errors are not allowed. Warnings are
$ hg locate -X contrib/python-zstandard -X hgext/fsmonitor/pywatchman |
> sed 's-\\-/-g' | xargs "$check_code" --warnings --per-file=0 || false
- contrib/perf.py:859:
+ contrib/perf.py:869:
> r.revision(r.node(x))
don't covert rev to node before passing to revision(nodeorrev)
Skipping i18n/polib.py it has no-che?k-code (glob)
@@ -165,7 +165,7 @@ Check perf.py for historical portability
$ (hg files -r 1.2 glob:mercurial/*.c glob:mercurial/*.py;
> hg files -r tip glob:mercurial/*.c glob:mercurial/*.py) |
> "$TESTDIR"/check-perf-code.py contrib/perf.py
- contrib/perf.py:859:
+ contrib/perf.py:869:
> r.revision(r.node(x))
don't covert rev to node before passing to revision(nodeorrev)
[1]