[PATCH 6 of 7] tests: stop direct symbol import of mercurial modules in test-status-inprocess

Yuya Nishihara yuya at tcha.org
Sat Apr 9 06:56:18 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1459867080 -32400
#      Tue Apr 05 23:38:00 2016 +0900
# Node ID fa1fbae246e0dd2dfa2bd27c2f20f9d224f1f166
# Parent  6f77a23ca84124dcbbfa9421e52fa9c50825617e
tests: stop direct symbol import of mercurial modules in test-status-inprocess

diff --git a/tests/test-status-inprocess.py b/tests/test-status-inprocess.py
--- a/tests/test-status-inprocess.py
+++ b/tests/test-status-inprocess.py
@@ -1,21 +1,16 @@
 #!/usr/bin/env python
 from __future__ import absolute_import, print_function
-from mercurial.ui import (
-    ui,
-)
-from mercurial.localrepo import (
-    localrepository,
-)
-from mercurial.commands import (
-    add,
-    commit,
-    status,
+
+from mercurial import (
+    commands,
+    localrepo,
+    ui as uimod,
 )
 
-u = ui()
+u = uimod.ui()
 
 print('% creating repo')
-repo = localrepository(u, '.', create=True)
+repo = localrepo.localrepository(u, '.', create=True)
 
 f = open('test.py', 'w')
 try:
@@ -24,9 +19,9 @@ finally:
     f.close
 
 print('% add and commit')
-add(u, repo, 'test.py')
-commit(u, repo, message='*')
-status(u, repo, clean=True)
+commands.add(u, repo, 'test.py')
+commands.commit(u, repo, message='*')
+commands.status(u, repo, clean=True)
 
 
 print('% change')
@@ -37,4 +32,4 @@ finally:
     f.close()
 
 # this would return clean instead of changed before the fix
-status(u, repo, clean=True, modified=True)
+commands.status(u, repo, clean=True, modified=True)


More information about the Mercurial-devel mailing list