mercurial/archival.py
changeset 52603 a19f102dd377
parent 52602 f9af68aa6719
child 52645 4cb75772818d
equal deleted inserted replaced
52602:f9af68aa6719 52603:a19f102dd377
   310     mtime is the modified time, in seconds, or None to use the changeset time.
   310     mtime is the modified time, in seconds, or None to use the changeset time.
   311 
   311 
   312     subrepos tells whether to include subrepos.
   312     subrepos tells whether to include subrepos.
   313     """
   313     """
   314 
   314 
       
   315     if kind not in archivers:
       
   316         raise error.Abort(_(b"unknown archive type '%s'") % kind)
       
   317 
   315     if kind == b'files':
   318     if kind == b'files':
   316         if prefix:
   319         if prefix:
   317             raise error.Abort(_(b'cannot give prefix when archiving to files'))
   320             raise error.Abort(_(b'cannot give prefix when archiving to files'))
   318     else:
   321     else:
   319         prefix = tidyprefix(dest, kind, prefix)
   322         prefix = tidyprefix(dest, kind, prefix)
   351 
   354 
   352         data = getdata()
   355         data = getdata()
   353         if decode:
   356         if decode:
   354             data = repo.wwritedata(name, data)
   357             data = repo.wwritedata(name, data)
   355         archiver.addfile(prefix + name, mode, islink, data)
   358         archiver.addfile(prefix + name, mode, islink, data)
   356 
       
   357     if kind not in archivers:
       
   358         raise error.Abort(_(b"unknown archive type '%s'") % kind)
       
   359 
   359 
   360     if not match:
   360     if not match:
   361         match = scmutil.matchall(repo)
   361         match = scmutil.matchall(repo)
   362 
   362 
   363     files = list(ctx.manifest().walk(match))
   363     files = list(ctx.manifest().walk(match))