comparison tests/test-largefiles.t @ 16110:41417443b7d0 stable

largefiles: check whether specified patterns are related to largefiles strictly current 'lfiles_repo.status()' implementation examines whether specified patterns are related to largefiles in working directory (not to STANDIN) or not by NOT-EMPTY-NESS of below list: [f for f in match.files() if f in lfdirstate] but it can not be assumed that all in 'match.files()' are file itself exactly, because user may only specify part of path to match whole under subdirectories recursively. above examination will mis-recognize such pattern as 'not related to largefiles', and executes normal 'status()' procedure. so, 'hg status' shows '?'(unknown) status for largefiles in working directory unexpectedly. this patch examines relation of pattern to largefiles by applying 'match()' on each entries in lfdirstate and checking wheter there is no matched entry. it may increase cost of examination, because it causes of full scan of entries in lfdirstate. so this patch uses normal for-loop instead of list comprehensions, to decrease cost when matching is found.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 15 Feb 2012 23:01:09 +0900
parents 32b9aee3602c
children f346de4dff57
comparison
equal deleted inserted replaced
16108:f7e0d95d0a0b 16110:41417443b7d0
946 $ hg up -C >/dev/null 946 $ hg up -C >/dev/null
947 $ test -f largelink 947 $ test -f largelink
948 $ test -L largelink 948 $ test -L largelink
949 $ cd .. 949 $ cd ..
950 950
951 951 test for pattern matching on 'hg status':
952 to boost performance, largefiles checks whether specified patterns are
953 related to largefiles in working directory (NOT to STANDIN) or not.
954
955 $ hg init statusmatch
956 $ cd statusmatch
957
958 $ mkdir -p a/b/c/d
959 $ echo normal > a/b/c/d/e.normal.txt
960 $ hg add a/b/c/d/e.normal.txt
961 $ echo large > a/b/c/d/e.large.txt
962 $ hg add --large a/b/c/d/e.large.txt
963 $ mkdir -p a/b/c/x
964 $ echo normal > a/b/c/x/y.normal.txt
965 $ hg add a/b/c/x/y.normal.txt
966 $ hg commit -m 'add files'
967 Invoking status precommit hook
968 A a/b/c/d/e.large.txt
969 A a/b/c/d/e.normal.txt
970 A a/b/c/x/y.normal.txt
971
972 (1) no pattern: no performance boost
973 $ hg status -A
974 C a/b/c/d/e.large.txt
975 C a/b/c/d/e.normal.txt
976 C a/b/c/x/y.normal.txt
977
978 (2) pattern not related to largefiles: performance boost
979 $ hg status -A a/b/c/x
980 C a/b/c/x/y.normal.txt
981
982 (3) pattern related to largefiles: no performance boost
983 $ hg status -A a/b/c/d
984 C a/b/c/d/e.large.txt
985 C a/b/c/d/e.normal.txt
986
987 (4) pattern related to STANDIN (not to largefiles): performance boost
988 $ hg status -A .hglf/a
989 C .hglf/a/b/c/d/e.large.txt
990
991 (5) mixed case: no performance boost
992 $ hg status -A a/b/c/x a/b/c/d
993 C a/b/c/d/e.large.txt
994 C a/b/c/d/e.normal.txt
995 C a/b/c/x/y.normal.txt
996
997 $ cd ..