sapling/hgext
FUJIWARA Katsunori d70128b84b 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.
2015-02-26 06:03:39 +09:00
..
convert convert: replace revision references in messages if they are >= short hashes 2015-01-30 18:51:20 +01:00
highlight highlight: ignore Unicode's extra linebreaks (issue4291) 2014-12-17 13:25:24 -06:00
largefiles largefiles: access to specific fields only if largefiles enabled (issue4547) 2015-02-26 06:03:39 +09:00
zeroconf zeroconf: use port from server instead of picking port from config (issue3746) 2012-12-30 19:19:52 +01:00
__init__.py Re-add hgext/__init__.py 2005-09-29 12:49:01 -07:00
acl.py check-code: check for spaces around = for named parameters 2013-10-03 14:50:47 +02:00
blackbox.py localrepo: remove all external users of localrepo.opener 2015-01-15 23:17:12 +01:00
bugzilla.py bugzilla: correct config documentation error 2014-07-03 10:56:03 +01:00
children.py children: define inferrepo in command decorator 2014-05-04 22:25:28 -07:00
churn.py doc: change 'revision or range' to 'revision or revset' 2014-10-24 13:50:00 -04:00
color.py color: add missing 'dim' in _effects 2015-01-18 22:24:14 -08:00
eol.py localrepo: remove all external users of localrepo.opener 2015-01-15 23:17:12 +01:00
extdiff.py extdiff: reintroduce backward compatibility with manual quoting of parameters 2015-01-28 02:28:39 +01:00
factotum.py factotum: convert Plan 9 quoted string to Python string 2014-11-25 02:31:52 -06:00
fetch.py fetch: use exchange.pull 2014-10-03 11:16:57 -05:00
gpg.py localrepo: remove all external users of localrepo.opener 2015-01-15 23:17:12 +01:00
graphlog.py doc: change 'revision or range' to 'revision or revset' 2014-10-24 13:50:00 -04:00
hgcia.py hgcia: access status fields by name rather than index 2014-10-03 09:51:39 -07:00
hgk.py hgk: don't honor whitespace and format-changing diffopts 2014-11-18 21:38:19 -08:00
histedit.py histedit: miscellaneous style cleanups 2014-10-16 14:55:45 -04:00
keyword.py localrepo: remove all external users of localrepo.wopener 2015-01-11 01:51:52 +01:00
mq.py localrepo: remove all external users of localrepo.wopener 2015-01-11 01:51:52 +01:00
notify.py notify: explicitly honor all diffopts 2014-11-18 21:47:47 -08:00
pager.py pager: add attend-<command> option 2014-05-09 13:32:56 -05:00
patchbomb.py localrepo: remove all external users of localrepo.opener 2015-01-15 23:17:12 +01:00
progress.py progress: add a lock to prepare for introducing a thread 2015-01-17 13:13:16 -08:00
purge.py purge: access status fields by name rather than index 2014-10-03 10:38:43 -07:00
rebase.py rebase: ensure rebase revision remains visible (issue4504) 2015-01-27 12:33:56 +00:00
record.py record: don't honor format-changing diffopts (issue4459) 2014-11-18 20:00:37 -08:00
relink.py relink: declare command using decorator 2014-05-04 21:52:25 -07:00
schemes.py scheme: don't crash on invalid URLs 2013-04-11 14:41:22 +02:00
share.py share: replace the bookmarks.shared file with an entry on a new "shared" file 2015-01-11 16:20:15 +01:00
shelve.py changegroup.writebundle: provide ui 2015-01-15 14:39:41 -08:00
strip.py strip: make checklocalchanges() return full status tuple 2014-10-04 20:53:05 -07:00
transplant.py transplant: properly skip empty changeset (issue4423) 2015-01-08 21:36:12 -08:00
win32mbcs.py win32mbcs: wrap util.split() 2013-07-04 23:05:59 +09:00
win32text.py extensions: mark win32text deprecated 2014-03-01 19:51:22 -06:00