comparison hgext/lfs/__init__.py @ 41279:c9e1104e6272

exthelper: drop the addattr() decorator Yuya pointed out that this goes against the typical advice to not add attributes to classes[1]. The evolve extension still uses this a handful of times, so maybe it should be brought back in the future if a general use is found. But it isn't nice to have a new helper API that can lead to easy problems. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-December/126330.html
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 17 Jan 2019 00:16:00 -0500
parents d2d716cc0700
children d98ec36be808
comparison
equal deleted inserted replaced
41278:41f14e8f335f 41279:c9e1104e6272
128 128
129 from mercurial.i18n import _ 129 from mercurial.i18n import _
130 130
131 from mercurial import ( 131 from mercurial import (
132 config, 132 config,
133 context,
133 error, 134 error,
134 exchange, 135 exchange,
135 extensions, 136 extensions,
136 exthelper, 137 exthelper,
137 filelog, 138 filelog,
327 328
328 @eh.extsetup 329 @eh.extsetup
329 def _extsetup(ui): 330 def _extsetup(ui):
330 wrapfilelog(filelog.filelog) 331 wrapfilelog(filelog.filelog)
331 332
333 context.basefilectx.islfs = wrapper.filectxislfs
334
332 scmutil.fileprefetchhooks.add('lfs', wrapper._prefetchfiles) 335 scmutil.fileprefetchhooks.add('lfs', wrapper._prefetchfiles)
333 336
334 # Make bundle choose changegroup3 instead of changegroup2. This affects 337 # Make bundle choose changegroup3 instead of changegroup2. This affects
335 # "hg bundle" command. Note: it does not cover all bundle formats like 338 # "hg bundle" command. Note: it does not cover all bundle formats like
336 # "packed1". Using "packed1" with lfs will likely cause trouble. 339 # "packed1". Using "packed1" with lfs will likely cause trouble.