sapling/eden/scm/tests/test-status-inprocess.py
Saurabh Singh 8f5ec4b183 test-status-inprocess: make the test output more stable
Summary:
Write output using `ui` object instead of using `print` to improve
robustness.

Reviewed By: quark-zju

Differential Revision: D19738486

fbshipit-source-id: 4da80ce7efef44e9c5694ed71a55b7d64629166c
2020-02-04 20:36:42 -08:00

33 lines
670 B
Python
Executable File

#!/usr/bin/env python
from __future__ import absolute_import, print_function
from edenscm.mercurial import commands, localrepo, ui as uimod
u = uimod.ui.load()
u.write("% creating repo\n")
repo = localrepo.localrepository(u, ".", create=True)
f = open("test.py", "w")
try:
f.write("foo\n")
finally:
f.close
u.write("% add and commit\n")
commands.add(u, repo, "test.py")
commands.commit(u, repo, message="*")
commands.status(u, repo, clean=True)
u.write("% change\n")
f = open("test.py", "w")
try:
f.write("bar\n")
finally:
f.close()
# this would return clean instead of changed before the fix
commands.status(u, repo, clean=True, modified=True)