Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New EXPERIMENTAL command to sync file state with codebase #5030

Draft
wants to merge 12 commits into
base: trunk
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix merge conflicts
  • Loading branch information
ChrisPenner committed May 31, 2024
commit 2477b09db193dbd0bf112b5fc348c89bc210b36d
6 changes: 4 additions & 2 deletions parser-typechecker/src/Unison/Codebase/Branch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ withoutTransitiveLibs b0 =
in b0 & children .~ newChildren

onlyLib :: Branch0 m -> Branch0 m
onlyLib Branch0 {..} =
branch0 _terms _types (Map.singleton NameSegment.libSegment (fromMaybe empty $ Map.lookup NameSegment.libSegment _children)) _edits
onlyLib b =
b
& children %~ \c ->
(Map.singleton NameSegment.libSegment (fromMaybe empty $ Map.lookup NameSegment.libSegment c))

-- | @deleteLibdep name branch@ deletes the libdep named @name@ from @branch@, if it exists.
deleteLibdep :: NameSegment -> Branch0 m -> Branch0 m
Expand Down
2 changes: 1 addition & 1 deletion unison-cli/src/Unison/CommandLine/InputPatterns.hs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ commit =
)
\case
[] -> pure $ Input.CommitI Nothing
[file] -> pure $ Input.CommitI . Just $ file
[file] -> Input.LoadI . Just <$> unsupportedStructuredArgument "a file name" file
_ -> Left (I.help load)

update :: InputPattern
Expand Down