comparison hgext/largefiles/reposetup.py @ 23188:94ac64bcf6fe

largefiles: introduce "_lfstatuswriters" to customize status reporting "lfutil.getstatuswriter" is the utility to get appropriate function to write largefiles specific status out from "repo._lfstatuswriters". This patch uses "stack" with an element instead of flag like "_isXXXXing" or so, because: - the former works correctly even when customizations are nested, and - ensuring at least one element can ignore empty check
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 05 Nov 2014 23:24:47 +0900
parents 6de61d0b773f
children 4be754832829
comparison
equal deleted inserted replaced
23187:f726b05ecfe6 23188:94ac64bcf6fe
341 341
342 # stack of hooks being executed before committing. 342 # stack of hooks being executed before committing.
343 # only last element ("_lfcommithooks[-1]") is used for each committing. 343 # only last element ("_lfcommithooks[-1]") is used for each committing.
344 repo._lfcommithooks = [lfutil.updatestandinsbymatch] 344 repo._lfcommithooks = [lfutil.updatestandinsbymatch]
345 345
346 # Stack of status writer functions taking "*msg, **opts" arguments
347 # like "ui.status()". Only last element ("_lfupdatereporters[-1]")
348 # is used to write status out.
349 repo._lfstatuswriters = [ui.status]
350
346 def prepushoutgoinghook(local, remote, outgoing): 351 def prepushoutgoinghook(local, remote, outgoing):
347 if outgoing.missing: 352 if outgoing.missing:
348 toupload = set() 353 toupload = set()
349 addfunc = lambda fn, lfhash: toupload.add(lfhash) 354 addfunc = lambda fn, lfhash: toupload.add(lfhash)
350 lfutil.getlfilestoupload(local, outgoing.missing, addfunc) 355 lfutil.getlfilestoupload(local, outgoing.missing, addfunc)