Mercurial > hg
comparison mercurial/archival.py @ 40408:997997eb8367
archive: create alwaysmatcher when no matcher provided
Differential Revision: https://phab.mercurial-scm.org/D5177
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 05 Sep 2017 15:24:22 -0700 |
parents | 3d76a8e627a6 |
children | 5eefd32cb382 |
comparison
equal
deleted
inserted
replaced
40407:3d76a8e627a6 | 40408:997997eb8367 |
---|---|
311 raise error.Abort(_("unknown archive type '%s'") % kind) | 311 raise error.Abort(_("unknown archive type '%s'") % kind) |
312 | 312 |
313 ctx = repo[node] | 313 ctx = repo[node] |
314 archiver = archivers[kind](dest, mtime or ctx.date()[0]) | 314 archiver = archivers[kind](dest, mtime or ctx.date()[0]) |
315 | 315 |
316 if not match: | |
317 match = scmutil.matchall(repo) | |
318 | |
316 if repo.ui.configbool("ui", "archivemeta"): | 319 if repo.ui.configbool("ui", "archivemeta"): |
317 name = '.hg_archival.txt' | 320 name = '.hg_archival.txt' |
318 if not match or match(name): | 321 if match(name): |
319 write(name, 0o644, False, lambda: buildmetadata(ctx)) | 322 write(name, 0o644, False, lambda: buildmetadata(ctx)) |
320 | 323 |
321 if match: | 324 files = [f for f in ctx.manifest().keys() if match(f)] |
322 files = [f for f in ctx.manifest().keys() if match(f)] | |
323 else: | |
324 files = ctx.manifest().keys() | |
325 total = len(files) | 325 total = len(files) |
326 if total: | 326 if total: |
327 files.sort() | 327 files.sort() |
328 scmutil.prefetchfiles(repo, [ctx.rev()], | 328 scmutil.prefetchfiles(repo, [ctx.rev()], |
329 scmutil.matchfiles(repo, files)) | 329 scmutil.matchfiles(repo, files)) |