# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1518955612 -19800 # Node ID a67b144ef74f978a89585b1b949fef272c095b98 # Parent 3e1139b7d617c657970fc95fc4ee406e50a8b616 py3: add b'' prefixes in test-mq-eol.t # skip-blame because we are just adding b'' Differential Revision: https://phab.mercurial-scm.org/D2321 diff -r 3e1139b7d617 -r a67b144ef74f tests/test-mq-eol.t --- a/tests/test-mq-eol.t Sun Feb 18 17:35:44 2018 +0530 +++ b/tests/test-mq-eol.t Sun Feb 18 17:36:52 2018 +0530 @@ -12,27 +12,27 @@ $ cat > makepatch.py < f = open('eol.diff', 'wb') > w = f.write - > w('test message\n') - > w('diff --git a/a b/a\n') - > w('--- a/a\n') - > w('+++ b/a\n') - > w('@@ -1,5 +1,5 @@\n') - > w(' a\n') - > w('-b\r\n') - > w('+y\r\n') - > w(' c\r\n') - > w(' d\n') - > w('-e\n') - > w('\ No newline at end of file\n') - > w('+z\r\n') - > w('\ No newline at end of file\r\n') + > w(b'test message\n') + > w(b'diff --git a/a b/a\n') + > w(b'--- a/a\n') + > w(b'+++ b/a\n') + > w(b'@@ -1,5 +1,5 @@\n') + > w(b' a\n') + > w(b'-b\r\n') + > w(b'+y\r\n') + > w(b' c\r\n') + > w(b' d\n') + > w(b'-e\n') + > w(b'\ No newline at end of file\n') + > w(b'+z\r\n') + > w(b'\ No newline at end of file\r\n') > EOF $ cat > cateol.py < import sys > for line in open(sys.argv[1], 'rb'): - > line = line.replace('\r', '') - > line = line.replace('\n', '') + > line = line.replace(b'\r', b'') + > line = line.replace(b'\n', b'') > print(line) > EOF @@ -44,7 +44,7 @@ Test different --eol values - $ $PYTHON -c 'open("a", "wb").write("a\nb\nc\nd\ne")' + $ $PYTHON -c 'open("a", "wb").write(b"a\nb\nc\nd\ne")' $ hg ci -Am adda adding .hgignore adding a @@ -152,15 +152,15 @@ $ hg init testeol $ cd testeol - $ $PYTHON -c "open('a', 'wb').write('1\r\n2\r\n3\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n3\r\n4')" $ hg ci -Am adda adding a - $ $PYTHON -c "open('a', 'wb').write('1\r\n2\r\n33\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n2\r\n33\r\n4')" $ hg qnew patch1 $ hg qpop popping patch1 patch queue now empty - $ $PYTHON -c "open('a', 'wb').write('1\r\n22\r\n33\r\n4')" + $ $PYTHON -c "open('a', 'wb').write(b'1\r\n22\r\n33\r\n4')" $ hg ci -m changea $ hg --config 'patch.eol=LF' qpush