store: use `endswith` to detect revlog extension
Suggested by Gregory Szorc.
Differential Revision: https://phab.mercurial-scm.org/D9865
--- a/mercurial/store.py Tue Dec 01 12:59:33 2020 -0500
+++ b/mercurial/store.py Mon Jan 25 16:34:43 2021 +0100
@@ -387,13 +387,13 @@
b'requires',
]
+REVLOG_FILES_EXT = (b'.i', b'.d', b'.n', b'.nd')
+
def isrevlog(f, kind, st):
if kind != stat.S_IFREG:
return False
- if f[-2:] in (b'.i', b'.d', b'.n'):
- return True
- return f[-3:] == b'.nd'
+ return f.endswith(REVLOG_FILES_EXT)
class basicstore(object):