aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-01-27 13:45:49 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-01-27 13:45:49 +0100
commit5046233b5a6e544eedb4720d81f21d37a7c35d3b (patch)
treec98939c94a99fe202214b7a9fd96a35e887ee259 /src
parentcc22cf662b6998abbb5a08afce7678c5b149d204 (diff)
Add Mercurial tests
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/flake/flake.cc9
-rw-r--r--src/libstore/fetchers/mercurial.cc2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc
index cabc12738..15b852c7c 100644
--- a/src/libexpr/flake/flake.cc
+++ b/src/libexpr/flake/flake.cc
@@ -509,7 +509,14 @@ LockedFlake lockFlake(
if (settings.warnDirty)
warn("will not write lock file of flake '%s' because it has a mutable input", topRef);
} else {
- newLockFile.write(*sourcePath + (topRef.subdir == "" ? "" : "/" + topRef.subdir) + "/flake.lock");
+ auto path = *sourcePath + (topRef.subdir == "" ? "" : "/" + topRef.subdir) + "/flake.lock";
+
+ if (pathExists(path))
+ warn("updating lock file '%s'", path);
+ else
+ warn("creating lock file '%s'", path);
+
+ newLockFile.write(path);
// FIXME: rewriting the lockfile changed the
// top-level repo, so we should re-read it.
diff --git a/src/libstore/fetchers/mercurial.cc b/src/libstore/fetchers/mercurial.cc
index 304b2d967..e6f252700 100644
--- a/src/libstore/fetchers/mercurial.cc
+++ b/src/libstore/fetchers/mercurial.cc
@@ -89,6 +89,8 @@ struct MercurialInput : Input
// FIXME: return lastModified.
+ // FIXME: don't clone local repositories.
+
if (!input->ref && !input->rev && isLocal && pathExists(actualUrl + "/.hg")) {
bool clean = runProgram("hg", true, { "status", "-R", actualUrl, "--modified", "--added", "--removed" }) == "";