From 77e1f9010c5328bee16d85661fe359746cb70e40 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 8 May 2019 13:38:32 +0200 Subject: [PATCH] Export missing rev/shortRev attributes --- src/libexpr/primops/flake.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc index b451afba4..dc8df7f6f 100644 --- a/src/libexpr/primops/flake.cc +++ b/src/libexpr/primops/flake.cc @@ -441,6 +441,8 @@ void callFlake(EvalState & state, const ResolvedFlake & resFlake, Value & v) state.store->isValidPath(nonFlake.storePath); mkString(*state.allocAttr(*vNonFlake, state.sOutPath), nonFlake.storePath, {nonFlake.storePath}); + + // FIXME: add rev, shortRev, revCount, ... } mkString(*state.allocAttr(v, state.sDescription), resFlake.flake.description); @@ -449,6 +451,13 @@ void callFlake(EvalState & state, const ResolvedFlake & resFlake, Value & v) state.store->isValidPath(path); mkString(*state.allocAttr(v, state.sOutPath), path, {path}); + if (resFlake.flake.resolvedRef.rev) { + mkString(*state.allocAttr(v, state.symbols.create("rev")), + resFlake.flake.resolvedRef.rev->gitRev()); + mkString(*state.allocAttr(v, state.symbols.create("shortRev")), + resFlake.flake.resolvedRef.rev->gitShortRev()); + } + if (resFlake.flake.revCount) mkInt(*state.allocAttr(v, state.symbols.create("revCount")), *resFlake.flake.revCount);