mercurial/archival.py
changeset 6749 51b0e799352f
parent 6747 f6c00b17387c
child 6913 580d5e6bfc1f
equal deleted inserted replaced
6748:c6cc35a3d1de 6749:51b0e799352f
   206         data = getdata()
   206         data = getdata()
   207         if decode:
   207         if decode:
   208             data = repo.wwritedata(name, data)
   208             data = repo.wwritedata(name, data)
   209         archiver.addfile(name, mode, islink, data)
   209         archiver.addfile(name, mode, islink, data)
   210 
   210 
   211     ctx = repo[node]
       
   212     if kind not in archivers:
   211     if kind not in archivers:
   213         raise util.Abort(_("unknown archive type '%s'" % kind))
   212         raise util.Abort(_("unknown archive type '%s'" % kind))
       
   213 
       
   214     ctx = repo[node]
   214     archiver = archivers[kind](dest, prefix, mtime or ctx.date()[0])
   215     archiver = archivers[kind](dest, prefix, mtime or ctx.date()[0])
   215     m = ctx.manifest()
   216 
   216     items = m.items()
       
   217     items.sort()
       
   218     if repo.ui.configbool("ui", "archivemeta", True):
   217     if repo.ui.configbool("ui", "archivemeta", True):
   219         write('.hg_archival.txt', 0644, False,
   218         write('.hg_archival.txt', 0644, False,
   220               lambda: 'repo: %s\nnode: %s\n' % (
   219               lambda: 'repo: %s\nnode: %s\n' % (
   221                   hex(repo.changelog.node(0)), hex(node)))
   220                   hex(repo.changelog.node(0)), hex(node)))
   222     for filename, filenode in items:
   221     for f in ctx:
   223         write(filename, m.execf(filename) and 0755 or 0644, m.linkf(filename),
   222         ff = ctx.flags(f)
   224               lambda: repo.file(filename).read(filenode))
   223         write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data)
   225     archiver.done()
   224     archiver.done()