Show More
@@ -231,10 +231,18 def checklink(path): | |||||
231 | cachedir = None |
|
231 | cachedir = None | |
232 | name = tempfile.mktemp(dir=checkdir, prefix='checklink-') |
|
232 | name = tempfile.mktemp(dir=checkdir, prefix='checklink-') | |
233 | try: |
|
233 | try: | |
|
234 | fd = None | |||
|
235 | if cachedir is None: | |||
234 | fd = tempfile.NamedTemporaryFile(dir=checkdir, |
|
236 | fd = tempfile.NamedTemporaryFile(dir=checkdir, | |
235 | prefix='hg-checklink-') |
|
237 | prefix='hg-checklink-') | |
|
238 | target = os.path.basename(fd.name) | |||
|
239 | else: | |||
|
240 | # create a fixed file to link to; doesn't matter if it | |||
|
241 | # already exists. | |||
|
242 | target = 'checklink-target' | |||
|
243 | open(os.path.join(cachedir, target), 'w').close() | |||
236 | try: |
|
244 | try: | |
237 |
os.symlink( |
|
245 | os.symlink(target, name) | |
238 | if cachedir is None: |
|
246 | if cachedir is None: | |
239 | os.unlink(name) |
|
247 | os.unlink(name) | |
240 | else: |
|
248 | else: | |
@@ -249,6 +257,7 def checklink(path): | |||||
249 | continue |
|
257 | continue | |
250 | raise |
|
258 | raise | |
251 | finally: |
|
259 | finally: | |
|
260 | if fd is not None: | |||
252 | fd.close() |
|
261 | fd.close() | |
253 | except AttributeError: |
|
262 | except AttributeError: | |
254 | return False |
|
263 | return False |
@@ -33,6 +33,7 Trigger branchcache creation: | |||||
33 | branch2-served |
|
33 | branch2-served | |
34 | checkisexec |
|
34 | checkisexec | |
35 | checklink |
|
35 | checklink | |
|
36 | checklink-target | |||
36 | checknoexec |
|
37 | checknoexec | |
37 | rbc-names-v1 |
|
38 | rbc-names-v1 | |
38 | rbc-revs-v1 |
|
39 | rbc-revs-v1 | |
@@ -50,6 +51,7 Ensure branchcache got copied over: | |||||
50 | branch2-served |
|
51 | branch2-served | |
51 | checkisexec |
|
52 | checkisexec | |
52 | checklink |
|
53 | checklink | |
|
54 | checklink-target | |||
53 |
|
55 | |||
54 | $ cat a |
|
56 | $ cat a | |
55 | a |
|
57 | a |
@@ -212,6 +212,8 r4 has hardlinks in the working dir (not | |||||
212 | 2 r4/.hg/branch |
|
212 | 2 r4/.hg/branch | |
213 | 2 r4/.hg/cache/branch2-served |
|
213 | 2 r4/.hg/cache/branch2-served | |
214 | 2 r4/.hg/cache/checkisexec |
|
214 | 2 r4/.hg/cache/checkisexec | |
|
215 | 3 r4/.hg/cache/checklink (?) | |||
|
216 | ? r4/.hg/cache/checklink-target (glob) | |||
215 | 2 r4/.hg/cache/checknoexec |
|
217 | 2 r4/.hg/cache/checknoexec | |
216 | 2 r4/.hg/cache/rbc-names-v1 |
|
218 | 2 r4/.hg/cache/rbc-names-v1 | |
217 | 2 r4/.hg/cache/rbc-revs-v1 |
|
219 | 2 r4/.hg/cache/rbc-revs-v1 | |
@@ -250,6 +252,7 Update back to revision 11 in r4 should | |||||
250 | 1 r4/.hg/branch |
|
252 | 1 r4/.hg/branch | |
251 | 2 r4/.hg/cache/branch2-served |
|
253 | 2 r4/.hg/cache/branch2-served | |
252 | 2 r4/.hg/cache/checkisexec |
|
254 | 2 r4/.hg/cache/checkisexec | |
|
255 | 2 r4/.hg/cache/checklink-target | |||
253 | 2 r4/.hg/cache/checknoexec |
|
256 | 2 r4/.hg/cache/checknoexec | |
254 | 2 r4/.hg/cache/rbc-names-v1 |
|
257 | 2 r4/.hg/cache/rbc-names-v1 | |
255 | 2 r4/.hg/cache/rbc-revs-v1 |
|
258 | 2 r4/.hg/cache/rbc-revs-v1 |
@@ -674,6 +674,7 Missing tags2* files means the cache was | |||||
674 | branch2-served |
|
674 | branch2-served | |
675 | checkisexec |
|
675 | checkisexec | |
676 | checklink |
|
676 | checklink | |
|
677 | checklink-target | |||
677 | hgtagsfnodes1 |
|
678 | hgtagsfnodes1 | |
678 | rbc-names-v1 |
|
679 | rbc-names-v1 | |
679 | rbc-revs-v1 |
|
680 | rbc-revs-v1 | |
@@ -700,6 +701,7 Running hg tags should produce tags2* fi | |||||
700 | branch2-served |
|
701 | branch2-served | |
701 | checkisexec |
|
702 | checkisexec | |
702 | checklink |
|
703 | checklink | |
|
704 | checklink-target | |||
703 | hgtagsfnodes1 |
|
705 | hgtagsfnodes1 | |
704 | rbc-names-v1 |
|
706 | rbc-names-v1 | |
705 | rbc-revs-v1 |
|
707 | rbc-revs-v1 |
General Comments 0
You need to be logged in to leave comments.
Login now