test-status-inprocess.py
35 lines
| 666 B
| text/x-python
|
PythonLexer
/ tests / test-status-inprocess.py
|
r28824 | #!/usr/bin/env python | ||
|
r28766 | from __future__ import absolute_import, print_function | ||
|
r28843 | |||
from mercurial import ( | ||||
commands, | ||||
localrepo, | ||||
ui as uimod, | ||||
|
r28765 | ) | ||
|
r10838 | |||
|
r30559 | u = uimod.ui.load() | ||
|
r10838 | |||
|
r28766 | print('% creating repo') | ||
|
r28843 | repo = localrepo.localrepository(u, '.', create=True) | ||
|
r10838 | |||
f = open('test.py', 'w') | ||||
try: | ||||
f.write('foo\n') | ||||
finally: | ||||
f.close | ||||
|
r28766 | print('% add and commit') | ||
|
r28843 | commands.add(u, repo, 'test.py') | ||
commands.commit(u, repo, message='*') | ||||
commands.status(u, repo, clean=True) | ||||
|
r10838 | |||
|
r28766 | print('% change') | ||
|
r10838 | f = open('test.py', 'w') | ||
try: | ||||
f.write('bar\n') | ||||
finally: | ||||
f.close() | ||||
# this would return clean instead of changed before the fix | ||||
|
r28843 | commands.status(u, repo, clean=True, modified=True) | ||