##// END OF EJS Templates
checkexec: create destination directory if necessary...
Boris Feld -
r40703:bd087497 stable
parent child Browse files
Show More
@@ -181,7 +181,22 b' def checkexec(path):'
181 181
182 182 try:
183 183 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
184 cachedir = os.path.join(path, '.hg', 'cache')
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 200 if os.path.isdir(cachedir):
186 201 checkisexec = os.path.join(cachedir, 'checkisexec')
187 202 checknoexec = os.path.join(cachedir, 'checknoexec')
@@ -88,6 +88,9 b' Non store repo:'
88 88 .hg/00manifest.i
89 89 .hg/cache
90 90 .hg/cache/branch2-served
91 .hg/cache/checkisexec
92 .hg/cache/checklink
93 .hg/cache/checklink-target
91 94 .hg/cache/manifestfulltextcache (reporevlogstore !)
92 95 .hg/cache/rbc-names-v1
93 96 .hg/cache/rbc-revs-v1
@@ -122,6 +125,9 b' Non fncache repo:'
122 125 .hg/00changelog.i
123 126 .hg/cache
124 127 .hg/cache/branch2-served
128 .hg/cache/checkisexec
129 .hg/cache/checklink
130 .hg/cache/checklink-target
125 131 .hg/cache/manifestfulltextcache (reporevlogstore !)
126 132 .hg/cache/rbc-names-v1
127 133 .hg/cache/rbc-revs-v1
@@ -69,6 +69,9 b' new directories are setgid'
69 69 00600 ./.hg/00changelog.i
70 70 00770 ./.hg/cache/
71 71 00660 ./.hg/cache/branch2-served
72 00711 ./.hg/cache/checkisexec
73 00777 ./.hg/cache/checklink
74 00600 ./.hg/cache/checklink-target
72 75 00660 ./.hg/cache/manifestfulltextcache (reporevlogstore !)
73 76 00660 ./.hg/cache/rbc-names-v1
74 77 00660 ./.hg/cache/rbc-revs-v1
@@ -22,16 +22,21 b" share shouldn't have a store dir"
22 22 $ test -d .hg/store
23 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 27 $ hg branches
28 28 default 0:d3873e73d99e
29 29 $ hg tags
30 30 tip 0:d3873e73d99e
31 $ test -d .hg/cache
32 [1]
31 $ ls -1 .hg/cache
32 checkisexec
33 checklink
34 checklink-target
33 35 $ ls -1 ../repo1/.hg/cache
34 36 branch2-served
37 checkisexec
38 checklink
39 checklink-target
35 40 manifestfulltextcache (reporevlogstore !)
36 41 rbc-names-v1
37 42 rbc-revs-v1
General Comments 0
You need to be logged in to leave comments. Login now