##// END OF EJS Templates
log: map None rev to wdirrev when filtering revisions with --line-range...
Denis Laxalde -
r44173:d1b9d2c6 stable
parent child Browse files
Show More
@@ -930,6 +930,8 b' def getlinerangerevs(repo, userrevs, opt'
930 930 fctx = wctx.filectx(fname)
931 931 for fctx, linerange in dagop.blockancestors(fctx, fromline, toline):
932 932 rev = fctx.introrev()
933 if rev is None:
934 rev = wdirrev
933 935 if rev not in userrevs:
934 936 continue
935 937 linerangesbyrev.setdefault(rev, {}).setdefault(
@@ -940,7 +942,7 b' def getlinerangerevs(repo, userrevs, opt'
940 942 return hunks
941 943
942 944 def hunksfilter(ctx):
943 fctxlineranges = linerangesbyrev.get(ctx.rev())
945 fctxlineranges = linerangesbyrev.get(scmutil.intrev(ctx))
944 946 if fctxlineranges is None:
945 947 return nofilterhunksfn
946 948
@@ -960,7 +962,7 b' def getlinerangerevs(repo, userrevs, opt'
960 962 return filterfn
961 963
962 964 def filematcher(ctx):
963 files = list(linerangesbyrev.get(ctx.rev(), []))
965 files = list(linerangesbyrev.get(scmutil.intrev(ctx), []))
964 966 return scmutil.matchfiles(repo, files)
965 967
966 968 revs = sorted(linerangesbyrev, reverse=True)
@@ -898,6 +898,99 b' Uncommitted changes with a rename'
898 898 date: Thu Jan 01 00:00:00 1970 +0000
899 899 summary: init
900 900
901
902 Uncommitted changes in requested line range
903
904 $ sed 's/2/ /' bazn > bazn.new
905 $ mv bazn.new bazn
906 $ hg diff
907 diff --git a/dir/baz b/dir/bazn
908 rename from dir/baz
909 rename to dir/bazn
910 --- a/dir/baz
911 +++ b/dir/bazn
912 @@ -3,7 +3,7 @@
913 0
914 0
915 1+
916 -2+
917 + +
918 3+
919 4
920 5
921 $ hg log -f -L bazn,5:7
922 changeset: 9:6af29c3a778f
923 tag: tip
924 user: test
925 date: Thu Jan 01 00:00:00 1970 +0000
926 summary: foo -> dir/baz; 1-1+
927
928 changeset: 5:cfdf972b3971
929 user: test
930 date: Thu Jan 01 00:00:00 1970 +0000
931 summary: foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
932
933 changeset: 4:eaec41c1a0c9
934 user: test
935 date: Thu Jan 01 00:00:00 1970 +0000
936 summary: 11 -> 11+; leading space before "1"
937
938 changeset: 2:63a884426fd0
939 user: test
940 date: Thu Jan 01 00:00:00 1970 +0000
941 summary: 2 -> 2+; added bar
942
943 changeset: 0:5ae1f82b9a00
944 user: test
945 date: Thu Jan 01 00:00:00 1970 +0000
946 summary: init
947
948
949 Uncommitted changes in line-range + wdir()
950
951 $ hg log -r 'wdir()' -f -L bazn,5:7 --limit 2 -p
952 changeset: 2147483647:ffffffffffff
953 parent: 9:6af29c3a778f
954 user: test
955 date: Thu Jan 01 00:00:00 1970 +0000
956
957 diff --git a/dir/baz b/dir/bazn
958 copy from dir/baz
959 copy to dir/bazn
960 --- a/dir/baz
961 +++ b/dir/bazn
962 @@ -3,7 +3,7 @@
963 0
964 0
965 1+
966 -2+
967 + +
968 3+
969 4
970 5
971
972 changeset: 9:6af29c3a778f
973 tag: tip
974 user: test
975 date: Thu Jan 01 00:00:00 1970 +0000
976 summary: foo -> dir/baz; 1-1+
977
978 diff --git a/foo b/dir/baz
979 copy from foo
980 copy to dir/baz
981 --- a/foo
982 +++ b/dir/baz
983 @@ -2,7 +2,7 @@
984 0
985 0
986 0
987 - 1
988 + 1+
989 2+
990 3+
991 4
992
993
901 994 $ hg revert -a -C -q
902 995
903 996 Binary files work but without diff hunks filtering.
General Comments 0
You need to be logged in to leave comments. Login now