##// END OF EJS Templates
tags: don't crash if unable to write tag cache...
Greg Ward -
r9366:9ff178e7 default
parent child Browse files
Show More
@@ -301,7 +301,10 b' def _readtagcache(ui, repo):'
301
301
302 def _writetagcache(ui, repo, heads, tagfnode, cachetags):
302 def _writetagcache(ui, repo, heads, tagfnode, cachetags):
303
303
304 try:
304 cachefile = repo.opener('tags.cache', 'w', atomictemp=True)
305 cachefile = repo.opener('tags.cache', 'w', atomictemp=True)
306 except (OSError, IOError):
307 return
305 _debug(ui, 'writing cache file %s\n' % cachefile.name)
308 _debug(ui, 'writing cache file %s\n' % cachefile.name)
306
309
307 realheads = repo.heads() # for sanity checks below
310 realheads = repo.heads() # for sanity checks below
@@ -37,9 +37,17 b' hg tags'
37 hg identify
37 hg identify
38
38
39 # repeat with cold tag cache
39 # repeat with cold tag cache
40 echo "% identify with cold cache"
40 rm -f .hg/tags.cache
41 rm -f .hg/tags.cache
41 hg identify
42 hg identify
42
43
44 # and again, but now unable to write tag cache
45 echo "% identify with unwritable cache"
46 rm -f .hg/tags.cache
47 chmod 555 .hg
48 hg identify
49 chmod 755 .hg
50
43 echo "% create a branch"
51 echo "% create a branch"
44 echo bb > a
52 echo bb > a
45 hg status
53 hg status
@@ -13,6 +13,9 b' acb14030fe0a21b60322c440ad2d20cf7685a376'
13 tip 1:b9154636be93
13 tip 1:b9154636be93
14 first 0:acb14030fe0a
14 first 0:acb14030fe0a
15 b9154636be93 tip
15 b9154636be93 tip
16 % identify with cold cache
17 b9154636be93 tip
18 % identify with unwritable cache
16 b9154636be93 tip
19 b9154636be93 tip
17 % create a branch
20 % create a branch
18 M a
21 M a
General Comments 0
You need to be logged in to leave comments. Login now