diff -r f9af68aa6719 -r a19f102dd377 mercurial/archival.py --- a/mercurial/archival.py Wed Dec 04 22:25:33 2024 -0500 +++ b/mercurial/archival.py Tue Dec 31 22:36:56 2024 -0500 @@ -312,6 +312,9 @@ subrepos tells whether to include subrepos. """ + if kind not in archivers: + raise error.Abort(_(b"unknown archive type '%s'") % kind) + if kind == b'files': if prefix: raise error.Abort(_(b'cannot give prefix when archiving to files')) @@ -354,9 +357,6 @@ data = repo.wwritedata(name, data) archiver.addfile(prefix + name, mode, islink, data) - if kind not in archivers: - raise error.Abort(_(b"unknown archive type '%s'") % kind) - if not match: match = scmutil.matchall(repo)