@@ -967,7 +967,7 @@ loop e = do
967967 -- stepAt updateBuiltins
968968 -- checkTodo
969969
970- MergeBuiltinsI -> do
970+ MergeBuiltinsI opath -> do
971971 Cli. Env {codebase} <- ask
972972 description <- inputDescription input
973973 -- these were added once, but maybe they've changed and need to be
@@ -983,10 +983,13 @@ loop e = do
983983 -- due to builtin terms; so we don't just reuse `uf` above.
984984 let srcb = BranchUtil. fromNames Builtin. names
985985 currentPath <- Cli. getCurrentPath
986- _ <- Cli. updateAtM description (currentPath `snoc` " builtin" ) \ destb ->
986+ let destPath = case opath of
987+ Just path -> Path. resolve currentPath (Path. Relative path)
988+ Nothing -> currentPath `snoc` " builtin"
989+ _ <- Cli. updateAtM description destPath \ destb ->
987990 liftIO (Branch. merge'' (Codebase. lca codebase) Branch. RegularMerge srcb destb)
988991 Cli. respond Success
989- MergeIOBuiltinsI -> do
992+ MergeIOBuiltinsI opath -> do
990993 Cli. Env {codebase} <- ask
991994 description <- inputDescription input
992995 -- these were added once, but maybe they've changed and need to be
@@ -1007,7 +1010,10 @@ loop e = do
10071010 let names0 = Builtin. names <> UF. typecheckedToNames IOSource. typecheckedFile'
10081011 let srcb = BranchUtil. fromNames names0
10091012 currentPath <- Cli. getCurrentPath
1010- _ <- Cli. updateAtM description (currentPath `snoc` " builtin" ) \ destb ->
1013+ let destPath = case opath of
1014+ Just path -> Path. resolve currentPath (Path. Relative path)
1015+ Nothing -> currentPath `snoc` " builtin"
1016+ _ <- Cli. updateAtM description destPath \ destb ->
10111017 liftIO (Branch. merge'' (Codebase. lca codebase) Branch. RegularMerge srcb destb)
10121018 Cli. respond Success
10131019 ListEditsI maybePath -> do
@@ -1305,8 +1311,10 @@ inputDescription input =
13051311 IOTestI hq -> pure (" io.test " <> HQ. toText hq)
13061312 IOTestAllI -> pure " io.test.all"
13071313 UpdateBuiltinsI -> pure " builtins.update"
1308- MergeBuiltinsI -> pure " builtins.merge"
1309- MergeIOBuiltinsI -> pure " builtins.mergeio"
1314+ MergeBuiltinsI Nothing -> pure " builtins.merge"
1315+ MergeBuiltinsI (Just path) -> (" builtins.merge " <> ) <$> p path
1316+ MergeIOBuiltinsI Nothing -> pure " builtins.mergeio"
1317+ MergeIOBuiltinsI (Just path) -> (" builtins.mergeio " <> ) <$> p path
13101318 MakeStandaloneI out nm -> pure (" compile " <> Text. pack out <> " " <> HQ. toText nm)
13111319 ExecuteSchemeI nm args ->
13121320 pure $ " run.native " <> Text. unwords (nm : fmap Text. pack args)
@@ -1395,6 +1403,8 @@ inputDescription input =
13951403 where
13961404 hp' :: Either SCH. ShortCausalHash Path' -> Cli Text
13971405 hp' = either (pure . Text. pack . show ) p'
1406+ p :: Path -> Cli Text
1407+ p = fmap tShow . Cli. resolvePath
13981408 p' :: Path' -> Cli Text
13991409 p' = fmap tShow . Cli. resolvePath'
14001410 brp :: BranchRelativePath -> Cli Text
0 commit comments