##// END OF EJS Templates
tests: explicitly flush output streams...
Jun Wu -
r28612:6fb1d3c9 default
parent child Browse files
Show More
@@ -166,6 +166,8 b' Create an extension to test bundle2 API'
166 > file.write(chunk)
166 > file.write(chunk)
167 > except RuntimeError, exc:
167 > except RuntimeError, exc:
168 > raise error.Abort(exc)
168 > raise error.Abort(exc)
169 > finally:
170 > file.flush()
169 >
171 >
170 > @command('unbundle2', [], '')
172 > @command('unbundle2', [], '')
171 > def cmdunbundle2(ui, repo, replypath=None):
173 > def cmdunbundle2(ui, repo, replypath=None):
@@ -194,9 +196,9 b' Create an extension to test bundle2 API'
194 > for rec in op.records['changegroup']:
196 > for rec in op.records['changegroup']:
195 > ui.write('addchangegroup return: %i\n' % rec['return'])
197 > ui.write('addchangegroup return: %i\n' % rec['return'])
196 > if op.reply is not None and replypath is not None:
198 > if op.reply is not None and replypath is not None:
197 > file = open(replypath, 'wb')
199 > with open(replypath, 'wb') as file:
198 > for chunk in op.reply.getchunks():
200 > for chunk in op.reply.getchunks():
199 > file.write(chunk)
201 > file.write(chunk)
200 >
202 >
201 > @command('statbundle2', [], '')
203 > @command('statbundle2', [], '')
202 > def cmdstatbundle2(ui, repo):
204 > def cmdstatbundle2(ui, repo):
@@ -7,9 +7,11 b' Test basic extension support'
7 > command = cmdutil.command(cmdtable)
7 > command = cmdutil.command(cmdtable)
8 > def uisetup(ui):
8 > def uisetup(ui):
9 > ui.write("uisetup called\\n")
9 > ui.write("uisetup called\\n")
10 > ui.flush()
10 > def reposetup(ui, repo):
11 > def reposetup(ui, repo):
11 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
12 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
12 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
13 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
14 > ui.flush()
13 > @command('foo', [], 'hg foo')
15 > @command('foo', [], 'hg foo')
14 > def foo(ui, *args, **kwargs):
16 > def foo(ui, *args, **kwargs):
15 > ui.write("Foo\\n")
17 > ui.write("Foo\\n")
@@ -183,6 +185,7 b' Check absolute/relative import of extens'
183 > import foo
185 > import foo
184 > def extsetup(ui):
186 > def extsetup(ui):
185 > ui.write('(extroot) ', foo.func(), '\n')
187 > ui.write('(extroot) ', foo.func(), '\n')
188 > ui.flush()
186 > EOF
189 > EOF
187
190
188 $ cat > $TESTTMP/extroot/foo.py <<EOF
191 $ cat > $TESTTMP/extroot/foo.py <<EOF
@@ -1077,6 +1080,7 b' Commands handling multiple repositories '
1077 > from mercurial import extensions
1080 > from mercurial import extensions
1078 > def reposetup(ui, repo):
1081 > def reposetup(ui, repo):
1079 > ui.write('reposetup() for %s\n' % (repo.root))
1082 > ui.write('reposetup() for %s\n' % (repo.root))
1083 > ui.flush()
1080 > EOF
1084 > EOF
1081 $ hg init src
1085 $ hg init src
1082 $ echo a > src/a
1086 $ echo a > src/a
@@ -935,7 +935,7 b' Test heads computation on pending index '
935 > opts['message'] = 'Test'
935 > opts['message'] = 'Test'
936 > opts['logfile'] = None
936 > opts['logfile'] = None
937 > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts)
937 > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts)
938 > print repo.changelog.headrevs()
938 > ui.write('%s\n' % repo.changelog.headrevs())
939 > EOF
939 > EOF
940 $ cat >> $HGRCPATH << EOF
940 $ cat >> $HGRCPATH << EOF
941 > [extensions]
941 > [extensions]
General Comments 0
You need to be logged in to leave comments. Login now