Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2f9789c2e668
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1290411c2d0c
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 16, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    elevenfive Matthew Zavislak
    Copy the full SHA
    1290411 View commit details
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/libexpr/primops/fetchMercurial.cc
15 changes: 7 additions & 8 deletions src/libexpr/primops/fetchMercurial.cc
Original file line number Diff line number Diff line change
@@ -54,15 +54,14 @@ static void prim_fetchMercurial(EvalState & state, const Pos & pos, Value * * ar
if (evalSettings.pureEval && !rev)
throw Error("in pure evaluation mode, 'fetchMercurial' requires a Mercurial revision");

auto parsedUrl = parseURL(
url.find("://") != std::string::npos
? "hg+" + url
: "hg+file://" + url);
if (rev) parsedUrl.query.insert_or_assign("rev", rev->gitRev());
if (ref) parsedUrl.query.insert_or_assign("ref", *ref);
// FIXME: use name
auto input = fetchers::inputFromURL(parsedUrl);
fetchers::Attrs attrs;
attrs.insert_or_assign("type", "hg");
attrs.insert_or_assign("url", url.find("://") != std::string::npos ? url : "file://" + url);
if (ref) attrs.insert_or_assign("ref", *ref);
if (rev) attrs.insert_or_assign("rev", rev->gitRev());
auto input = fetchers::inputFromAttrs(attrs);

// FIXME: use name
auto [tree, input2] = input->fetchTree(state.store);

state.mkAttrs(v, 8);