Mercurial > public > mercurial-scm > hg
comparison tests/test-status-inprocess.py @ 10838:07dbafd3a0e2 stable
add a test for the inprocess status dirstate race
author | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> |
---|---|
date | Mon, 05 Apr 2010 20:10:46 +0200 |
parents | |
children | 13a1b2fb7ef2 |
comparison
equal
deleted
inserted
replaced
10836:e5aaa4543289 | 10838:07dbafd3a0e2 |
---|---|
1 #!/usr/bin/python | |
2 import os | |
3 from mercurial.ui import ui | |
4 from mercurial.localrepo import localrepository | |
5 from mercurial.commands import add, commit, status | |
6 | |
7 u = ui() | |
8 | |
9 print '% creating repo' | |
10 repo = localrepository(u, '.', create=True) | |
11 | |
12 f = open('test.py', 'w') | |
13 try: | |
14 f.write('foo\n') | |
15 finally: | |
16 f.close | |
17 | |
18 print '% add and commit' | |
19 add(u, repo, 'test.py') | |
20 commit(u, repo, message='*') | |
21 status(u, repo, clean=True) | |
22 | |
23 | |
24 print '% change' | |
25 f = open('test.py', 'w') | |
26 try: | |
27 f.write('bar\n') | |
28 finally: | |
29 f.close() | |
30 | |
31 # this would return clean instead of changed before the fix | |
32 status(u, repo, clean=True, modified=True) |