Mercurial > hg
comparison mercurial/store.py @ 47324:0a3fa41fa719
revlogv2: use a unique filename for data
Having a unique data will allow for ambiguity less rewriting of revlog content,
something useful to clarify handling of some operation like censoring or
stripping.
Differential Revision: https://phab.mercurial-scm.org/D10772
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 19 May 2021 16:55:36 +0200 |
parents | 616b8f412676 |
children | e6292eb33384 |
comparison
equal
deleted
inserted
replaced
47323:f612db768c7a | 47324:0a3fa41fa719 |
---|---|
387 b'obsstore', | 387 b'obsstore', |
388 b'requires', | 388 b'requires', |
389 ] | 389 ] |
390 | 390 |
391 REVLOG_FILES_MAIN_EXT = (b'.i', b'i.tmpcensored') | 391 REVLOG_FILES_MAIN_EXT = (b'.i', b'i.tmpcensored') |
392 REVLOG_FILES_OTHER_EXT = (b'.idx', b'.d', b'.n', b'.nd', b'd.tmpcensored') | 392 REVLOG_FILES_OTHER_EXT = ( |
393 b'.idx', | |
394 b'.d', | |
395 b'.dat', | |
396 b'.n', | |
397 b'.nd', | |
398 b'd.tmpcensored', | |
399 ) | |
393 # files that are "volatile" and might change between listing and streaming | 400 # files that are "volatile" and might change between listing and streaming |
394 # | 401 # |
395 # note: the ".nd" file are nodemap data and won't "change" but they might be | 402 # note: the ".nd" file are nodemap data and won't "change" but they might be |
396 # deleted. | 403 # deleted. |
397 REVLOG_FILES_VOLATILE_EXT = (b'.n', b'.nd') | 404 REVLOG_FILES_VOLATILE_EXT = (b'.n', b'.nd') |
412 elif f.endswith(REVLOG_FILES_OTHER_EXT) and EXCLUDED.match(f) is None: | 419 elif f.endswith(REVLOG_FILES_OTHER_EXT) and EXCLUDED.match(f) is None: |
413 t = FILETYPE_FILELOG_OTHER | 420 t = FILETYPE_FILELOG_OTHER |
414 if f.endswith(REVLOG_FILES_VOLATILE_EXT): | 421 if f.endswith(REVLOG_FILES_VOLATILE_EXT): |
415 t |= FILEFLAGS_VOLATILE | 422 t |= FILEFLAGS_VOLATILE |
416 return t | 423 return t |
424 return None | |
417 | 425 |
418 | 426 |
419 # the file is part of changelog data | 427 # the file is part of changelog data |
420 FILEFLAGS_CHANGELOG = 1 << 13 | 428 FILEFLAGS_CHANGELOG = 1 << 13 |
421 # the file is part of manifest data | 429 # the file is part of manifest data |
751 if not _matchtrackedpath(f, matcher): | 759 if not _matchtrackedpath(f, matcher): |
752 continue | 760 continue |
753 ef = self.encode(f) | 761 ef = self.encode(f) |
754 try: | 762 try: |
755 t = revlog_type(f) | 763 t = revlog_type(f) |
764 assert t is not None, f | |
756 t |= FILEFLAGS_FILELOG | 765 t |= FILEFLAGS_FILELOG |
757 yield t, f, ef, self.getsize(ef) | 766 yield t, f, ef, self.getsize(ef) |
758 except OSError as err: | 767 except OSError as err: |
759 if err.errno != errno.ENOENT: | 768 if err.errno != errno.ENOENT: |
760 raise | 769 raise |