# HG changeset patch # User Yuya Nishihara # Date 2020-12-07 11:12:36 # Node ID 56a5ea35318236ed9d48651ca32075b5234859cd # Parent 1f0ed7e63c2ad0da2dc4846d25192db73fce457b test-extension: flush diagnostic message to stabilize chg output Since chg server may create new file object for the attached stdout, procutil.stdout is not ui.fout and the buffered procutil.stdout data wouldn't be flushed at all. That's why test-extension.t passes without modification on Python 2. diff --git a/tests/test-extension.t b/tests/test-extension.t --- a/tests/test-extension.t +++ b/tests/test-extension.t @@ -154,7 +154,10 @@ Check that extensions are loaded in phas > from mercurial import exthelper > from mercurial.utils import procutil > - > write = procutil.stdout.write + > def write(msg): + > procutil.stdout.write(msg) + > procutil.stdout.flush() + > > name = os.path.basename(__file__).rsplit('.', 1)[0] > bytesname = name.encode('utf-8') > write(b"1) %s imported\n" % bytesname) @@ -194,6 +197,9 @@ Check that extensions are loaded in phas Check normal command's load order of extensions and registration of functions + On chg server, extension should be first set up by the server. Then + object-level setup should follow in the worker process. + $ hg log -r "foo() and bar()" -q 1) foo imported 1) bar imported @@ -209,6 +215,18 @@ Check normal command's load order of ext 4) bar uipopulate 5) foo reposetup 5) bar reposetup + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 4) foo uipopulate (chg !) + 4) bar uipopulate (chg !) + 5) foo reposetup (chg !) + 5) bar reposetup (chg !) 0:c24b9ac61126 Check hgweb's load order of extensions and registration of functions