Mercurial > hg
comparison mercurial/changegroup.py @ 50928:d718eddf01d9
safehasattr: drop usage in favor of hasattr
The two functions should now be equivalent at least in their usage in core.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 31 Aug 2023 23:56:15 +0200 |
parents | 152d9c011bcd |
children | a0d88b021a98 |
comparison
equal
deleted
inserted
replaced
50927:7a8ea1397816 | 50928:d718eddf01d9 |
---|---|
1041 for i in range(rev, 0, -1): | 1041 for i in range(rev, 0, -1): |
1042 if store.linkrev(i) == clrev: | 1042 if store.linkrev(i) == clrev: |
1043 return i | 1043 return i |
1044 # We failed to resolve a parent for this node, so | 1044 # We failed to resolve a parent for this node, so |
1045 # we crash the changegroup construction. | 1045 # we crash the changegroup construction. |
1046 if util.safehasattr(store, 'target'): | 1046 if hasattr(store, 'target'): |
1047 target = store.display_id | 1047 target = store.display_id |
1048 else: | 1048 else: |
1049 # some revlog not actually a revlog | 1049 # some revlog not actually a revlog |
1050 target = store._revlog.display_id | 1050 target = store._revlog.display_id |
1051 | 1051 |