##// END OF EJS Templates
py2: drop some more from __future__ statements...
Gregory Szorc -
r49734:9987d14a default
parent child Browse files
Show More
@@ -626,7 +626,6 b' def find_cycles(imports):'
626
626
627 All module names recorded in `imports` should be absolute one.
627 All module names recorded in `imports` should be absolute one.
628
628
629 >>> from __future__ import print_function
630 >>> imports = {'top.foo': ['top.bar', 'os.path', 'top.qux'],
629 >>> imports = {'top.foo': ['top.bar', 'os.path', 'top.qux'],
631 ... 'top.bar': ['top.baz', 'sys'],
630 ... 'top.bar': ['top.baz', 'sys'],
632 ... 'top.baz': ['top.foo'],
631 ... 'top.baz': ['top.foo'],
@@ -23,7 +23,6 b' typical client does not want echo-back m'
23 $ hg init repo
23 $ hg init repo
24 $ cd repo
24 $ cd repo
25
25
26 >>> from __future__ import absolute_import
27 >>> import os
26 >>> import os
28 >>> import sys
27 >>> import sys
29 >>> from hgclient import bprint, check, readchannel, runcommand
28 >>> from hgclient import bprint, check, readchannel, runcommand
@@ -435,7 +435,7 b' convert binary file'
435 $ cd git-repo3-hg
435 $ cd git-repo3-hg
436 $ hg up -C
436 $ hg up -C
437 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
437 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
438 $ "$PYTHON" -c 'from __future__ import print_function; print(len(open("b", "rb").read()))'
438 $ "$PYTHON" -c 'print(len(open("b", "rb").read()))'
439 4096
439 4096
440 $ cd ..
440 $ cd ..
441
441
@@ -25,7 +25,6 b' inserted due to big distance from its pa'
25 > done
25 > done
26
26
27 $ cd ..
27 $ cd ..
28 >>> from __future__ import print_function
29 >>> import os
28 >>> import os
30 >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size
29 >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size
31 >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size
30 >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size
@@ -71,7 +71,7 b' issue1829: wrong indentation'
71 config error at $TESTTMP/hgrc:2: unexpected leading whitespace: x = y
71 config error at $TESTTMP/hgrc:2: unexpected leading whitespace: x = y
72 [255]
72 [255]
73
73
74 $ "$PYTHON" -c "from __future__ import print_function; print('[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n')" \
74 $ "$PYTHON" -c "print('[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n')" \
75 > > $HGRC
75 > > $HGRC
76 $ hg showconfig foo
76 $ hg showconfig foo
77 foo.bar=a\nb\nc\nde\nfg
77 foo.bar=a\nb\nc\nde\nfg
@@ -329,7 +329,7 b' stop and restart'
329
329
330 Test the access/error files are opened in append mode
330 Test the access/error files are opened in append mode
331
331
332 $ "$PYTHON" -c "from __future__ import print_function; print(len(open('access.log', 'rb').readlines()), 'log lines written')"
332 $ "$PYTHON" -c "print(len(open('access.log', 'rb').readlines()), 'log lines written')"
333 14 log lines written
333 14 log lines written
334
334
335 static file
335 static file
@@ -1412,7 +1412,6 b' suppress expanding keywords at subsequen'
1412 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1412 $ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new
1413 $ mv $HGRCPATH.new $HGRCPATH
1413 $ mv $HGRCPATH.new $HGRCPATH
1414
1414
1415 >>> from __future__ import print_function
1416 >>> from hgclient import check, readchannel, runcommand
1415 >>> from hgclient import check, readchannel, runcommand
1417 >>> @check
1416 >>> @check
1418 ... def check(server):
1417 ... def check(server):
@@ -107,7 +107,6 b' non-lfs content, and the extension enabl'
107
107
108 $ cd client
108 $ cd client
109 $ echo 'non-lfs' > nonlfs.txt
109 $ echo 'non-lfs' > nonlfs.txt
110 >>> from __future__ import absolute_import
111 >>> from hgclient import check, readchannel, runcommand
110 >>> from hgclient import check, readchannel, runcommand
112 >>> @check
111 >>> @check
113 ... def diff(server):
112 ... def diff(server):
@@ -240,7 +239,6 b' times.'
240
239
241 $ cd ../cmdserve_client3
240 $ cd ../cmdserve_client3
242
241
243 >>> from __future__ import absolute_import
244 >>> from hgclient import check, readchannel, runcommand
242 >>> from hgclient import check, readchannel, runcommand
245 >>> @check
243 >>> @check
246 ... def addrequirement(server):
244 ... def addrequirement(server):
@@ -355,7 +353,6 b' lfs content, and the extension enabled.'
355 $ mv $HGRCPATH $HGRCPATH.tmp
353 $ mv $HGRCPATH $HGRCPATH.tmp
356 $ cp $HGRCPATH.orig $HGRCPATH
354 $ cp $HGRCPATH.orig $HGRCPATH
357
355
358 >>> from __future__ import absolute_import
359 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
356 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
360 >>> @check
357 >>> @check
361 ... def checkflags(server):
358 ... def checkflags(server):
@@ -404,7 +401,6 b' lfs content, and the extension enabled.'
404 > lfs = !
401 > lfs = !
405 > EOF
402 > EOF
406
403
407 >>> from __future__ import absolute_import, print_function
408 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
404 >>> from hgclient import bprint, check, readchannel, runcommand, stdout
409 >>> @check
405 >>> @check
410 ... def checkflags2(server):
406 ... def checkflags2(server):
@@ -40,7 +40,7 b' push'
40
40
41 $ hg --traceback --cwd b push ../a 2>&1 |
41 $ hg --traceback --cwd b push ../a 2>&1 |
42 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
42 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
43 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
43 > "$PYTHON" -c 'import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
44 pushing to ../a
44 pushing to ../a
45 searching for changes
45 searching for changes
46 adding changesets
46 adding changesets
@@ -95,7 +95,7 b' unbundle with correct source'
95
95
96 $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
96 $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
97 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
97 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
98 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
98 > "$PYTHON" -c 'import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
99 adding changesets
99 adding changesets
100 adding manifests
100 adding manifests
101 adding file changes
101 adding file changes
@@ -172,7 +172,7 b' push'
172
172
173 $ hg --traceback --cwd b --config notify.fromauthor=True push ../a 2>&1 |
173 $ hg --traceback --cwd b --config notify.fromauthor=True push ../a 2>&1 |
174 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
174 > "$PYTHON" $TESTDIR/unwrap-message-id.py | \
175 > "$PYTHON" -c 'from __future__ import print_function ; import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
175 > "$PYTHON" -c 'import sys,re; print(re.sub("\n\t", " ", sys.stdin.read()), end="")'
176 pushing to ../a
176 pushing to ../a
177 searching for changes
177 searching for changes
178 adding changesets
178 adding changesets
@@ -90,12 +90,12 b" MSYS changes 'file:' into 'file;'"
90 It's tricky to make file:// URLs working on every platform with
90 It's tricky to make file:// URLs working on every platform with
91 regular shell commands.
91 regular shell commands.
92
92
93 $ URL=`"$PYTHON" -c "from __future__ import print_function; import os; print('file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
93 $ URL=`"$PYTHON" -c "import os; print('file://foobar' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
94 $ hg pull -q "$URL"
94 $ hg pull -q "$URL"
95 abort: file:// URLs can only refer to localhost
95 abort: file:// URLs can only refer to localhost
96 [255]
96 [255]
97
97
98 $ URL=`"$PYTHON" -c "from __future__ import print_function; import os; print('file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
98 $ URL=`"$PYTHON" -c "import os; print('file://localhost' + ('/' + os.getcwd().replace(os.sep, '/')).replace('//', '/') + '/../test')"`
99 $ hg pull -q "$URL"
99 $ hg pull -q "$URL"
100
100
101 SEC: check for unsafe ssh url
101 SEC: check for unsafe ssh url
@@ -682,7 +682,6 b' Create the file (as empty), then update '
682 "hg cp" does not preserve the mtime, so it should be newer than the 2009
682 "hg cp" does not preserve the mtime, so it should be newer than the 2009
683 timestamp.
683 timestamp.
684 $ hg cp -q mtime mtime_cp
684 $ hg cp -q mtime mtime_cp
685 >>> from __future__ import print_function
686 >>> import os
685 >>> import os
687 >>> filename = "mtime_cp/f"
686 >>> filename = "mtime_cp/f"
688 >>> print(os.stat(filename).st_mtime < 1234567999)
687 >>> print(os.stat(filename).st_mtime < 1234567999)
@@ -691,7 +690,6 b' timestamp.'
691 (modulo some fudge factor due to not every system supporting 1s-level
690 (modulo some fudge factor due to not every system supporting 1s-level
692 precision).
691 precision).
693 $ hg mv -q mtime mtime_mv
692 $ hg mv -q mtime mtime_mv
694 >>> from __future__ import print_function
695 >>> import os
693 >>> import os
696 >>> filename = "mtime_mv/f"
694 >>> filename = "mtime_mv/f"
697 >>> print(os.stat(filename).st_mtime < 1234567999)
695 >>> print(os.stat(filename).st_mtime < 1234567999)
@@ -315,7 +315,6 b' hg status -A:'
315 ]
315 ]
316
316
317 $ hg status -A -Tpickle > pickle
317 $ hg status -A -Tpickle > pickle
318 >>> from __future__ import print_function
319 >>> import pickle
318 >>> import pickle
320 >>> from mercurial import util
319 >>> from mercurial import util
321 >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb")))
320 >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb")))
@@ -249,7 +249,7 b' debugsub in clone'
249
249
250 verify subrepo is contained within the repo directory
250 verify subrepo is contained within the repo directory
251
251
252 $ "$PYTHON" -c "from __future__ import print_function; import os.path; print(os.path.exists('s'))"
252 $ "$PYTHON" -c "import os.path; print(os.path.exists('s'))"
253 True
253 True
254
254
255 update to nullrev (must delete the subrepo)
255 update to nullrev (must delete the subrepo)
@@ -192,7 +192,6 b' Age filter:'
192 $ cd unstable-hash
192 $ cd unstable-hash
193 $ hg log --template '{date|age}\n' > /dev/null || exit 1
193 $ hg log --template '{date|age}\n' > /dev/null || exit 1
194
194
195 >>> from __future__ import absolute_import
196 >>> import datetime
195 >>> import datetime
197 >>> fp = open('a', 'wb')
196 >>> fp = open('a', 'wb')
198 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
197 >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
@@ -26,7 +26,6 b' Return codes before inline python:'
26
26
27 Doctest commands:
27 Doctest commands:
28
28
29 >>> from __future__ import print_function
30 >>> print('foo')
29 >>> print('foo')
31 foo
30 foo
32 $ echo interleaved
31 $ echo interleaved
@@ -734,7 +734,6 b' Upgrading a repository to generaldelta w'
734 $ touch FooBarDirectory.d/f1
734 $ touch FooBarDirectory.d/f1
735 $ hg -q commit -A -m 'add f1'
735 $ hg -q commit -A -m 'add f1'
736 $ hg -q up -r 0
736 $ hg -q up -r 0
737 >>> from __future__ import absolute_import, print_function
738 >>> import random
737 >>> import random
739 >>> random.seed(0) # have a reproducible content
738 >>> random.seed(0) # have a reproducible content
740 >>> with open("f2", "wb") as f:
739 >>> with open("f2", "wb") as f:
General Comments 0
You need to be logged in to leave comments. Login now