contrib/perf.py
changeset 29494 3b5389ef5cfe
parent 29493 4533f5b47949
child 29495 f83445296213
--- a/contrib/perf.py	Tue Jul 05 07:25:51 2016 +0900
+++ b/contrib/perf.py	Tue Jul 05 07:25:51 2016 +0900
@@ -39,6 +39,14 @@
     util,
 )
 
+# for "historical portability":
+# define util.safehasattr forcibly, because util.safehasattr has been
+# available since 1.9.3 (or 94b200a11cf7)
+_undefined = object()
+def safehasattr(thing, attr):
+    return getattr(thing, attr, _undefined) is not _undefined
+setattr(util, 'safehasattr', safehasattr)
+
 formatteropts = commands.formatteropts
 revlogopts = commands.debugrevlogopts