about summary refs log tree commit diff
path: root/pkgs/build-support/fetchhg/nix-prefetch-hg
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/fetchhg/nix-prefetch-hg')
-rwxr-xr-xpkgs/build-support/fetchhg/nix-prefetch-hg8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchhg/nix-prefetch-hg b/pkgs/build-support/fetchhg/nix-prefetch-hg
index a8916176f8af..a877b217125f 100755
--- a/pkgs/build-support/fetchhg/nix-prefetch-hg
+++ b/pkgs/build-support/fetchhg/nix-prefetch-hg
@@ -17,6 +17,12 @@ if test -z "$url"; then
     exit 1
 fi
 
+if test "$fetchSubrepos" == 1; then
+    subrepoClause=S
+else
+    subrepoClause=
+fi
+
 test -n "$rev" || rev="tip"
 
 
@@ -47,7 +53,7 @@ if test -z "$finalPath"; then
     else
       tmpClone=$url
     fi
-    hg archive -q -y -r "$rev" --cwd $tmpClone $tmpArchive
+    hg archive -q$subrepoClause -y -r "$rev" --cwd $tmpClone $tmpArchive
     rm -f $tmpArchive/.hg_archival.txt
 
     echo "hg revision is $(cd $tmpClone; hg id -r "$rev" -i)"