Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
( )
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/archival.py (11 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Jun 18 2018, 2:00 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
files = [f for f in ctx.manifest().keys() if matchfn(f)] | files = [f for f in ctx.manifest().keys() if matchfn(f)] | ||||
else: | else: | ||||
files = ctx.manifest().keys() | files = ctx.manifest().keys() | ||||
total = len(files) | total = len(files) | ||||
if total: | if total: | ||||
files.sort() | files.sort() | ||||
scmutil.prefetchfiles(repo, [ctx.rev()], | scmutil.prefetchfiles(repo, [ctx.rev()], | ||||
scmutil.matchfiles(repo, files)) | scmutil.matchfiles(repo, files)) | ||||
repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total) | progress = scmutil.progress(repo.ui, _('archiving'), unit=_('files'), | ||||
for i, f in enumerate(files): | total=total) | ||||
progress.update(0) | |||||
for f in files: | |||||
ff = ctx.flags(f) | ff = ctx.flags(f) | ||||
write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, ctx[f].data) | write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, ctx[f].data) | ||||
repo.ui.progress(_('archiving'), i + 1, item=f, | progress.increment(item=f) | ||||
unit=_('files'), total=total) | progress.complete() | ||||
repo.ui.progress(_('archiving'), None) | |||||
if subrepos: | if subrepos: | ||||
for subpath in sorted(ctx.substate): | for subpath in sorted(ctx.substate): | ||||
sub = ctx.workingsub(subpath) | sub = ctx.workingsub(subpath) | ||||
submatch = matchmod.subdirmatcher(subpath, matchfn) | submatch = matchmod.subdirmatcher(subpath, matchfn) | ||||
total += sub.archive(archiver, prefix, submatch, decode) | total += sub.archive(archiver, prefix, submatch, decode) | ||||
if total == 0: | if total == 0: | ||||
raise error.Abort(_('no files match the archive pattern')) | raise error.Abort(_('no files match the archive pattern')) | ||||
archiver.done() | archiver.done() | ||||
return total | return total |