# HG changeset patch # User Martin von Zweigbergk # Date 2017-09-05 22:24:22 # Node ID 997997eb8367a424f7889bbda0437e7e9736a355 # Parent 3d76a8e627a623b9a66f21a0d599fb2fa87143f5 archive: create alwaysmatcher when no matcher provided Differential Revision: https://phab.mercurial-scm.org/D5177 diff --git a/mercurial/archival.py b/mercurial/archival.py --- a/mercurial/archival.py +++ b/mercurial/archival.py @@ -313,15 +313,15 @@ def archive(repo, dest, node, kind, deco ctx = repo[node] archiver = archivers[kind](dest, mtime or ctx.date()[0]) + if not match: + match = scmutil.matchall(repo) + if repo.ui.configbool("ui", "archivemeta"): name = '.hg_archival.txt' - if not match or match(name): + if match(name): write(name, 0o644, False, lambda: buildmetadata(ctx)) - if match: - files = [f for f in ctx.manifest().keys() if match(f)] - else: - files = ctx.manifest().keys() + files = [f for f in ctx.manifest().keys() if match(f)] total = len(files) if total: files.sort()