Skip to content

Commit

Permalink
Bump unison to trunk again
Browse files Browse the repository at this point in the history
Fix errors from bumping unison-trunk
Update transcript output
  • Loading branch information
ChrisPenner committed Jul 1, 2024
1 parent 4b6bd33 commit b60a406
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ jobs:
# Install ucm
mkdir ucm
curl -L https://github.com/unisonweb/unison/releases/download/release%2F0.5.19/ucm-linux.tar.gz | tar -xz -C ucm
curl -L https://github.com/unisonweb/unison/releases/download/release%2F0.5.23/ucm-linux.tar.gz | tar -xz -C ucm
export PATH=$PWD/ucm:$PATH
# Clean up old postgres data if it exists.
Expand Down
4 changes: 2 additions & 2 deletions src/Share/Codebase/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import Share.Prelude
import Unison.Codebase.CodeLookup qualified as CL
import Unison.Codebase.Path qualified as Path
import Unison.Codebase.Runtime qualified as Rt
import Unison.NameSegment.Internal (NameSegment (..))
import Unison.Parser.Ann (Ann)
import Unison.Reference qualified as Reference
import Unison.Symbol (Symbol)
import Unison.NameSegment.Internal (NameSegment (..))

publicRoot :: Path.Path
publicRoot = Path.singleton $ NameSegment "public"
publicRoot = Path.singleton (NameSegment "public")

-- | The scope of a given codebase transaction.
data CodebaseEnv = CodebaseEnv
Expand Down
10 changes: 5 additions & 5 deletions src/Share/Postgres/Causal/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import Unison.Codebase.Path qualified as Path
import Unison.Hash (Hash)
import Unison.Hash32 (Hash32)
import Unison.Hashing.V2 qualified as H
import Unison.NameSegment.Internal (NameSegment (..))
import Unison.NameSegment.Internal as NameSegment
import Unison.Reference qualified as Reference
import Unison.Util.Map qualified as Map

