--- a/hgext3rd/topic/discovery.py Fri Sep 21 11:58:42 2018 +0200
+++ b/hgext3rd/topic/discovery.py Fri Sep 21 17:50:28 2018 +0200
@@ -153,7 +153,10 @@
return
tr._prepushheads = _nbheads(op.repo)
reporef = weakref.ref(op.repo)
- oldvalidator = tr.validator
+ if util.safehasattr(tr, 'validator'): # hg <= 4.7
+ oldvalidator = tr.validator
+ else:
+ oldvalidator = tr._validator
def validator(tr):
repo = reporef()
@@ -171,7 +174,10 @@
% branch)
raise error.Abort(msg)
return oldvalidator(tr)
- tr.validator = validator
+ if util.safehasattr(tr, 'validator'): # hg <= 4.7
+ tr.validator = validator
+ else:
+ tr._validator = validator
handlecheckheads.params = frozenset()
def _pushb2phases(orig, pushop, bundler):