Show More
@@ -10,25 +10,30 b" if subprocess.call(['python', '%s/hghave" | |||||
10 | from mercurial import ( |
|
10 | from mercurial import ( | |
11 | extensions, |
|
11 | extensions, | |
12 | hg, |
|
12 | hg, | |
13 | scmutil, |
|
13 | localrepo, | |
14 | ui as uimod, |
|
14 | ui as uimod, | |
15 | util, |
|
15 | util, | |
16 | vfs as vfsmod, |
|
16 | vfs as vfsmod, | |
17 | ) |
|
17 | ) | |
18 |
|
18 | |||
19 | filecache = scmutil.filecache |
|
|||
20 |
|
||||
21 | class fakerepo(object): |
|
19 | class fakerepo(object): | |
22 | def __init__(self): |
|
20 | def __init__(self): | |
23 | self._filecache = {} |
|
21 | self._filecache = {} | |
24 |
|
22 | |||
|
23 | class fakevfs(object): | |||
|
24 | ||||
25 | def join(self, p): |
|
25 | def join(self, p): | |
26 | return p |
|
26 | return p | |
27 |
|
27 | |||
|
28 | vfs = fakevfs() | |||
|
29 | ||||
|
30 | def unfiltered(self): | |||
|
31 | return self | |||
|
32 | ||||
28 | def sjoin(self, p): |
|
33 | def sjoin(self, p): | |
29 | return p |
|
34 | return p | |
30 |
|
35 | |||
31 | @filecache('x', 'y') |
|
36 | @localrepo.repofilecache('x', 'y') | |
32 | def cached(self): |
|
37 | def cached(self): | |
33 | print('creating') |
|
38 | print('creating') | |
34 | return 'string from function' |
|
39 | return 'string from function' |
General Comments 0
You need to be logged in to leave comments.
Login now