There are "temporary" local file that we should not be transfered by walk user
like local clone and stream clone.
This fix the small issue that the new tests highlighted.
Alphare |
hg-reviewers |
There are "temporary" local file that we should not be transfered by walk user
like local clone and stream clone.
This fix the small issue that the new tests highlighted.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/store.py (6 lines) | |||
M | tests/test-persistent-nodemap.t (2 lines) |
# store.py - repository store handling for Mercurial | # store.py - repository store handling for Mercurial | ||||
# | # | ||||
# Copyright 2008 Olivia Mackall <olivia@selenic.com> | # Copyright 2008 Olivia Mackall <olivia@selenic.com> | ||||
# | # | ||||
# This software may be used and distributed according to the terms of the | # This software may be used and distributed according to the terms of the | ||||
# GNU General Public License version 2 or any later version. | # GNU General Public License version 2 or any later version. | ||||
from __future__ import absolute_import | from __future__ import absolute_import | ||||
import errno | import errno | ||||
import functools | import functools | ||||
import os | import os | ||||
import re | |||||
import stat | import stat | ||||
from .i18n import _ | from .i18n import _ | ||||
from .pycompat import getattr | from .pycompat import getattr | ||||
from .node import hex | from .node import hex | ||||
from . import ( | from . import ( | ||||
changelog, | changelog, | ||||
error, | error, | ||||
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'.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 | |||||
EXCLUDED = re.compile(b'.*undo\.[^/]+\.nd?$') | |||||
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): | ||||
return FILEFLAGS_REVLOG_MAIN | return FILEFLAGS_REVLOG_MAIN | ||||
elif f.endswith(REVLOG_FILES_OTHER_EXT): | 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 | ||||
# the file is part of changelog data | # the file is part of changelog data | ||||
FILEFLAGS_CHANGELOG = 1 << 13 | FILEFLAGS_CHANGELOG = 1 << 13 |
$ (hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone-race-2 --debug 2>> clone-output-2 | egrep '00(changelog|manifest)' >> clone-output-2; touch $HG_TEST_STREAM_WALKED_FILE_3) & | $ (hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone-race-2 --debug 2>> clone-output-2 | egrep '00(changelog|manifest)' >> clone-output-2; touch $HG_TEST_STREAM_WALKED_FILE_3) & | ||||
$ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 | ||||
$ rm test-repo/.hg/store/00changelog.n | $ rm test-repo/.hg/store/00changelog.n | ||||
$ rm test-repo/.hg/store/00changelog-*.nd | $ rm test-repo/.hg/store/00changelog-*.nd | ||||
$ hg -R test-repo/ debugupdatecache | $ hg -R test-repo/ debugupdatecache | ||||
$ touch $HG_TEST_STREAM_WALKED_FILE_2 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 | ||||
$ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 | ||||
$ cat clone-output-2 | $ cat clone-output-2 | ||||
adding [s] undo.backup.00manifest.n (70 bytes) (known-bad-output !) | |||||
adding [s] undo.backup.00changelog.n (70 bytes) (known-bad-output !) | |||||
adding [s] 00manifest.n (70 bytes) | adding [s] 00manifest.n (70 bytes) | ||||
adding [s] 00manifest-*.nd (118 KB) (glob) | adding [s] 00manifest-*.nd (118 KB) (glob) | ||||
adding [s] 00changelog.n (70 bytes) | adding [s] 00changelog.n (70 bytes) | ||||
adding [s] 00changelog-*.nd (118 KB) (glob) | adding [s] 00changelog-*.nd (118 KB) (glob) | ||||
adding [s] 00manifest.d (492 KB) (zstd !) | adding [s] 00manifest.d (492 KB) (zstd !) | ||||
adding [s] 00manifest.d (452 KB) (no-zstd !) | adding [s] 00manifest.d (452 KB) (no-zstd !) | ||||
adding [s] 00changelog.d (360 KB) (no-zstd !) | adding [s] 00changelog.d (360 KB) (no-zstd !) | ||||
adding [s] 00changelog.d (368 KB) (zstd !) | adding [s] 00changelog.d (368 KB) (zstd !) |