diff -r 510afb31cf99 -r f00953d9533c mercurial/archival.py --- a/mercurial/archival.py Mon Sep 20 15:44:30 2010 +0200 +++ b/mercurial/archival.py Mon Sep 20 15:46:17 2010 +0200 @@ -205,7 +205,7 @@ } def archive(repo, dest, node, kind, decode=True, matchfn=None, - prefix=None, mtime=None): + prefix=None, mtime=None, subrepos=False): '''create archive of repo as it was at node. dest can be name of directory, name of archive file, or file @@ -263,4 +263,10 @@ for f in ctx: ff = ctx.flags(f) write(f, 'x' in ff and 0755 or 0644, 'l' in ff, ctx[f].data) + + if subrepos: + for subpath in ctx.substate: + sub = ctx.sub(subpath) + sub.archive(archiver, prefix) + archiver.done()