##// END OF EJS Templates
largefiles: access to specific fields only if largefiles enabled (issue4547)...
largefiles: access to specific fields only if largefiles enabled (issue4547) Even if largefiles extension is enabled in a repository, "repo" object, which isn't "largefiles.reposetup()"-ed, is passed to overridden functions in the cases below unexpectedly, because extensions are enabled for each repositories strictly. (1) clone without -U: (2) pull with -U: (3) pull with --rebase: combination of "enabled@src", "disabled@dst" and "not-required@src" cause this situation. largefiles requirement @src @dst @src result -------- -------- --------------- -------------------- enabled disabled not-required aborted unexpectedly required requirement error (intentional) -------- -------- --------------- -------------------- enabled enabled * success -------- -------- --------------- -------------------- disabled enabled * success (only for "pull") -------- -------- --------------- -------------------- disabled disabled not-required success required requirement error (intentional) -------- -------- --------------- -------------------- (4) update/revert with a subrepo disabling largefiles In these cases, overridden functions cause accessing to largefiles specific fields of not "largefiles.reposetup()"-ed "repo" object, and execution is aborted. - (1), (2), (4) cause accessing to "_lfstatuswriters" in "getstatuswriter()" invoked via "updatelfiles()" - (3) causes accessing to "_lfcommithooks" in "overriderebase()" For safe accessing to these fields, this patch examines whether passed "repo" object is "largefiles.reposetup()"-ed or not before accessing to them. This patch chooses examining existence of newly introduced "_largefilesenabled" instead of "_lfcommithooks" and "_lfstatuswriters" directly, because the former is better name for the generic "largefiles is enabled in this repo" mark than the latter. In the future, all other overridden functions should avoid largefiles specific processing for efficiency, and "_largefilesenabled" is better also for such purpose. BTW, "lfstatus" can't be used for such purpose, because some code paths set it forcibly regardless of existence of it in specified "repo" object.
FUJIWARA Katsunori -
r24158:d414c28d stable
Show More
Name Size Modified Last Commit Author
/ contrib
docker
hgfixes
hgsh
macosx
plan9
vagrant
vim
win32
wix
Makefile.python Loading ...
bash_completion Loading ...
buildrpm Loading ...
casesmash.py Loading ...
check-code.py Loading ...
check-commit Loading ...
debugcmdserver.py Loading ...
debugshell.py Loading ...
dockerrpm Loading ...
dumprevlog Loading ...
editmerge Loading ...
fixpax.py Loading ...
hg-ssh Loading ...
hg-test-mode.el Loading ...
hgclient.py Loading ...
hgk Loading ...
hgperf Loading ...
hgweb.fcgi Loading ...
hgweb.wsgi Loading ...
import-checker.py Loading ...
lock-checker.py Loading ...
logo-droplets.svg Loading ...
memory.py Loading ...
mercurial.el Loading ...
mercurial.spec Loading ...
mq.el Loading ...
perf.py Loading ...
pylintrc Loading ...
python-hook-examples.py Loading ...
revsetbenchmarks.py Loading ...
revsetbenchmarks.txt Loading ...
simplemerge Loading ...
synthrepo.py Loading ...
tcsh_completion Loading ...
tcsh_completion_build.sh Loading ...
undumprevlog Loading ...
xml.rnc Loading ...
zsh_completion Loading ...