Show More
@@ -181,7 +181,22 b' def checkexec(path):' | |||||
181 |
|
181 | |||
182 | try: |
|
182 | try: | |
183 | EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH |
|
183 | EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH | |
184 |
|
|
184 | basedir = os.path.join(path, '.hg') | |
|
185 | cachedir = os.path.join(basedir, 'cache') | |||
|
186 | storedir = os.path.join(basedir, 'store') | |||
|
187 | if not os.path.exists(cachedir): | |||
|
188 | try: | |||
|
189 | # we want to create the 'cache' directory, not the '.hg' one. | |||
|
190 | # Automatically creating '.hg' directory could silently spawn | |||
|
191 | # invalid Mercurial repositories. That seems like a bad idea. | |||
|
192 | os.mkdir(cachedir) | |||
|
193 | if os.path.exists(storedir): | |||
|
194 | copymode(storedir, cachedir) | |||
|
195 | else: | |||
|
196 | copymode(basedir, cachedir) | |||
|
197 | except (IOError, OSError): | |||
|
198 | # we other fallback logic triggers | |||
|
199 | pass | |||
185 | if os.path.isdir(cachedir): |
|
200 | if os.path.isdir(cachedir): | |
186 | checkisexec = os.path.join(cachedir, 'checkisexec') |
|
201 | checkisexec = os.path.join(cachedir, 'checkisexec') | |
187 | checknoexec = os.path.join(cachedir, 'checknoexec') |
|
202 | checknoexec = os.path.join(cachedir, 'checknoexec') |
@@ -88,6 +88,9 b' Non store repo:' | |||||
88 | .hg/00manifest.i |
|
88 | .hg/00manifest.i | |
89 | .hg/cache |
|
89 | .hg/cache | |
90 | .hg/cache/branch2-served |
|
90 | .hg/cache/branch2-served | |
|
91 | .hg/cache/checkisexec | |||
|
92 | .hg/cache/checklink | |||
|
93 | .hg/cache/checklink-target | |||
91 | .hg/cache/manifestfulltextcache (reporevlogstore !) |
|
94 | .hg/cache/manifestfulltextcache (reporevlogstore !) | |
92 | .hg/cache/rbc-names-v1 |
|
95 | .hg/cache/rbc-names-v1 | |
93 | .hg/cache/rbc-revs-v1 |
|
96 | .hg/cache/rbc-revs-v1 | |
@@ -122,6 +125,9 b' Non fncache repo:' | |||||
122 | .hg/00changelog.i |
|
125 | .hg/00changelog.i | |
123 | .hg/cache |
|
126 | .hg/cache | |
124 | .hg/cache/branch2-served |
|
127 | .hg/cache/branch2-served | |
|
128 | .hg/cache/checkisexec | |||
|
129 | .hg/cache/checklink | |||
|
130 | .hg/cache/checklink-target | |||
125 | .hg/cache/manifestfulltextcache (reporevlogstore !) |
|
131 | .hg/cache/manifestfulltextcache (reporevlogstore !) | |
126 | .hg/cache/rbc-names-v1 |
|
132 | .hg/cache/rbc-names-v1 | |
127 | .hg/cache/rbc-revs-v1 |
|
133 | .hg/cache/rbc-revs-v1 |
@@ -69,6 +69,9 b' new directories are setgid' | |||||
69 | 00600 ./.hg/00changelog.i |
|
69 | 00600 ./.hg/00changelog.i | |
70 | 00770 ./.hg/cache/ |
|
70 | 00770 ./.hg/cache/ | |
71 | 00660 ./.hg/cache/branch2-served |
|
71 | 00660 ./.hg/cache/branch2-served | |
|
72 | 00711 ./.hg/cache/checkisexec | |||
|
73 | 00777 ./.hg/cache/checklink | |||
|
74 | 00600 ./.hg/cache/checklink-target | |||
72 | 00660 ./.hg/cache/manifestfulltextcache (reporevlogstore !) |
|
75 | 00660 ./.hg/cache/manifestfulltextcache (reporevlogstore !) | |
73 | 00660 ./.hg/cache/rbc-names-v1 |
|
76 | 00660 ./.hg/cache/rbc-names-v1 | |
74 | 00660 ./.hg/cache/rbc-revs-v1 |
|
77 | 00660 ./.hg/cache/rbc-revs-v1 |
@@ -22,16 +22,21 b" share shouldn't have a store dir" | |||||
22 | $ test -d .hg/store |
|
22 | $ test -d .hg/store | |
23 | [1] |
|
23 | [1] | |
24 |
|
24 | |||
25 | share shouldn't have a cache dir, original repo should |
|
25 | share shouldn't have a full cache dir, original repo should | |
26 |
|
26 | |||
27 | $ hg branches |
|
27 | $ hg branches | |
28 | default 0:d3873e73d99e |
|
28 | default 0:d3873e73d99e | |
29 | $ hg tags |
|
29 | $ hg tags | |
30 | tip 0:d3873e73d99e |
|
30 | tip 0:d3873e73d99e | |
31 |
$ |
|
31 | $ ls -1 .hg/cache | |
32 | [1] |
|
32 | checkisexec | |
|
33 | checklink | |||
|
34 | checklink-target | |||
33 |
$ |
|
35 | $ ls -1 ../repo1/.hg/cache | |
34 | branch2-served |
|
36 | branch2-served | |
|
37 | checkisexec | |||
|
38 | checklink | |||
|
39 | checklink-target | |||
35 | manifestfulltextcache (reporevlogstore !) |
|
40 | manifestfulltextcache (reporevlogstore !) | |
36 | rbc-names-v1 |
|
41 | rbc-names-v1 | |
37 | rbc-revs-v1 |
|
42 | rbc-revs-v1 |
General Comments 0
You need to be logged in to leave comments.
Login now