Mercurial > hg
annotate tests/test-status-inprocess.py @ 23367:115af8de76a4
subrepo: add "_cachestorehashvfs" to handle cache store hash files via vfs
This "vfs" object will be used by subsequent patches to handle cache
store hash files without direct file APIs.
This patch decorates "_cachestorehashvfs" with "@propertycache" to
delay vfs creation, because it is used only for cooperation with other
repositories.
In this patch, "/" is used as the path separator, even though
"self._repo.join" uses platform specific path separator (e.g. "\\" on
Windows). But it is reasonable enough, because "store" and other
management file handling already include such implementation, and they
work well.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 19 Nov 2014 18:35:14 +0900 |
parents | 13a1b2fb7ef2 |
children | 7779f9dfd938 |
rev | line source |
---|---|
10838
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
1 #!/usr/bin/python |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
2 from mercurial.ui import ui |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
3 from mercurial.localrepo import localrepository |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
4 from mercurial.commands import add, commit, status |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
5 |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
6 u = ui() |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
7 |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
8 print '% creating repo' |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
9 repo = localrepository(u, '.', create=True) |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
10 |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
11 f = open('test.py', 'w') |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
12 try: |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
13 f.write('foo\n') |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
14 finally: |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
15 f.close |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
16 |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
17 print '% add and commit' |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
18 add(u, repo, 'test.py') |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
19 commit(u, repo, message='*') |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
20 status(u, repo, clean=True) |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
21 |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
22 |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
23 print '% change' |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
24 f = open('test.py', 'w') |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
25 try: |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
26 f.write('bar\n') |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
27 finally: |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
28 f.close() |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
29 |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
30 # this would return clean instead of changed before the fix |
07dbafd3a0e2
add a test for the inprocess status dirstate race
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
diff
changeset
|
31 status(u, repo, clean=True, modified=True) |