safehasattr: pass attribute name as string instead of bytes
This is a step toward replacing `util.safehasattr` usage with plain `hasattr`.
The builtin function behave poorly in Python2 but this was fixed in Python3.
These change are done one by one as they tend to have a small odd to trigger
puzzling breackage.
--- a/mercurial/revlogutils/deltas.py Thu Feb 02 17:34:25 2023 +0100
+++ b/mercurial/revlogutils/deltas.py Thu Feb 02 17:34:33 2023 +0100
@@ -1067,7 +1067,7 @@
end_rev < self._start_rev or end_rev > self._end_rev
), (self._start_rev, self._end_rev, start_rev, end_rev)
cache = self.snapshots
- if util.safehasattr(revlog.index, b'findsnapshots'):
+ if util.safehasattr(revlog.index, 'findsnapshots'):
revlog.index.findsnapshots(cache, start_rev, end_rev)
else:
deltaparent = revlog.deltaparent