test-status-inprocess.py
35 lines
| 669 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') | ||
Pulkit Goyal
|
r37678 | repo = localrepo.localrepository(u, b'.', 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') | ||
Pulkit Goyal
|
r37678 | commands.add(u, repo, b'test.py') | ||
commands.commit(u, repo, message=b'*') | ||||
Yuya Nishihara
|
r28843 | 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) | ||