Expand Down Expand Up @@ -765,16 +765,16 @@ saveV2BranchShallow v2Branch = do
expectV2BranchDependencies V2.Branch {terms, types, patches, children} = do
terms' <-
terms
& Map.bitraverse (pure . coerce @NameSegment @Text) (traverse (fmap mdValuesToMetadataSetFormat))
& Map.bitraverse (pure . NameSegment.toUnescapedText) (traverse (fmap mdValuesToMetadataSetFormat))
types' <-
types
& Map.bitraverse (pure . coerce @NameSegment @Text) (traverse (fmap mdValuesToMetadataSetFormat))
& Map.bitraverse (pure . NameSegment.toUnescapedText) (traverse (fmap mdValuesToMetadataSetFormat))
let patches' =
patches
& Map.bimap (coerce @NameSegment @Text) fst
& Map.bimap NameSegment.toUnescapedText fst
let children' =
children
& Map.bimap (coerce @NameSegment @Text) Causal.causalHash
& Map.bimap NameSegment.toUnescapedText Causal.causalHash
let hashBranchFull :: BranchFull.Branch' Text Hash PatchHash CausalHash =
BranchFull.Branch
{ terms = terms',
Expand Down
2 changes: 1 addition & 1 deletion src/Share/Postgres/Sync/Conversions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ branchV2ToBF (V2.Branch {terms, types, patches, children}) = do
where
convertTerms :: Map NameSegment (Map V2.Referent (m V2.MdValues)) -> m (Map Text (Map (BranchFull.Referent'' Text Hash) (BranchFull.MetadataSetFormat' Text Hash)))
convertTerms m = do
Map.mapKeys (coerce @NameSegment @Text) m
Map.mapKeys NameSegment.toUnescapedText m
& traversed . traversed
%%~ \mdM -> do
V2.MdValues md <- mdM
Expand Down
2 changes: 1 addition & 1 deletion src/Share/Web/Authorization.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import Data.Set.NonEmpty (NESet)
import Data.Set.NonEmpty qualified as NESet
import Data.Text.Encoding qualified as Text
import Data.Time qualified as Time
import Servant
import Share.Branch
import Share.Contribution (Contribution (..), ContributionStatus (..))
import Share.IDs
Expand All @@ -91,7 +92,6 @@ import Share.Web.Errors qualified as Errors
import Share.Web.Share.Comments
import Share.Web.Share.Contributions.Types (UpdateContributionRequest (..))
import Share.Web.Share.Tickets.Types
import Servant
import Unison.Codebase.Path (Path)
import Unison.Codebase.Path qualified as Path
import Unison.NameSegment.Internal (NameSegment (..))
Expand Down
6 changes: 2 additions & 4 deletions src/Unison/PrettyPrintEnvDecl/Postgres.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import Share.Prelude
import Unison.HashQualified' qualified as HQ'
import Unison.LabeledDependency (LabeledDependency)
import Unison.Name (Name)
import Unison.Name qualified as Name
import Unison.NameSegment.Internal (NameSegment (..))
import Unison.PrettyPrintEnv qualified as PPE
import Unison.PrettyPrintEnvDecl qualified as PPED
import Unison.Reference qualified as V1
Expand All @@ -31,11 +29,11 @@ ppedForReferences namesPerspective refs = do
namesForReference :: Either (V1.Referent, PGReferent) (V1.Reference, PGReference) -> m ([(Name, Name, V1.Referent)], [(Name, Name, V1.Reference)])
namesForReference = \case
Left (ref, pgref) -> do
termNames <- fmap (bothMap $ Name.fromReverseSegments . fmap NameSegment . coerce @NameLookups.ReversedName @(NonEmpty Text)) <$> NameLookupOps.termNamesForRefWithinNamespace namesPerspective pgref Nothing
termNames <- fmap (bothMap NameLookups.reversedNameToName) <$> NameLookupOps.termNamesForRefWithinNamespace namesPerspective pgref Nothing
let termNames' = termNames <&> \(fqn, suffixed) -> (fqn, suffixed, ref)
pure $ (termNames', [])
Right (ref, pgref) -> do
typeNames <- fmap (bothMap $ Name.fromReverseSegments . coerce) <$> NameLookupOps.typeNamesForRefWithinNamespace namesPerspective pgref Nothing
typeNames <- fmap (bothMap NameLookups.reversedNameToName) <$> NameLookupOps.typeNamesForRefWithinNamespace namesPerspective pgref Nothing
let typeNames' = typeNames <&> \(fqn, suffixed) -> (fqn, suffixed, ref)
pure $ ([], typeNames')

Expand Down
3 changes: 2 additions & 1 deletion src/Unison/Server/NameSearch/Postgres.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Unison.HashQualified' qualified as HQ'
import Unison.Name (Name)
import Unison.Name qualified as Name
import Unison.NameSegment.Internal (NameSegment (..))
import Unison.NameSegment.Internal qualified as NameSegment
import Unison.NamesWithHistory (SearchType (..))
import Unison.Reference qualified as V1
import Unison.Reference qualified as V1Reference
Expand Down Expand Up @@ -123,4 +124,4 @@ nameSearchForPerspective namesPerspective =

-- Fully qualify a name by prepending the current namespace perspective's path
fullyQualifyName :: Name -> Name
fullyQualifyName name = fromMaybe name $ Path.maybePrefixName (Path.AbsolutePath' . Path.Absolute $ (Path.fromList . fmap NameSegment . coerce @PathSegments @[Text] $ pathToMountedNameLookup namesPerspective)) name
fullyQualifyName name = fromMaybe name $ Path.maybePrefixName (Path.AbsolutePath' $ Path.Absolute (Path.fromList . (fmap NameSegment.NameSegment) . into @[Text] $ pathToMountedNameLookup namesPerspective)) name
2 changes: 1 addition & 1 deletion src/Unison/Server/Share/NamespaceDetails.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ namespaceDetails runtime namespacePath rootCausalId mayWidth = runMaybeT $ do
mayReadme <- lift $ RenderDoc.findAndRenderDoc readmeNames runtime namespacePath rootCausalId mayWidth
pure $ NamespaceDetails namespacePath ("#" <> from @CausalHash @UnisonHash causalHashAtPath) mayReadme
where
readmeNames = Set.fromList $ fmap NameSegment ["README", "Readme", "ReadMe", "readme"]
readmeNames = Set.fromList . fmap NameSegment $ ["README", "Readme", "ReadMe", "readme"]
2 changes: 1 addition & 1 deletion transcripts/sync-apis/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ diverge = 100

```ucm
proj/main> add
proj/main> push
proj/main> push @transcripts/proj/main
```

```unison:hide
Expand Down
14 changes: 13 additions & 1 deletion transcripts/sync-apis/sync.output.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ proj/main> add
diverge : Nat
proj/main> push
proj/main> push @transcripts/proj/main
Uploaded 3 entities.
Expand Down Expand Up @@ -144,6 +144,18 @@ proj/diverge> pull @transcripts/proj/main
I couldn't automatically merge remote @transcripts/proj/main
into proj/diverge. However, I've added the definitions that
need attention to the top of scratch.u.
When you're done, you can run
merge.commit
to merge your changes back into diverge and delete the
temporary branch. Or, if you decide to cancel the merge
instead, you can run
delete.branch /merge-remote-main-into-diverge
to delete the temporary branch and switch back to diverge.
```
```unison:added-by-ucm scratch.u
Expand Down

0 comments on commit b60a406

Please sign in to comment.