Mercurial > hg
comparison mercurial/archival.py @ 13143:c2e55c21db27
archive: add support for progress extension
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 29 Nov 2010 16:17:05 +0100 |
parents | 5dac0d04b838 |
children | aae2d5cbde64 |
comparison
equal
deleted
inserted
replaced
13142:e9827c85c50b | 13143:c2e55c21db27 |
---|---|
260 | 260 |
261 return base + tags | 261 return base + tags |
262 | 262 |
263 write('.hg_archival.txt', 0644, False, metadata) | 263 write('.hg_archival.txt', 0644, False, metadata) |
264 | 264 |
265 for f in ctx: | 265 total = len(ctx.manifest()) |
266 repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total) | |
267 for i, f in enumerate(ctx): | |
266 ff = ctx.flags(f) | 268 ff = ctx.flags(f) |
267 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data) | 269 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data) |
270 repo.ui.progress(_('archiving'), i + 1, item=f, | |
271 unit=_('files'), total=total) | |
272 repo.ui.progress(_('archiving'), None) | |
268 | 273 |
269 if subrepos: | 274 if subrepos: |
270 for subpath in ctx.substate: | 275 for subpath in ctx.substate: |
271 sub = ctx.sub(subpath) | 276 sub = ctx.sub(subpath) |
272 sub.archive(archiver, prefix) | 277 sub.archive(archiver, prefix) |