@@ -213,11 +213,11 @@ struct MercurialInputScheme : InputScheme
213213 runHg ({" status" , " -R" , actualUrl, " --clean" , " --modified" , " --added" , " --no-status" , " --print0" }),
214214 " \0 " s);
215215
216- Path actualPath (absPath (actualUrl));
216+ std::filesystem::path actualPath (absPath (actualUrl));
217217
218218 PathFilter filter = [&](const Path & p) -> bool {
219- assert (hasPrefix (p, actualPath));
220- std::string file (p, actualPath.size () + 1 );
219+ assert (hasPrefix (p, actualPath. string () ));
220+ std::string file (p, actualPath.string (). size () + 1 );
221221
222222 auto st = lstat (p);
223223
@@ -232,7 +232,7 @@ struct MercurialInputScheme : InputScheme
232232
233233 auto storePath = store.addToStore (
234234 input.getName (),
235- {getFSSourceAccessor (), CanonPath (actualPath)},
235+ {getFSSourceAccessor (), CanonPath (actualPath. string () )},
236236 ContentAddressMethod::Raw::NixArchive,
237237 HashAlgorithm::SHA256,
238238 {},
@@ -275,10 +275,8 @@ struct MercurialInputScheme : InputScheme
275275 return makeResult (res->value , res->storePath );
276276 }
277277
278- Path cacheDir =
279- fmt (" %s/hg/%s" ,
280- getCacheDir (),
281- hashString (HashAlgorithm::SHA256, actualUrl).to_string (HashFormat::Nix32, false ));
278+ std::filesystem::path cacheDir =
279+ getCacheDir () / " hg" / hashString (HashAlgorithm::SHA256, actualUrl).to_string (HashFormat::Nix32, false );
282280
283281 /* If this is a commit hash that we already have, we don't
284282 have to pull again. */
@@ -292,7 +290,7 @@ struct MercurialInputScheme : InputScheme
292290 try {
293291 runHg ({" pull" , " -R" , cacheDir, " --" , actualUrl});
294292 } catch (ExecError & e) {
295- auto transJournal = cacheDir + " / .hg/ store/ journal" ;
293+ auto transJournal = cacheDir / " .hg" / " store" / " journal" ;
296294 /* hg throws "abandoned transaction" error only if this file exists */
297295 if (pathExists (transJournal)) {
298296 runHg ({" recover" , " -R" , cacheDir});
@@ -302,7 +300,7 @@ struct MercurialInputScheme : InputScheme
302300 }
303301 }
304302 } else {
305- createDirs (dirOf (cacheDir));
303+ createDirs (dirOf (cacheDir. string () ));
306304 runHg ({" clone" , " --noupdate" , " --" , actualUrl, cacheDir});
307305 }
308306 }
@@ -328,14 +326,14 @@ struct MercurialInputScheme : InputScheme
328326 if (auto res = settings.getCache ()->lookupStorePath (revInfoKey (rev), store))
329327 return makeResult (res->value , res->storePath );
330328
331- Path tmpDir = createTempDir ();
329+ std::filesystem::path tmpDir = createTempDir ();
332330 AutoDelete delTmpDir (tmpDir, true );
333331
334332 runHg ({" archive" , " -R" , cacheDir, " -r" , rev.gitRev (), tmpDir});
335333
336- deletePath (tmpDir + " / .hg_archival.txt" );
334+ deletePath (tmpDir / " .hg_archival.txt" );
337335
338- auto storePath = store.addToStore (name, {getFSSourceAccessor (), CanonPath (tmpDir)});
336+ auto storePath = store.addToStore (name, {getFSSourceAccessor (), CanonPath (tmpDir. string () )});
339337
340338 Attrs infoAttrs ({
341339 {" revCount" , (uint64_t ) revCount},
0 commit comments