comparison tests/test-annotate.t @ 36760:7bf80d9d9543

merge with stable There were a handful of merge conflicts in the wire protocol code due to significant refactoring in default. When resolving the conflicts, I tried to produce the minimal number of changes to make the incoming security patches work with the new code. I will send some follow-up commits to get the security patches better integrated into default.
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 06 Mar 2018 14:32:14 -0800
parents b529e640015d 52b344e977b7
children 12492794bf8c
comparison
equal deleted inserted replaced
36747:4c71a26a4009 36760:7bf80d9d9543
901 ------------------------------------- 901 -------------------------------------
902 902
903 $ hg init repo-cr 903 $ hg init repo-cr
904 $ cd repo-cr 904 $ cd repo-cr
905 905
906 $ substcr() { 906 $ cat <<'EOF' >> "$TESTTMP/substcr.py"
907 > sed 's/\r/[CR]/g' 907 > import sys
908 > } 908 > from mercurial import util
909 > util.setbinary(sys.stdin)
910 > util.setbinary(sys.stdout)
911 > stdin = getattr(sys.stdin, 'buffer', sys.stdin)
912 > stdout = getattr(sys.stdout, 'buffer', sys.stdout)
913 > stdout.write(stdin.read().replace(b'\r', b'[CR]'))
914 > EOF
909 915
910 >>> with open('a', 'wb') as f: 916 >>> with open('a', 'wb') as f:
911 ... f.write(b'0a\r0b\r\n0c\r0d\r\n0e\n0f\n0g') 917 ... f.write(b'0a\r0b\r\n0c\r0d\r\n0e\n0f\n0g')
912 $ hg ci -qAm0 918 $ hg ci -qAm0
913 >>> with open('a', 'wb') as f: 919 >>> with open('a', 'wb') as f:
914 ... f.write(b'0a\r0b\r\n1c\r1d\r\n0e\n1f\n0g') 920 ... f.write(b'0a\r0b\r\n1c\r1d\r\n0e\n1f\n0g')
915 $ hg ci -m1 921 $ hg ci -m1
916 922
917 $ hg annotate -r0 a | substcr 923 $ hg annotate -r0 a | $PYTHON "$TESTTMP/substcr.py"
918 0: 0a[CR]0b[CR] 924 0: 0a[CR]0b[CR]
919 0: 0c[CR]0d[CR] 925 0: 0c[CR]0d[CR]
920 0: 0e 926 0: 0e
921 0: 0f 927 0: 0f
922 0: 0g 928 0: 0g
923 $ hg annotate -r1 a | substcr 929 $ hg annotate -r1 a | $PYTHON "$TESTTMP/substcr.py"
924 0: 0a[CR]0b[CR] 930 0: 0a[CR]0b[CR]
925 1: 1c[CR]1d[CR] 931 1: 1c[CR]1d[CR]
926 0: 0e 932 0: 0e
927 1: 1f 933 1: 1f
928 0: 0g 934 0: 0g