mercurial/archival.py
changeset 12323 f00953d9533c
parent 12321 11db6fa2961e
child 13047 6c375e07d673
child 13102 2956945c3bee
--- 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()