Changeset View
Changeset View
Standalone View
Standalone View
mercurial/store.py
Show First 20 Lines • Show All 383 Lines • ▼ Show 20 Line(s) | _data = [ | ||||
b'00changelog.d', | b'00changelog.d', | ||||
b'00changelog.i', | b'00changelog.i', | ||||
b'phaseroots', | b'phaseroots', | ||||
b'obsstore', | b'obsstore', | ||||
b'requires', | b'requires', | ||||
] | ] | ||||
REVLOG_FILES_MAIN_EXT = (b'.i', b'i.tmpcensored') | REVLOG_FILES_MAIN_EXT = (b'.i', b'i.tmpcensored') | ||||
REVLOG_FILES_OTHER_EXT = (b'.d', b'.n', b'.nd', b'd.tmpcensored') | REVLOG_FILES_OTHER_EXT = (b'.idx', b'.d', b'.n', b'.nd', b'd.tmpcensored') | ||||
# files that are "volatile" and might change between listing and streaming | # files that are "volatile" and might change between listing and streaming | ||||
# | # | ||||
# note: the ".nd" file are nodemap data and won't "change" but they might be | # note: the ".nd" file are nodemap data and won't "change" but they might be | ||||
# deleted. | # deleted. | ||||
REVLOG_FILES_VOLATILE_EXT = (b'.n', b'.nd') | REVLOG_FILES_VOLATILE_EXT = (b'.n', b'.nd') | ||||
# some exception to the above matching | # some exception to the above matching | ||||
EXCLUDED = re.compile(b'.*undo\.[^/]+\.nd?$') | EXCLUDED = re.compile(b'.*undo\.[^/]+\.(nd?|i)$') | ||||
def is_revlog(f, kind, st): | def is_revlog(f, kind, st): | ||||
if kind != stat.S_IFREG: | if kind != stat.S_IFREG: | ||||
return None | return None | ||||
return revlog_type(f) | return revlog_type(f) | ||||
def revlog_type(f): | def revlog_type(f): | ||||
if f.endswith(REVLOG_FILES_MAIN_EXT): | if f.endswith(REVLOG_FILES_MAIN_EXT) and EXCLUDED.match(f) is None: | ||||
return FILEFLAGS_REVLOG_MAIN | return FILEFLAGS_REVLOG_MAIN | ||||
elif f.endswith(REVLOG_FILES_OTHER_EXT) and EXCLUDED.match(f) is None: | elif f.endswith(REVLOG_FILES_OTHER_EXT) and EXCLUDED.match(f) is None: | ||||
t = FILETYPE_FILELOG_OTHER | t = FILETYPE_FILELOG_OTHER | ||||
if f.endswith(REVLOG_FILES_VOLATILE_EXT): | if f.endswith(REVLOG_FILES_VOLATILE_EXT): | ||||
t |= FILEFLAGS_VOLATILE | t |= FILEFLAGS_VOLATILE | ||||
return t | return t | ||||
▲ Show 20 Lines • Show All 396 Lines • Show Last 20 Lines |