mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
8f5ec4b183
Summary: Write output using `ui` object instead of using `print` to improve robustness. Reviewed By: quark-zju Differential Revision: D19738486 fbshipit-source-id: 4da80ce7efef44e9c5694ed71a55b7d64629166c
33 lines
670 B
Python
Executable File
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)
|