comparison tests/test-tags.t @ 24806:61aea11fb83d stable

tags: do not abort if failed to write lock file to save cache LockHeld wasn't enough to suppress error during acquiring lock. If .hg directory is read-only, LockUnavailable will be raised. $ chmod ugo-w .hg $ hg identify abort: could not lock working directory of ...: Permission denied
author Yuya Nishihara <yuya@tcha.org>
date Fri, 17 Apr 2015 23:22:58 +0900
parents 2ee10789d66b
children 0c2ded041d10
comparison
equal deleted inserted replaced
24805:82fe57213029 24806:61aea11fb83d
112 .hg/cache/hgtagsfnodes1: size=48 112 .hg/cache/hgtagsfnodes1: size=48
113 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| 113 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
114 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...| 114 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
115 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y| 115 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
116 116
117 And again, but now unable to write tag cache: 117 And again, but now unable to write tag cache or lock file:
118 118
119 #if unix-permissions 119 #if unix-permissions
120 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 120 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
121 $ chmod 555 .hg/cache 121 $ chmod 555 .hg/cache
122 $ hg identify 122 $ hg identify
123 b9154636be93 tip 123 b9154636be93 tip
124 $ chmod 755 .hg/cache 124 $ chmod 755 .hg/cache
125
126 $ chmod 555 .hg
127 $ hg identify
128 b9154636be93 tip
129 $ chmod 755 .hg
125 #endif 130 #endif
126 131
127 Tag cache debug info written to blackbox log 132 Tag cache debug info written to blackbox log
128 133
129 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1 134 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
142 $ echo 'foo:1' > .hg/wlock 147 $ echo 'foo:1' > .hg/wlock
143 $ hg identify 148 $ hg identify
144 b9154636be93 tip 149 b9154636be93 tip
145 $ hg blackbox -l 5 150 $ hg blackbox -l 5
146 1970/01/01 00:00:00 bob> identify 151 1970/01/01 00:00:00 bob> identify
147 1970/01/01 00:00:00 bob> not writing .hg/cache/hgtagsfnodes1 because lock held 152 1970/01/01 00:00:00 bob> not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired
148 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob) 153 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob)
149 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 154 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags
150 1970/01/01 00:00:00 bob> identify exited 0 after * seconds (glob) 155 1970/01/01 00:00:00 bob> identify exited 0 after * seconds (glob)
151 156
152 $ fnodescacheexists 157 $ fnodescacheexists