comparison hgext/lfs/__init__.py @ 35880:6bd2846a82e8

lfs: drop an unused function parameter
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 30 Jan 2018 20:33:21 -0500
parents 4425790f2373
children 0b79f99fd7b0
comparison
equal deleted inserted replaced
35879:6c1d3779c052 35880:6bd2846a82e8
209 repo.svfs.lfsremoteblobstore = blobstore.remote(repo) 209 repo.svfs.lfsremoteblobstore = blobstore.remote(repo)
210 210
211 class lfsrepo(repo.__class__): 211 class lfsrepo(repo.__class__):
212 @localrepo.unfilteredmethod 212 @localrepo.unfilteredmethod
213 def commitctx(self, ctx, error=False): 213 def commitctx(self, ctx, error=False):
214 repo.svfs.options['lfstrack'] = _trackedmatcher(self, ctx) 214 repo.svfs.options['lfstrack'] = _trackedmatcher(self)
215 return super(lfsrepo, self).commitctx(ctx, error) 215 return super(lfsrepo, self).commitctx(ctx, error)
216 216
217 repo.__class__ = lfsrepo 217 repo.__class__ = lfsrepo
218 218
219 if 'lfs' not in repo.requirements: 219 if 'lfs' not in repo.requirements:
236 ui.setconfig('hooks', 'commit.lfs', checkrequireslfs, 'lfs') 236 ui.setconfig('hooks', 'commit.lfs', checkrequireslfs, 'lfs')
237 ui.setconfig('hooks', 'pretxnchangegroup.lfs', checkrequireslfs, 'lfs') 237 ui.setconfig('hooks', 'pretxnchangegroup.lfs', checkrequireslfs, 'lfs')
238 else: 238 else:
239 repo.prepushoutgoinghooks.add('lfs', wrapper.prepush) 239 repo.prepushoutgoinghooks.add('lfs', wrapper.prepush)
240 240
241 def _trackedmatcher(repo, ctx): 241 def _trackedmatcher(repo):
242 """Return a function (path, size) -> bool indicating whether or not to 242 """Return a function (path, size) -> bool indicating whether or not to
243 track a given file with lfs.""" 243 track a given file with lfs."""
244 if not repo.wvfs.exists('.hglfs'): 244 if not repo.wvfs.exists('.hglfs'):
245 # No '.hglfs' in wdir. Fallback to config for now. 245 # No '.hglfs' in wdir. Fallback to config for now.
246 trackspec = repo.ui.config('lfs', 'track') 246 trackspec = repo.ui.config('lfs', 'track')