test-status-inprocess.py
40 lines
| 698 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 | ||
Robert Stanca
|
r28765 | from mercurial.ui import ( | ||
ui, | ||||
) | ||||
from mercurial.localrepo import ( | ||||
localrepository, | ||||
) | ||||
from mercurial.commands import ( | ||||
add, | ||||
commit, | ||||
status, | ||||
) | ||||
Ronny Pfannschmidt
|
r10838 | |||
u = ui() | ||||
Robert Stanca
|
r28766 | print('% creating repo') | ||
Ronny Pfannschmidt
|
r10838 | repo = localrepository(u, '.', create=True) | ||
f = open('test.py', 'w') | ||||
try: | ||||
f.write('foo\n') | ||||
finally: | ||||
f.close | ||||
Robert Stanca
|
r28766 | print('% add and commit') | ||
Ronny Pfannschmidt
|
r10838 | add(u, repo, 'test.py') | ||
commit(u, repo, message='*') | ||||
status(u, repo, clean=True) | ||||
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 | ||||
status(u, repo, clean=True, modified=True) | ||||