diff mercurial/archival.py @ 12323:f00953d9533c

subrepo: add support for 'hg archive'
author Martin Geisler <mg@aragost.com>
date Mon, 20 Sep 2010 15:46:17 +0200
parents 11db6fa2961e
children 6c375e07d673 2956945c3bee
line wrap: on
line diff
--- 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()