view tests/test-status-inprocess.py @ 27970:3d23700cf4a9 stable

osutil: disable compilation of recvfds() on unsupported platforms It appears that Solaris doesn't provide CMSG_LEN(), msg_control, etc. As recvfds() is only necessary for chg, this patch just drops it if CMSG_LEN isn't defined, which is the same workaround as Python 3.x. https://hg.python.org/cpython/rev/c64216addd7f#l7.33
author Yuya Nishihara <yuya@tcha.org>
date Tue, 02 Feb 2016 20:56:48 +0900
parents 13a1b2fb7ef2
children 7779f9dfd938
line wrap: on
line source

#!/usr/bin/python
from mercurial.ui import ui
from mercurial.localrepo import localrepository
from mercurial.commands import add, commit, status

u = ui()

print '% creating repo'
repo = localrepository(u, '.', create=True)

f = open('test.py', 'w')
try:
    f.write('foo\n')
finally:
    f.close

print '% add and commit'
add(u, repo, 'test.py')
commit(u, repo, message='*')
status(u, repo, clean=True)


print '% change'
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)