Show More
@@ -389,6 +389,11 b' def _calcmode(vfs):' | |||
|
389 | 389 | |
|
390 | 390 | REVLOG_FILES_MAIN_EXT = (b'.i', b'i.tmpcensored') |
|
391 | 391 | REVLOG_FILES_OTHER_EXT = (b'.d', b'.n', b'.nd', b'd.tmpcensored') |
|
392 | # files that are "volatile" and might change between listing and streaming | |
|
393 | # | |
|
394 | # note: the ".nd" file are nodemap data and won't "change" but they might be | |
|
395 | # deleted. | |
|
396 | REVLOG_FILES_VOLATILE_EXT = (b'.n', b'.nd') | |
|
392 | 397 | |
|
393 | 398 | |
|
394 | 399 | def is_revlog(f, kind, st): |
@@ -401,7 +406,10 b' def revlog_type(f):' | |||
|
401 | 406 | if f.endswith(REVLOG_FILES_MAIN_EXT): |
|
402 | 407 | return FILEFLAGS_REVLOG_MAIN |
|
403 | 408 | elif f.endswith(REVLOG_FILES_OTHER_EXT): |
|
404 |
|
|
|
409 | t = FILETYPE_FILELOG_OTHER | |
|
410 | if f.endswith(REVLOG_FILES_VOLATILE_EXT): | |
|
411 | t |= FILEFLAGS_VOLATILE | |
|
412 | return t | |
|
405 | 413 | |
|
406 | 414 | |
|
407 | 415 | # the file is part of changelog data |
@@ -418,6 +426,9 b' FILEFLAGS_REVLOG_MAIN = 1 << 1' | |||
|
418 | 426 | # a secondary file for a revlog |
|
419 | 427 | FILEFLAGS_REVLOG_OTHER = 1 << 0 |
|
420 | 428 | |
|
429 | # files that are "volatile" and might change between listing and streaming | |
|
430 | FILEFLAGS_VOLATILE = 1 << 20 | |
|
431 | ||
|
421 | 432 | FILETYPE_CHANGELOG_MAIN = FILEFLAGS_CHANGELOG | FILEFLAGS_REVLOG_MAIN |
|
422 | 433 | FILETYPE_CHANGELOG_OTHER = FILEFLAGS_CHANGELOG | FILEFLAGS_REVLOG_OTHER |
|
423 | 434 | FILETYPE_MANIFESTLOG_MAIN = FILEFLAGS_MANIFESTLOG | FILEFLAGS_REVLOG_MAIN |
@@ -628,7 +628,10 b' def generatev2(repo, includes, excludes,' | |||
|
628 | 628 | repo.ui.debug(b'scanning\n') |
|
629 | 629 | for rl_type, name, ename, size in _walkstreamfiles(repo, matcher): |
|
630 | 630 | if size: |
|
631 |
|
|
|
631 | ft = _fileappend | |
|
632 | if rl_type & store.FILEFLAGS_VOLATILE: | |
|
633 | ft = _filefull | |
|
634 | entries.append((_srcstore, name, ft, size)) | |
|
632 | 635 | totalfilesize += size |
|
633 | 636 | for name in _walkstreamfullstorefiles(repo): |
|
634 | 637 | if repo.svfs.exists(name): |
@@ -820,13 +820,13 b' No race condition' | |||
|
820 | 820 | |
|
821 | 821 | $ hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)' |
|
822 | 822 | adding [s] 00manifest.n (70 bytes) |
|
823 | adding [s] 00manifest.d (452 KB) (no-zstd !) | |
|
824 | adding [s] 00manifest.d (491 KB) (zstd !) | |
|
825 | 823 | adding [s] 00manifest-*.nd (118 KB) (glob) |
|
826 | 824 | adding [s] 00changelog.n (70 bytes) |
|
825 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
|
826 | adding [s] 00manifest.d (452 KB) (no-zstd !) | |
|
827 | adding [s] 00manifest.d (491 KB) (zstd !) | |
|
827 | 828 | adding [s] 00changelog.d (360 KB) (no-zstd !) |
|
828 | 829 | adding [s] 00changelog.d (368 KB) (zstd !) |
|
829 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
|
830 | 830 | adding [s] 00manifest.i (313 KB) |
|
831 | 831 | adding [s] 00changelog.i (313 KB) |
|
832 | 832 | $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
@@ -889,77 +889,54 b' Do a mix of clone and commit at the same' | |||
|
889 | 889 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 |
|
890 | 890 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 |
|
891 | 891 | $ cat clone-output |
|
892 | remote: abort: unexpected error: [Errno 2] $ENOENT$: *'$TESTTMP/test-repo/.hg/store/00manifest-*.nd' (glob) (known-bad-output no-rust no-pure !) | |
|
893 | abort: pull failed on remote (known-bad-output no-rust no-pure !) | |
|
894 | 892 | adding [s] 00manifest.n (70 bytes) |
|
895 |
adding [s] 00manifest.d ( |
|
|
893 | adding [s] 00manifest-*.nd (118 KB) (glob) | |
|
894 | adding [s] 00changelog.n (70 bytes) | |
|
895 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
|
896 | 896 | adding [s] 00manifest.d (452 KB) (no-zstd !) |
|
897 | remote: abort: $ENOENT$: '$TESTTMP/test-repo/.hg/store/00manifest-*.nd' (glob) (known-bad-output no-rust no-pure !) | |
|
898 | adding [s] 00manifest-*.nd (118 KB) (glob) (rust !) | |
|
899 | adding [s] 00changelog.n (70 bytes) (rust !) | |
|
900 | adding [s] 00changelog.d (368 KB) (zstd rust !) | |
|
901 | adding [s] 00changelog-*.nd (118 KB) (glob) (rust !) | |
|
902 | adding [s] 00manifest.i (313 KB) (rust !) | |
|
903 | adding [s] 00changelog.i (313 KB) (rust !) | |
|
904 | adding [s] 00manifest-*.nd (118 KB) (glob) (pure !) | |
|
905 | adding [s] 00changelog.n (70 bytes) (pure !) | |
|
897 | adding [s] 00manifest.d (491 KB) (zstd !) | |
|
906 | 898 | adding [s] 00changelog.d (360 KB) (no-zstd !) |
|
907 |
adding [s] 00changelog |
|
|
908 |
adding [s] 00manifest.i (313 KB) |
|
|
909 |
adding [s] 00changelog.i (313 KB) |
|
|
899 | adding [s] 00changelog.d (368 KB) (zstd !) | |
|
900 | adding [s] 00manifest.i (313 KB) | |
|
901 | adding [s] 00changelog.i (313 KB) | |
|
910 | 902 | |
|
911 | 903 | Check the result state |
|
912 | 904 | |
|
913 | 905 | $ f --size stream-clone-race-1/.hg/store/00changelog* |
|
914 |
stream-clone-race-1/.hg/store/00changelog*: |
|
|
915 |
stream-clone-race-1/.hg/store/00changelog |
|
|
916 |
stream-clone-race-1/.hg/store/00changelog.d: size=376891 (zstd |
|
|
917 |
stream-clone-race-1/.hg/store/00changelog.i: size=320384 |
|
|
918 |
stream-clone-race-1/.hg/store/00changelog.n: size=70 |
|
|
919 | stream-clone-race-1/.hg/store/00changelog-*.nd: size=121088 (glob) (pure !) | |
|
920 | stream-clone-race-1/.hg/store/00changelog.d: size=368890 (no-zstd pure !) | |
|
921 | stream-clone-race-1/.hg/store/00changelog.i: size=320384 (pure !) | |
|
922 | stream-clone-race-1/.hg/store/00changelog.n: size=70 (pure !) | |
|
906 | stream-clone-race-1/.hg/store/00changelog-*.nd: size=121088 (glob) | |
|
907 | stream-clone-race-1/.hg/store/00changelog.d: size=368890 (no-zstd !) | |
|
908 | stream-clone-race-1/.hg/store/00changelog.d: size=376891 (zstd !) | |
|
909 | stream-clone-race-1/.hg/store/00changelog.i: size=320384 | |
|
910 | stream-clone-race-1/.hg/store/00changelog.n: size=70 | |
|
923 | 911 | |
|
924 | 912 | $ hg -R stream-clone-race-1 debugnodemap --metadata | tee client-metadata.txt |
|
925 | abort: repository stream-clone-race-1 not found (known-bad-output no-rust no-pure !) | |
|
926 | uid: * (glob) (rust !) | |
|
927 | tip-rev: 5005 (rust !) | |
|
928 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe (rust !) | |
|
929 | data-length: 121088 (rust !) | |
|
930 |
data-unused: 0 |
|
|
931 | data-unused: 0.000% (rust !) | |
|
932 | uid: * (glob) (pure !) | |
|
933 | tip-rev: 5005 (pure !) | |
|
934 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe (pure !) | |
|
935 | data-length: 121088 (pure !) | |
|
936 | data-unused: 0 (pure !) | |
|
937 | data-unused: 0.000% (pure !) | |
|
913 | uid: * (glob) | |
|
914 | tip-rev: 5005 | |
|
915 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
|
916 | data-length: 121088 | |
|
917 | data-unused: 0 | |
|
918 | data-unused: 0.000% | |
|
938 | 919 | |
|
939 | 920 | We get a usable nodemap, so no rewrite would be needed and the metadata should be identical |
|
940 | 921 | (ie: the following diff should be empty) |
|
941 | 922 | |
|
923 | This isn't the case for the `no-rust` `no-pure` implementation as it use a very minimal nodemap implementation that unconditionnaly rewrite the nodemap "all the time". | |
|
924 | ||
|
925 | #if no-rust no-pure | |
|
942 | 926 | $ diff -u server-metadata.txt client-metadata.txt |
|
943 |
--- server-metadata.txt * (glob) |
|
|
944 |
+++ client-metadata.txt * (glob) |
|
|
945 | @@ -1,4 +1,4 @@ (known-bad-output rust !) | |
|
946 | @@ -1,4 +1,4 @@ (known-bad-output pure !) | |
|
947 | @@ -1,6 +0,0 @@ (known-bad-output no-rust no-pure !) | |
|
948 | -uid: * (glob) (known-bad-output !) | |
|
949 | +uid: * (glob) (known-bad-output rust !) | |
|
950 | tip-rev: 5005 (known-bad-output rust !) | |
|
951 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe (known-bad-output rust !) | |
|
952 | data-length: 121088 (known-bad-output rust !) | |
|
953 | +uid: * (glob) (known-bad-output pure !) | |
|
954 | tip-rev: 5005 (known-bad-output pure !) | |
|
955 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe (known-bad-output pure !) | |
|
956 | data-length: 121088 (known-bad-output pure !) | |
|
957 | -tip-rev: 5005 (known-bad-output no-rust no-pure !) | |
|
958 | -tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe (known-bad-output no-rust no-pure !) | |
|
959 | -data-length: 121088 (known-bad-output no-rust no-pure !) | |
|
960 | -data-unused: 0 (known-bad-output no-rust no-pure !) | |
|
961 | -data-unused: 0.000% (known-bad-output no-rust no-pure !) | |
|
927 | --- server-metadata.txt * (glob) | |
|
928 | +++ client-metadata.txt * (glob) | |
|
929 | @@ -1,4 +1,4 @@ | |
|
930 | -uid: * (glob) | |
|
931 | +uid: * (glob) | |
|
932 | tip-rev: 5005 | |
|
933 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
|
934 | data-length: 121088 | |
|
962 | 935 | [1] |
|
936 | #else | |
|
937 | $ diff -u server-metadata.txt client-metadata.txt | |
|
938 | #endif | |
|
939 | ||
|
963 | 940 | |
|
964 | 941 | Clean up after the test. |
|
965 | 942 | |
@@ -991,14 +968,14 b' Check the initial state' | |||
|
991 | 968 | tip-rev: 5006 |
|
992 | 969 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b |
|
993 | 970 | data-length: 121344 (rust !) |
|
971 | data-length: 121344 (pure !) | |
|
972 | data-length: 121152 (no-rust no-pure !) | |
|
994 | 973 | data-unused: 192 (rust !) |
|
995 |
data-unused: |
|
|
996 | data-length: 121152 (no-rust no-pure !) | |
|
974 | data-unused: 192 (pure !) | |
|
997 | 975 | data-unused: 0 (no-rust no-pure !) |
|
976 | data-unused: 0.158% (rust !) | |
|
977 | data-unused: 0.158% (pure !) | |
|
998 | 978 | data-unused: 0.000% (no-rust no-pure !) |
|
999 | data-length: 121344 (pure !) | |
|
1000 | data-unused: 192 (pure !) | |
|
1001 | data-unused: 0.158% (pure !) | |
|
1002 | 979 | |
|
1003 | 980 | Performe the mix of clone and full refresh of the nodemap, so that the files |
|
1004 | 981 | (and filenames) are different between listing time and actual transfer time. |
@@ -1011,51 +988,63 b' Performe the mix of clone and full refre' | |||
|
1011 | 988 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 |
|
1012 | 989 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 |
|
1013 | 990 | $ cat clone-output-2 |
|
1014 | remote: abort: unexpected error: [Errno 2] $ENOENT$: *'$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output rust !) | |
|
1015 | remote: abort: unexpected error: [Errno 2] $ENOENT$: *'$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output pure !) | |
|
1016 | remote: abort: unexpected error: [Errno 2] $ENOENT$: *'$TESTTMP/test-repo/.hg/store/00manifest-*.nd' (glob) (known-bad-output no-pure no-rust !) | |
|
1017 | abort: pull failed on remote (known-bad-output !) | |
|
1018 | 991 | adding [s] undo.backup.00manifest.n (70 bytes) (known-bad-output !) |
|
1019 | 992 | adding [s] undo.backup.00changelog.n (70 bytes) (known-bad-output !) |
|
1020 | 993 | adding [s] 00manifest.n (70 bytes) |
|
994 | adding [s] 00manifest-*.nd (118 KB) (glob) | |
|
995 | adding [s] 00changelog.n (70 bytes) | |
|
996 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
|
1021 | 997 | adding [s] 00manifest.d (492 KB) (zstd !) |
|
1022 | 998 | adding [s] 00manifest.d (452 KB) (no-zstd !) |
|
1023 | adding [s] 00manifest-*.nd (118 KB) (glob) (rust !) | |
|
1024 | adding [s] 00manifest-*.nd (118 KB) (glob) (pure !) | |
|
1025 | remote: abort: $ENOENT$: '$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output rust !) | |
|
1026 | remote: abort: $ENOENT$: '$TESTTMP/test-repo/.hg/store/00manifest-*.nd' (glob) (known-bad-output no-pure no-rust !) | |
|
1027 | adding [s] 00changelog.n (70 bytes) (pure !) | |
|
1028 | 999 | adding [s] 00changelog.d (360 KB) (no-zstd !) |
|
1029 | remote: abort: $ENOENT$: '$TESTTMP/test-repo/.hg/store/00changelog-*.nd' (glob) (known-bad-output pure !) | |
|
1000 | adding [s] 00changelog.d (368 KB) (zstd !) | |
|
1001 | adding [s] 00manifest.i (313 KB) | |
|
1002 | adding [s] 00changelog.i (313 KB) | |
|
1030 | 1003 | |
|
1031 | 1004 | Check the result. |
|
1032 | 1005 | |
|
1033 | 1006 | $ f --size stream-clone-race-2/.hg/store/00changelog* |
|
1034 |
stream-clone-race-2/.hg/store/00changelog |
|
|
1007 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121344 (glob) (rust !) | |
|
1008 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121344 (glob) (pure !) | |
|
1009 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121152 (glob) (no-rust no-pure !) | |
|
1010 | stream-clone-race-2/.hg/store/00changelog.d: size=376950 (zstd !) | |
|
1011 | stream-clone-race-2/.hg/store/00changelog.d: size=368949 (no-zstd !) | |
|
1012 | stream-clone-race-2/.hg/store/00changelog.i: size=320448 | |
|
1013 | stream-clone-race-2/.hg/store/00changelog.n: size=70 | |
|
1035 | 1014 | |
|
1036 | 1015 | $ hg -R stream-clone-race-2 debugnodemap --metadata | tee client-metadata-2.txt |
|
1037 | abort: repository stream-clone-race-2 not found (known-bad-output !) | |
|
1016 | uid: * (glob) | |
|
1017 | tip-rev: 5006 | |
|
1018 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b | |
|
1019 | data-length: 121344 (rust !) | |
|
1020 | data-unused: 192 (rust !) | |
|
1021 | data-unused: 0.158% (rust !) | |
|
1022 | data-length: 121152 (no-rust no-pure !) | |
|
1023 | data-unused: 0 (no-rust no-pure !) | |
|
1024 | data-unused: 0.000% (no-rust no-pure !) | |
|
1025 | data-length: 121344 (pure !) | |
|
1026 | data-unused: 192 (pure !) | |
|
1027 | data-unused: 0.158% (pure !) | |
|
1038 | 1028 | |
|
1039 | 1029 | We get a usable nodemap, so no rewrite would be needed and the metadata should be identical |
|
1040 | 1030 | (ie: the following diff should be empty) |
|
1041 | 1031 | |
|
1032 | This isn't the case for the `no-rust` `no-pure` implementation as it use a very minimal nodemap implementation that unconditionnaly rewrite the nodemap "all the time". | |
|
1033 | ||
|
1034 | #if no-rust no-pure | |
|
1042 | 1035 | $ diff -u server-metadata-2.txt client-metadata-2.txt |
|
1043 |
--- server-metadata-2.txt * (glob) |
|
|
1044 |
+++ client-metadata-2.txt * (glob) |
|
|
1045 | @@ -1,6 +0,0 @@ (known-bad-output !) | |
|
1046 |
-uid: * (glob) |
|
|
1047 | -tip-rev: 5006 (known-bad-output !) | |
|
1048 | -tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b (known-bad-output !) | |
|
1049 | -data-length: 121344 (known-bad-output rust !) | |
|
1050 | -data-unused: 192 (known-bad-output rust !) | |
|
1051 | -data-unused: 0.158% (known-bad-output rust !) | |
|
1052 | -data-length: 121344 (known-bad-output pure !) | |
|
1053 | -data-unused: 192 (known-bad-output pure !) | |
|
1054 | -data-unused: 0.158% (known-bad-output pure !) | |
|
1055 | -data-length: 121152 (known-bad-output no-rust no-pure !) | |
|
1056 | -data-unused: 0 (known-bad-output no-rust no-pure !) | |
|
1057 | -data-unused: 0.000% (known-bad-output no-rust no-pure !) | |
|
1036 | --- server-metadata-2.txt * (glob) | |
|
1037 | +++ client-metadata-2.txt * (glob) | |
|
1038 | @@ -1,4 +1,4 @@ | |
|
1039 | -uid: * (glob) | |
|
1040 | +uid: * (glob) | |
|
1041 | tip-rev: 5006 | |
|
1042 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b | |
|
1043 | data-length: 121152 | |
|
1058 | 1044 | [1] |
|
1045 | #else | |
|
1046 | $ diff -u server-metadata-2.txt client-metadata-2.txt | |
|
1047 | #endif | |
|
1059 | 1048 | |
|
1060 | 1049 | Clean up after the test |
|
1061 | 1050 |
General Comments 0
You need to be logged in to leave comments.
Login now