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