about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/primops/fetchMercurial.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libexpr/primops/fetchMercurial.cc')
-rw-r--r--third_party/nix/src/libexpr/primops/fetchMercurial.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/third_party/nix/src/libexpr/primops/fetchMercurial.cc b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
index b6d4a5e1c8bc..71722faedf11 100644
--- a/third_party/nix/src/libexpr/primops/fetchMercurial.cc
+++ b/third_party/nix/src/libexpr/primops/fetchMercurial.cc
@@ -3,6 +3,7 @@
 
 #include <absl/strings/ascii.h>
 #include <absl/strings/match.h>
+#include <absl/strings/str_split.h>
 #include <glog/logging.h>
 #include <sys/time.h>
 
@@ -48,11 +49,11 @@ HgInfo exportMercurial(ref<Store> store, const std::string& uri,
       hgInfo.branch = absl::StripTrailingAsciiWhitespace(
           runProgram("hg", true, {"branch", "-R", uri}));
 
-      auto files = tokenizeString<std::set<std::string>>(
+      std::set<std::string> files = absl::StrSplit(
           runProgram("hg", true,
                      {"status", "-R", uri, "--clean", "--modified", "--added",
                       "--no-status", "--print0"}),
-          "\0"s);
+          absl::ByChar('\0'));
 
       PathFilter filter = [&](const Path& p) -> bool {
         assert(absl::StartsWith(p, uri));
@@ -124,10 +125,11 @@ HgInfo exportMercurial(ref<Store> store, const std::string& uri,
     writeFile(stampFile, "");
   }
 
-  auto tokens = tokenizeString<std::vector<std::string>>(
-      runProgram("hg", true,
-                 {"log", "-R", cacheDir, "-r", rev, "--template",
-                  "{node} {rev} {branch}"}));
+  std::vector<std::string> tokens =
+      absl::StrSplit(runProgram("hg", true,
+                                {"log", "-R", cacheDir, "-r", rev, "--template",
+                                 "{node} {rev} {branch}"}),
+                     absl::ByAnyChar(" \t\n\r"));
   assert(tokens.size() == 3);
 
   HgInfo hgInfo;