Show More
@@ -7,16 +7,18 b' regression."""' | |||||
7 | from __future__ import absolute_import, print_function |
|
7 | from __future__ import absolute_import, print_function | |
8 | import os |
|
8 | import os | |
9 | import subprocess |
|
9 | import subprocess | |
10 | import mercurial.localrepo |
|
|||
11 | import mercurial.util |
|
|||
12 | import mercurial.hg |
|
|||
13 | import mercurial.ui as uimod |
|
|||
14 |
|
10 | |||
|
11 | from mercurial import ( | |||
|
12 | hg, | |||
|
13 | localrepo, | |||
|
14 | ui as uimod, | |||
|
15 | util, | |||
|
16 | ) | |||
15 |
|
17 | |||
16 | # create some special property cache that trace they call |
|
18 | # create some special property cache that trace they call | |
17 |
|
19 | |||
18 | calllog = [] |
|
20 | calllog = [] | |
19 |
@ |
|
21 | @util.propertycache | |
20 | def testcachedfoobar(repo): |
|
22 | def testcachedfoobar(repo): | |
21 | name = repo.filtername |
|
23 | name = repo.filtername | |
22 | if name is None: |
|
24 | if name is None: | |
@@ -26,7 +28,7 b' def testcachedfoobar(repo):' | |||||
26 | return val |
|
28 | return val | |
27 |
|
29 | |||
28 | unficalllog = [] |
|
30 | unficalllog = [] | |
29 |
@ |
|
31 | @localrepo.unfilteredpropertycache | |
30 | def testcachedunfifoobar(repo): |
|
32 | def testcachedunfifoobar(repo): | |
31 | name = repo.filtername |
|
33 | name = repo.filtername | |
32 | if name is None: |
|
34 | if name is None: | |
@@ -36,8 +38,8 b' def testcachedunfifoobar(repo):' | |||||
36 | return val |
|
38 | return val | |
37 |
|
39 | |||
38 | #plug them on repo |
|
40 | #plug them on repo | |
39 |
|
|
41 | localrepo.localrepository.testcachedfoobar = testcachedfoobar | |
40 |
|
|
42 | localrepo.localrepository.testcachedunfifoobar = testcachedunfifoobar | |
41 |
|
43 | |||
42 |
|
44 | |||
43 | # Create an empty repo and instantiate it. It is important to run |
|
45 | # Create an empty repo and instantiate it. It is important to run | |
@@ -45,7 +47,7 b' mercurial.localrepo.localrepository.test' | |||||
45 | repopath = os.path.join(os.environ['TESTTMP'], 'repo') |
|
47 | repopath = os.path.join(os.environ['TESTTMP'], 'repo') | |
46 | assert subprocess.call(['hg', 'init', repopath]) == 0 |
|
48 | assert subprocess.call(['hg', 'init', repopath]) == 0 | |
47 | ui = uimod.ui() |
|
49 | ui = uimod.ui() | |
48 |
repo = |
|
50 | repo = hg.repository(ui, path=repopath).unfiltered() | |
49 |
|
51 | |||
50 |
|
52 | |||
51 | print('') |
|
53 | print('') |
General Comments 0
You need to be logged in to leave comments.
Login now