##// END OF EJS Templates
log: handle binary files in --line-range patterns...
Denis Laxalde -
r34905:4554649a default
parent child Browse files
Show More
@@ -2652,6 +2652,9 b' def getloglinerangerevs(repo, userrevs, '
2652 lineranges = fctxlineranges.get(fctx.path())
2652 lineranges = fctxlineranges.get(fctx.path())
2653 if lineranges is not None:
2653 if lineranges is not None:
2654 for hr, lines in hunks:
2654 for hr, lines in hunks:
2655 if hr is None: # binary
2656 yield hr, lines
2657 continue
2655 if any(mdiff.hunkinrange(hr[2:], lr)
2658 if any(mdiff.hunkinrange(hr[2:], lr)
2656 for lr in lineranges):
2659 for lr in lineranges):
2657 yield hr, lines
2660 yield hr, lines
@@ -849,6 +849,39 b' Renames are followed.'
849 +3
849 +3
850 +4
850 +4
851
851
852
853 Binary files work but without diff hunks filtering.
854 (Checking w/ and w/o diff.git option.)
855
856 >>> open('binary', 'w').write('this\nis\na\nbinary\0')
857 $ hg add binary
858 $ hg ci -m 'add a binary file' --quiet
859 $ hg log -f -L binary,1-2 -p
860 changeset: 10:c96381c229df
861 tag: tip
862 user: test
863 date: Thu Jan 01 00:00:00 1970 +0000
864 summary: add a binary file
865
866 diff --git a/dir/binary b/dir/binary
867 new file mode 100644
868 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c2e1fbed209fe919b3f189a6a31950e9adf61e45
869 GIT binary patch
870 literal 17
871 Wc$_QA$SmdpqC~Ew%)G>+N(KNlNClYy
872
873
874 $ hg log -f -L binary,1-2 -p --config diff.git=false
875 changeset: 10:c96381c229df
876 tag: tip
877 user: test
878 date: Thu Jan 01 00:00:00 1970 +0000
879 summary: add a binary file
880
881 diff -r 6af29c3a778f -r c96381c229df dir/binary
882 Binary file dir/binary has changed
883
884
852 Option --follow is required.
885 Option --follow is required.
853
886
854 $ hg log -L foo,5-7
887 $ hg log -L foo,5-7
General Comments 0
You need to be logged in to leave comments. Login now