comparison mercurial/archival.py @ 36139:b72c6ff4e4c0

archive: migrate to the fileprefetch callback mechanism
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 11 Feb 2018 00:49:43 -0500
parents 788b2e8530ae
children 745b0df08514
comparison
equal deleted inserted replaced
36138:a991fcc48222 36139:b72c6ff4e4c0
16 import zlib 16 import zlib
17 17
18 from .i18n import _ 18 from .i18n import _
19 19
20 from . import ( 20 from . import (
21 cmdutil,
22 error, 21 error,
23 formatter, 22 formatter,
24 match as matchmod, 23 match as matchmod,
24 scmutil,
25 util, 25 util,
26 vfs as vfsmod, 26 vfs as vfsmod,
27 ) 27 )
28 stringio = util.stringio 28 stringio = util.stringio
29 29
336 else: 336 else:
337 files = ctx.manifest().keys() 337 files = ctx.manifest().keys()
338 total = len(files) 338 total = len(files)
339 if total: 339 if total:
340 files.sort() 340 files.sort()
341 cmdutil._prefetchfiles(repo, ctx, files) 341 scmutil.fileprefetchhooks(repo, ctx, files)
342 repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total) 342 repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total)
343 for i, f in enumerate(files): 343 for i, f in enumerate(files):
344 ff = ctx.flags(f) 344 ff = ctx.flags(f)
345 write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, ctx[f].data) 345 write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, ctx[f].data)
346 repo.ui.progress(_('archiving'), i + 1, item=f, 346 repo.ui.progress(_('archiving'), i + 1, item=f,