Mercurial > hg
comparison tests/test-export.t @ 27416:9d04b4da6773
export: do not print '<fdopen>' as an output filename
Because makefileobj() duplicates or wraps stdout, "fp != sys.stdout" didn't
work correctly. Python doc states that special file objects are named in the
form '<...>', and absolute filenames should never start with '<', we can
ignore names start with '<'. We can't test fp.fileno() because fp may be a
command-server channel.
https://docs.python.org/2.7/library/stdtypes.html#file.name
In the test output, "exporting patch:" line is printed after patch content.
This is caused by fdopen() and will be fixed by the subsequent patch.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 13 Dec 2015 19:47:46 +0900 |
parents | e955549cd045 |
children | 7e2495bf0ad8 |
comparison
equal
deleted
inserted
replaced
27415:f4ca33e33781 | 27416:9d04b4da6773 |
---|---|
135 foo-7 | 135 foo-7 |
136 foo-8 | 136 foo-8 |
137 foo-9 | 137 foo-9 |
138 +foo-10 | 138 +foo-10 |
139 | 139 |
140 No filename should be printed if stdout is specified explicitly: | |
141 | |
142 $ hg export -v 1 -o - | |
143 # HG changeset patch | |
144 # User test | |
145 # Date 0 0 | |
146 # Thu Jan 01 00:00:00 1970 +0000 | |
147 # Node ID d1c9656e973cfb5aebd5499bbd2cb350e3b12266 | |
148 # Parent 871558de6af2e8c244222f8eea69b782c94ce3df | |
149 foo-1 | |
150 | |
151 diff -r 871558de6af2 -r d1c9656e973c foo | |
152 --- a/foo Thu Jan 01 00:00:00 1970 +0000 | |
153 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
154 @@ -1,1 +1,2 @@ | |
155 foo-0 | |
156 +foo-1 | |
157 exporting patch: | |
158 | |
140 Checking if only alphanumeric characters are used in the file name (%m option): | 159 Checking if only alphanumeric characters are used in the file name (%m option): |
141 | 160 |
142 $ echo "line" >> foo | 161 $ echo "line" >> foo |
143 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~" | 162 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~" |
144 $ hg export -v -o %m.patch tip | 163 $ hg export -v -o %m.patch tip |