D2321: py3: add b'' prefixes in test-mq-eol.t
pulkit (Pulkit Goyal)
phabricator at mercurial-scm.org
Sun Feb 18 09:17:06 EST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa67b144ef74f: py3: add b'' prefixes in test-mq-eol.t (authored by pulkit, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D2321?vs=5850&id=5866
REVISION DETAIL
https://phab.mercurial-scm.org/D2321
AFFECTED FILES
tests/test-mq-eol.t
CHANGE DETAILS
diff --git a/tests/test-mq-eol.t b/tests/test-mq-eol.t
--- a/tests/test-mq-eol.t
+++ b/tests/test-mq-eol.t
@@ -12,27 +12,27 @@
$ cat > makepatch.py <<EOF
> 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 <<EOF
> import sys
> for line in open(sys.argv[1], 'rb'):
- > line = line.replace('\r', '<CR>')
- > line = line.replace('\n', '<LF>')
+ > line = line.replace(b'\r', b'<CR>')
+ > line = line.replace(b'\n', b'<LF>')
> 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
To: pulkit, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list