##// END OF EJS Templates
tests: test-dispatch use print_function
timeless -
r28405:1d9d29d4 default
parent child Browse files
Show More
@@ -1,140 +1,139 b''
1 #require test-repo
1 #require test-repo
2
2
3 $ cd "$TESTDIR"/..
3 $ cd "$TESTDIR"/..
4
4
5 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
5 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
6 contrib/check-code.py not using absolute_import
6 contrib/check-code.py not using absolute_import
7 contrib/check-code.py requires print_function
7 contrib/check-code.py requires print_function
8 contrib/debugshell.py not using absolute_import
8 contrib/debugshell.py not using absolute_import
9 contrib/import-checker.py not using absolute_import
9 contrib/import-checker.py not using absolute_import
10 contrib/import-checker.py requires print_function
10 contrib/import-checker.py requires print_function
11 contrib/memory.py not using absolute_import
11 contrib/memory.py not using absolute_import
12 contrib/perf.py not using absolute_import
12 contrib/perf.py not using absolute_import
13 contrib/python-hook-examples.py not using absolute_import
13 contrib/python-hook-examples.py not using absolute_import
14 contrib/revsetbenchmarks.py not using absolute_import
14 contrib/revsetbenchmarks.py not using absolute_import
15 contrib/revsetbenchmarks.py requires print_function
15 contrib/revsetbenchmarks.py requires print_function
16 contrib/showstack.py not using absolute_import
16 contrib/showstack.py not using absolute_import
17 contrib/synthrepo.py not using absolute_import
17 contrib/synthrepo.py not using absolute_import
18 contrib/win32/hgwebdir_wsgi.py not using absolute_import
18 contrib/win32/hgwebdir_wsgi.py not using absolute_import
19 doc/check-seclevel.py not using absolute_import
19 doc/check-seclevel.py not using absolute_import
20 doc/gendoc.py not using absolute_import
20 doc/gendoc.py not using absolute_import
21 doc/hgmanpage.py not using absolute_import
21 doc/hgmanpage.py not using absolute_import
22 hgext/__init__.py not using absolute_import
22 hgext/__init__.py not using absolute_import
23 hgext/color.py not using absolute_import
23 hgext/color.py not using absolute_import
24 hgext/convert/__init__.py not using absolute_import
24 hgext/convert/__init__.py not using absolute_import
25 hgext/convert/bzr.py not using absolute_import
25 hgext/convert/bzr.py not using absolute_import
26 hgext/convert/common.py not using absolute_import
26 hgext/convert/common.py not using absolute_import
27 hgext/convert/convcmd.py not using absolute_import
27 hgext/convert/convcmd.py not using absolute_import
28 hgext/convert/cvs.py not using absolute_import
28 hgext/convert/cvs.py not using absolute_import
29 hgext/convert/subversion.py not using absolute_import
29 hgext/convert/subversion.py not using absolute_import
30 hgext/convert/transport.py not using absolute_import
30 hgext/convert/transport.py not using absolute_import
31 hgext/eol.py not using absolute_import
31 hgext/eol.py not using absolute_import
32 hgext/extdiff.py not using absolute_import
32 hgext/extdiff.py not using absolute_import
33 hgext/factotum.py not using absolute_import
33 hgext/factotum.py not using absolute_import
34 hgext/fetch.py not using absolute_import
34 hgext/fetch.py not using absolute_import
35 hgext/gpg.py not using absolute_import
35 hgext/gpg.py not using absolute_import
36 hgext/graphlog.py not using absolute_import
36 hgext/graphlog.py not using absolute_import
37 hgext/hgcia.py not using absolute_import
37 hgext/hgcia.py not using absolute_import
38 hgext/hgk.py not using absolute_import
38 hgext/hgk.py not using absolute_import
39 hgext/highlight/__init__.py not using absolute_import
39 hgext/highlight/__init__.py not using absolute_import
40 hgext/highlight/highlight.py not using absolute_import
40 hgext/highlight/highlight.py not using absolute_import
41 hgext/histedit.py not using absolute_import
41 hgext/histedit.py not using absolute_import
42 hgext/largefiles/__init__.py not using absolute_import
42 hgext/largefiles/__init__.py not using absolute_import
43 hgext/largefiles/basestore.py not using absolute_import
43 hgext/largefiles/basestore.py not using absolute_import
44 hgext/largefiles/lfcommands.py not using absolute_import
44 hgext/largefiles/lfcommands.py not using absolute_import
45 hgext/largefiles/lfutil.py not using absolute_import
45 hgext/largefiles/lfutil.py not using absolute_import
46 hgext/largefiles/localstore.py not using absolute_import
46 hgext/largefiles/localstore.py not using absolute_import
47 hgext/largefiles/overrides.py not using absolute_import
47 hgext/largefiles/overrides.py not using absolute_import
48 hgext/largefiles/proto.py not using absolute_import
48 hgext/largefiles/proto.py not using absolute_import
49 hgext/largefiles/remotestore.py not using absolute_import
49 hgext/largefiles/remotestore.py not using absolute_import
50 hgext/largefiles/reposetup.py not using absolute_import
50 hgext/largefiles/reposetup.py not using absolute_import
51 hgext/largefiles/uisetup.py not using absolute_import
51 hgext/largefiles/uisetup.py not using absolute_import
52 hgext/largefiles/wirestore.py not using absolute_import
52 hgext/largefiles/wirestore.py not using absolute_import
53 hgext/mq.py not using absolute_import
53 hgext/mq.py not using absolute_import
54 hgext/notify.py not using absolute_import
54 hgext/notify.py not using absolute_import
55 hgext/patchbomb.py not using absolute_import
55 hgext/patchbomb.py not using absolute_import
56 hgext/rebase.py not using absolute_import
56 hgext/rebase.py not using absolute_import
57 hgext/share.py not using absolute_import
57 hgext/share.py not using absolute_import
58 hgext/transplant.py not using absolute_import
58 hgext/transplant.py not using absolute_import
59 hgext/win32mbcs.py not using absolute_import
59 hgext/win32mbcs.py not using absolute_import
60 hgext/win32text.py not using absolute_import
60 hgext/win32text.py not using absolute_import
61 i18n/check-translation.py not using absolute_import
61 i18n/check-translation.py not using absolute_import
62 i18n/polib.py not using absolute_import
62 i18n/polib.py not using absolute_import
63 setup.py not using absolute_import
63 setup.py not using absolute_import
64 tests/filterpyflakes.py requires print_function
64 tests/filterpyflakes.py requires print_function
65 tests/generate-working-copy-states.py requires print_function
65 tests/generate-working-copy-states.py requires print_function
66 tests/get-with-headers.py requires print_function
66 tests/get-with-headers.py requires print_function
67 tests/heredoctest.py requires print_function
67 tests/heredoctest.py requires print_function
68 tests/hypothesishelpers.py not using absolute_import
68 tests/hypothesishelpers.py not using absolute_import
69 tests/hypothesishelpers.py requires print_function
69 tests/hypothesishelpers.py requires print_function
70 tests/killdaemons.py not using absolute_import
70 tests/killdaemons.py not using absolute_import
71 tests/md5sum.py not using absolute_import
71 tests/md5sum.py not using absolute_import
72 tests/mockblackbox.py not using absolute_import
72 tests/mockblackbox.py not using absolute_import
73 tests/printenv.py not using absolute_import
73 tests/printenv.py not using absolute_import
74 tests/readlink.py not using absolute_import
74 tests/readlink.py not using absolute_import
75 tests/readlink.py requires print_function
75 tests/readlink.py requires print_function
76 tests/revlog-formatv0.py not using absolute_import
76 tests/revlog-formatv0.py not using absolute_import
77 tests/run-tests.py not using absolute_import
77 tests/run-tests.py not using absolute_import
78 tests/seq.py not using absolute_import
78 tests/seq.py not using absolute_import
79 tests/seq.py requires print_function
79 tests/seq.py requires print_function
80 tests/silenttestrunner.py not using absolute_import
80 tests/silenttestrunner.py not using absolute_import
81 tests/silenttestrunner.py requires print_function
81 tests/silenttestrunner.py requires print_function
82 tests/sitecustomize.py not using absolute_import
82 tests/sitecustomize.py not using absolute_import
83 tests/svn-safe-append.py not using absolute_import
83 tests/svn-safe-append.py not using absolute_import
84 tests/svnxml.py not using absolute_import
84 tests/svnxml.py not using absolute_import
85 tests/test-ancestor.py requires print_function
85 tests/test-ancestor.py requires print_function
86 tests/test-atomictempfile.py not using absolute_import
86 tests/test-atomictempfile.py not using absolute_import
87 tests/test-batching.py not using absolute_import
87 tests/test-batching.py not using absolute_import
88 tests/test-batching.py requires print_function
88 tests/test-batching.py requires print_function
89 tests/test-bdiff.py not using absolute_import
89 tests/test-bdiff.py not using absolute_import
90 tests/test-bdiff.py requires print_function
90 tests/test-bdiff.py requires print_function
91 tests/test-context.py not using absolute_import
91 tests/test-context.py not using absolute_import
92 tests/test-context.py requires print_function
92 tests/test-context.py requires print_function
93 tests/test-demandimport.py not using absolute_import
93 tests/test-demandimport.py not using absolute_import
94 tests/test-demandimport.py requires print_function
94 tests/test-demandimport.py requires print_function
95 tests/test-dispatch.py requires print_function
96 tests/test-doctest.py not using absolute_import
95 tests/test-doctest.py not using absolute_import
97 tests/test-duplicateoptions.py not using absolute_import
96 tests/test-duplicateoptions.py not using absolute_import
98 tests/test-duplicateoptions.py requires print_function
97 tests/test-duplicateoptions.py requires print_function
99 tests/test-filecache.py not using absolute_import
98 tests/test-filecache.py not using absolute_import
100 tests/test-filecache.py requires print_function
99 tests/test-filecache.py requires print_function
101 tests/test-filelog.py not using absolute_import
100 tests/test-filelog.py not using absolute_import
102 tests/test-filelog.py requires print_function
101 tests/test-filelog.py requires print_function
103 tests/test-hg-parseurl.py not using absolute_import
102 tests/test-hg-parseurl.py not using absolute_import
104 tests/test-hg-parseurl.py requires print_function
103 tests/test-hg-parseurl.py requires print_function
105 tests/test-hgweb-auth.py not using absolute_import
104 tests/test-hgweb-auth.py not using absolute_import
106 tests/test-hgweb-auth.py requires print_function
105 tests/test-hgweb-auth.py requires print_function
107 tests/test-hgwebdir-paths.py not using absolute_import
106 tests/test-hgwebdir-paths.py not using absolute_import
108 tests/test-hybridencode.py not using absolute_import
107 tests/test-hybridencode.py not using absolute_import
109 tests/test-hybridencode.py requires print_function
108 tests/test-hybridencode.py requires print_function
110 tests/test-lrucachedict.py not using absolute_import
109 tests/test-lrucachedict.py not using absolute_import
111 tests/test-lrucachedict.py requires print_function
110 tests/test-lrucachedict.py requires print_function
112 tests/test-manifest.py not using absolute_import
111 tests/test-manifest.py not using absolute_import
113 tests/test-minirst.py not using absolute_import
112 tests/test-minirst.py not using absolute_import
114 tests/test-minirst.py requires print_function
113 tests/test-minirst.py requires print_function
115 tests/test-parseindex2.py not using absolute_import
114 tests/test-parseindex2.py not using absolute_import
116 tests/test-parseindex2.py requires print_function
115 tests/test-parseindex2.py requires print_function
117 tests/test-pathencode.py not using absolute_import
116 tests/test-pathencode.py not using absolute_import
118 tests/test-pathencode.py requires print_function
117 tests/test-pathencode.py requires print_function
119 tests/test-propertycache.py not using absolute_import
118 tests/test-propertycache.py not using absolute_import
120 tests/test-propertycache.py requires print_function
119 tests/test-propertycache.py requires print_function
121 tests/test-revlog-ancestry.py not using absolute_import
120 tests/test-revlog-ancestry.py not using absolute_import
122 tests/test-revlog-ancestry.py requires print_function
121 tests/test-revlog-ancestry.py requires print_function
123 tests/test-run-tests.py not using absolute_import
122 tests/test-run-tests.py not using absolute_import
124 tests/test-simplemerge.py not using absolute_import
123 tests/test-simplemerge.py not using absolute_import
125 tests/test-status-inprocess.py not using absolute_import
124 tests/test-status-inprocess.py not using absolute_import
126 tests/test-status-inprocess.py requires print_function
125 tests/test-status-inprocess.py requires print_function
127 tests/test-symlink-os-yes-fs-no.py not using absolute_import
126 tests/test-symlink-os-yes-fs-no.py not using absolute_import
128 tests/test-trusted.py not using absolute_import
127 tests/test-trusted.py not using absolute_import
129 tests/test-trusted.py requires print_function
128 tests/test-trusted.py requires print_function
130 tests/test-ui-color.py not using absolute_import
129 tests/test-ui-color.py not using absolute_import
131 tests/test-ui-color.py requires print_function
130 tests/test-ui-color.py requires print_function
132 tests/test-ui-config.py not using absolute_import
131 tests/test-ui-config.py not using absolute_import
133 tests/test-ui-config.py requires print_function
132 tests/test-ui-config.py requires print_function
134 tests/test-ui-verbosity.py not using absolute_import
133 tests/test-ui-verbosity.py not using absolute_import
135 tests/test-ui-verbosity.py requires print_function
134 tests/test-ui-verbosity.py requires print_function
136 tests/test-url.py not using absolute_import
135 tests/test-url.py not using absolute_import
137 tests/test-url.py requires print_function
136 tests/test-url.py requires print_function
138 tests/test-walkrepo.py requires print_function
137 tests/test-walkrepo.py requires print_function
139 tests/test-wireproto.py requires print_function
138 tests/test-wireproto.py requires print_function
140 tests/tinyproxy.py requires print_function
139 tests/tinyproxy.py requires print_function
@@ -1,36 +1,35 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import, print_function
2 import os
2 import os
3 from mercurial import (
3 from mercurial import (
4 dispatch,
4 dispatch,
5 )
5 )
6
6
7 def testdispatch(cmd):
7 def testdispatch(cmd):
8 """Simple wrapper around dispatch.dispatch()
8 """Simple wrapper around dispatch.dispatch()
9
9
10 Prints command and result value, but does not handle quoting.
10 Prints command and result value, but does not handle quoting.
11 """
11 """
12 print "running: %s" % (cmd,)
12 print("running: %s" % (cmd,))
13 req = dispatch.request(cmd.split())
13 req = dispatch.request(cmd.split())
14 result = dispatch.dispatch(req)
14 result = dispatch.dispatch(req)
15 print "result: %r" % (result,)
15 print("result: %r" % (result,))
16
17
16
18 testdispatch("init test1")
17 testdispatch("init test1")
19 os.chdir('test1')
18 os.chdir('test1')
20
19
21 # create file 'foo', add and commit
20 # create file 'foo', add and commit
22 f = open('foo', 'wb')
21 f = open('foo', 'wb')
23 f.write('foo\n')
22 f.write('foo\n')
24 f.close()
23 f.close()
25 testdispatch("add foo")
24 testdispatch("add foo")
26 testdispatch("commit -m commit1 -d 2000-01-01 foo")
25 testdispatch("commit -m commit1 -d 2000-01-01 foo")
27
26
28 # append to file 'foo' and commit
27 # append to file 'foo' and commit
29 f = open('foo', 'ab')
28 f = open('foo', 'ab')
30 f.write('bar\n')
29 f.write('bar\n')
31 f.close()
30 f.close()
32 testdispatch("commit -m commit2 -d 2000-01-02 foo")
31 testdispatch("commit -m commit2 -d 2000-01-02 foo")
33
32
34 # check 88803a69b24 (fancyopts modified command table)
33 # check 88803a69b24 (fancyopts modified command table)
35 testdispatch("log -r 0")
34 testdispatch("log -r 0")
36 testdispatch("log -r tip")
35 testdispatch("log -r tip")
General Comments 0
You need to be logged in to leave comments. Login now