summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xpkgs/build-support/fetchhg/nix-prefetch-hg8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/build-support/fetchhg/nix-prefetch-hg b/pkgs/build-support/fetchhg/nix-prefetch-hg
index b2711392acc..55501f41bbe 100755
--- a/pkgs/build-support/fetchhg/nix-prefetch-hg
+++ b/pkgs/build-support/fetchhg/nix-prefetch-hg
@@ -36,14 +36,18 @@ fi
 if test -z "$finalPath"; then
 
     tmpPath=/tmp/hg-checkout-tmp-$$
-    tmpClone=$tmpPath/hg-clone
     tmpArchive=$tmpPath/hg-archive
     mkdir $tmpPath
 
     trap "rm -rf $tmpPath" EXIT
 
     # Perform the checkout.
-    hg clone -q -y -U "$url" $tmpClone >&2
+    if [[ $url != /* ]]; then
+      tmpClone=$tmpPath/hg-clone
+      hg clone -q -y -U "$url" $tmpClone >&2
+    else
+      tmpClone=$url
+    fi
     hg archive -q -y -r "$rev" --cwd $tmpClone $tmpArchive