Mercurial > hg
comparison tests/test-log.t @ 30016:2963fba2d18a
log: copy the way of ancestor traversal to --follow matcher (issue5376)
We can't use fctx.linkrev() because follow() revset tries hard to simulate
the traversal of changelog DAG, not filelog DAG. This patch fixes
_makefollowlogfilematcher() to walk file ancestors in the same way as
revset._follow().
I'll factor out a common function in future patches.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 24 Sep 2016 19:58:23 +0900 |
parents | cbf9984a7957 |
children | 69b61d0bb008 |
comparison
equal
deleted
inserted
replaced
30015:96b2dd3b184d | 30016:2963fba2d18a |
---|---|
927 date: Thu Jan 01 00:00:01 1970 +0000 | 927 date: Thu Jan 01 00:00:01 1970 +0000 |
928 summary: b1.1 | 928 summary: b1.1 |
929 | 929 |
930 b1 | 1 + | 930 b1 | 1 + |
931 1 files changed, 1 insertions(+), 0 deletions(-) | 931 1 files changed, 1 insertions(+), 0 deletions(-) |
932 | |
933 | |
934 $ cd .. | |
935 | |
936 log --follow --patch FILE in repository where linkrev isn't trustworthy | |
937 (issue5376) | |
938 | |
939 $ hg init follow-dup | |
940 $ cd follow-dup | |
941 $ cat <<EOF >> .hg/hgrc | |
942 > [ui] | |
943 > logtemplate = '=== {rev}: {desc}\n' | |
944 > [diff] | |
945 > nodates = True | |
946 > EOF | |
947 $ echo 0 >> a | |
948 $ hg ci -qAm 'a0' | |
949 $ echo 1 >> a | |
950 $ hg ci -m 'a1' | |
951 $ hg up -q 0 | |
952 $ echo 1 >> a | |
953 $ touch b | |
954 $ hg ci -qAm 'a1 with b' | |
955 $ echo 3 >> a | |
956 $ hg ci -m 'a3' | |
957 | |
958 fctx.rev() == 2, but fctx.linkrev() == 1 | |
959 | |
960 $ hg log -pf a | |
961 === 3: a3 | |
962 diff -r 4ea02ba94d66 -r e7a6331a34f0 a | |
963 --- a/a | |
964 +++ b/a | |
965 @@ -1,2 +1,3 @@ | |
966 0 | |
967 1 | |
968 +3 | |
969 | |
970 === 2: a1 with b | |
971 diff -r 49b5e81287e2 -r 4ea02ba94d66 a | |
972 --- a/a | |
973 +++ b/a | |
974 @@ -1,1 +1,2 @@ | |
975 0 | |
976 +1 | |
977 | |
978 === 0: a0 | |
979 diff -r 000000000000 -r 49b5e81287e2 a | |
980 --- /dev/null | |
981 +++ b/a | |
982 @@ -0,0 +1,1 @@ | |
983 +0 | |
984 | |
985 | |
986 fctx.introrev() == 2, but fctx.linkrev() == 1 | |
987 | |
988 $ hg up -q 2 | |
989 $ hg log -pf a | |
990 === 2: a1 with b | |
991 diff -r 49b5e81287e2 -r 4ea02ba94d66 a | |
992 --- a/a | |
993 +++ b/a | |
994 @@ -1,1 +1,2 @@ | |
995 0 | |
996 +1 | |
997 | |
998 === 0: a0 | |
999 diff -r 000000000000 -r 49b5e81287e2 a | |
1000 --- /dev/null | |
1001 +++ b/a | |
1002 @@ -0,0 +1,1 @@ | |
1003 +0 | |
932 | 1004 |
933 | 1005 |
934 $ cd .. | 1006 $ cd .. |
935 | 1007 |
936 Test that log should respect the order of -rREV even if multiple OR conditions | 1008 Test that log should respect the order of -rREV even if multiple OR conditions |