comparison tests/test-issue3084.t @ 21917:ac3b3a2d976d

largefiles: avoid unnecessary creation of .hg/largefiles when opening lfdirstate Previously, the directory '.hg/largefiles' would always be created if it didn't exist when the lfdirstate was opened. If there were no standin files, no dirstate file would be created in the directory. The end result was that enabling the largefiles extension globally, but not explicitly adding a largefile would result in the repository eventually sprouting this directory. Creation of this directory effectively changes readonly operations like summary and status into operations that require write access. Without write access, commands that would succeed without the extension loaded would abort with a surprising error when the extension is loaded, but not actively used: $ hg sum -R /tmp/thg --config extensions.largefiles= parent: 16541:00dc703d5aed repowidget: specify incoming bundle by plain file path to avoid url parsing branch: default abort: Permission denied: '/tmp/thg/.hg/largefiles' This change is simpler than changing the callers of openlfdirstate() to use the 'create' parameter that was introduced in ae57920ac188, and probably how that should have been implemented in the first place.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 17 Jul 2014 20:17:17 -0400
parents e92c6524a76d
children a5168eb9b2bc
comparison
equal deleted inserted replaced
21916:792ebd7dc5f6 21917:ac3b3a2d976d
152 Prepare test repo: 152 Prepare test repo:
153 153
154 $ hg init merges 154 $ hg init merges
155 $ cd merges 155 $ cd merges
156 $ touch f1 156 $ touch f1
157 $ hg ci -Aqm "0-root" 157 $ hg ci -Aqm "0-root" --config extensions.largefiles=!
158
159 Ensure that .hg/largefiles isn't created before largefiles are added
160 #if unix-permissions
161 $ chmod 555 .hg
162 #endif
163 $ hg status
164 #if unix-permissions
165 $ chmod 755 .hg
166 #endif
167
168 $ find .hg/largefiles
169 find: `.hg/largefiles': No such file or directory
170 [1]
158 171
159 ancestor is "normal": 172 ancestor is "normal":
160 $ echo normal > f 173 $ echo normal > f
161 $ hg ci -Aqm "1-normal-ancestor" 174 $ hg ci -Aqm "1-normal-ancestor"
162 $ touch f2 175 $ touch f2