Skip to content

Commit 4479ebc

Browse files
authored
Merge pull request #7 from unisoncomputing/cp/transcript-update
Fix up transcripts for ucm changes
2 parents d33cca3 + b60a406 commit 4479ebc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+270
-291
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jobs:
237237
238238
# Install ucm
239239
mkdir ucm
240-
curl -L https://github.com/unisonweb/unison/releases/download/release%2F0.5.19/ucm-linux.tar.gz | tar -xz -C ucm
240+
curl -L https://github.com/unisonweb/unison/releases/download/release%2F0.5.23/ucm-linux.tar.gz | tar -xz -C ucm
241241
export PATH=$PWD/ucm:$PATH
242242
243243
# Clean up old postgres data if it exists.

src/Share/Codebase/Types.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ import Share.Prelude
1616
import Unison.Codebase.CodeLookup qualified as CL
1717
import Unison.Codebase.Path qualified as Path
1818
import Unison.Codebase.Runtime qualified as Rt
19+
import Unison.NameSegment.Internal (NameSegment (..))
1920
import Unison.Parser.Ann (Ann)
2021
import Unison.Reference qualified as Reference
2122
import Unison.Symbol (Symbol)
22-
import Unison.NameSegment.Internal (NameSegment (..))
2323

2424
publicRoot :: Path.Path
25-
publicRoot = Path.singleton $ NameSegment "public"
25+
publicRoot = Path.singleton (NameSegment "public")
2626

2727
-- | The scope of a given codebase transaction.
2828
data CodebaseEnv = CodebaseEnv

src/Share/Postgres/Causal/Queries.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import Unison.Codebase.Path qualified as Path
5656
import Unison.Hash (Hash)
5757
import Unison.Hash32 (Hash32)
5858
import Unison.Hashing.V2 qualified as H
59-
import Unison.NameSegment.Internal (NameSegment (..))
59+
import Unison.NameSegment.Internal as NameSegment
6060
import Unison.Reference qualified as Reference
6161
import Unison.Util.Map qualified as Map
6262

@@ -765,16 +765,16 @@ saveV2BranchShallow v2Branch = do
765765
expectV2BranchDependencies V2.Branch {terms, types, patches, children} = do
766766
terms' <-
767767
terms
768-
& Map.bitraverse (pure . coerce @NameSegment @Text) (traverse (fmap mdValuesToMetadataSetFormat))
768+
& Map.bitraverse (pure . NameSegment.toUnescapedText) (traverse (fmap mdValuesToMetadataSetFormat))
769769
types' <-
770770
types
771-
& Map.bitraverse (pure . coerce @NameSegment @Text) (traverse (fmap mdValuesToMetadataSetFormat))
771+
& Map.bitraverse (pure . NameSegment.toUnescapedText) (traverse (fmap mdValuesToMetadataSetFormat))
772772
let patches' =
773773
patches
774-
& Map.bimap (coerce @NameSegment @Text) fst
774+
& Map.bimap NameSegment.toUnescapedText fst
775775
let children' =
776776
children
777-
& Map.bimap (coerce @NameSegment @Text) Causal.causalHash
777+
& Map.bimap NameSegment.toUnescapedText Causal.causalHash
778778
let hashBranchFull :: BranchFull.Branch' Text Hash PatchHash CausalHash =
779779
BranchFull.Branch
780780
{ terms = terms',

src/Share/Postgres/Sync/Conversions.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ branchV2ToBF (V2.Branch {terms, types, patches, children}) = do
3535
where
3636
convertTerms :: Map NameSegment (Map V2.Referent (m V2.MdValues)) -> m (Map Text (Map (BranchFull.Referent'' Text Hash) (BranchFull.MetadataSetFormat' Text Hash)))
3737
convertTerms m = do
38-
Map.mapKeys (coerce @NameSegment @Text) m
38+
Map.mapKeys NameSegment.toUnescapedText m
3939
& traversed . traversed
4040
%%~ \mdM -> do
4141
V2.MdValues md <- mdM

src/Share/Web/Authorization.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import Data.Set.NonEmpty (NESet)
7070
import Data.Set.NonEmpty qualified as NESet
7171
import Data.Text.Encoding qualified as Text
7272
import Data.Time qualified as Time
73+
import Servant
7374
import Share.Branch
7475
import Share.Contribution (Contribution (..), ContributionStatus (..))
7576
import Share.IDs
@@ -91,7 +92,6 @@ import Share.Web.Errors qualified as Errors
9192
import Share.Web.Share.Comments
9293
import Share.Web.Share.Contributions.Types (UpdateContributionRequest (..))
9394
import Share.Web.Share.Tickets.Types
94-
import Servant
9595
import Unison.Codebase.Path (Path)
9696
import Unison.Codebase.Path qualified as Path
9797
import Unison.NameSegment.Internal (NameSegment (..))

src/Unison/PrettyPrintEnvDecl/Postgres.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import Share.Prelude
1313
import Unison.HashQualified' qualified as HQ'
1414
import Unison.LabeledDependency (LabeledDependency)
1515
import Unison.Name (Name)
16-
import Unison.Name qualified as Name
17-
import Unison.NameSegment.Internal (NameSegment (..))
1816
import Unison.PrettyPrintEnv qualified as PPE
1917
import Unison.PrettyPrintEnvDecl qualified as PPED
2018
import Unison.Reference qualified as V1
@@ -31,11 +29,11 @@ ppedForReferences namesPerspective refs = do
3129
namesForReference :: Either (V1.Referent, PGReferent) (V1.Reference, PGReference) -> m ([(Name, Name, V1.Referent)], [(Name, Name, V1.Reference)])
3230
namesForReference = \case
3331
Left (ref, pgref) -> do
34-
termNames <- fmap (bothMap $ Name.fromReverseSegments . fmap NameSegment . coerce @NameLookups.ReversedName @(NonEmpty Text)) <$> NameLookupOps.termNamesForRefWithinNamespace namesPerspective pgref Nothing
32+
termNames <- fmap (bothMap NameLookups.reversedNameToName) <$> NameLookupOps.termNamesForRefWithinNamespace namesPerspective pgref Nothing
3533
let termNames' = termNames <&> \(fqn, suffixed) -> (fqn, suffixed, ref)
3634
pure $ (termNames', [])
3735
Right (ref, pgref) -> do
38-
typeNames <- fmap (bothMap $ Name.fromReverseSegments . coerce) <$> NameLookupOps.typeNamesForRefWithinNamespace namesPerspective pgref Nothing
36+
typeNames <- fmap (bothMap NameLookups.reversedNameToName) <$> NameLookupOps.typeNamesForRefWithinNamespace namesPerspective pgref Nothing
3937
let typeNames' = typeNames <&> \(fqn, suffixed) -> (fqn, suffixed, ref)
4038
pure $ ([], typeNames')
4139

src/Unison/Server/NameSearch/Postgres.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Unison.HashQualified' qualified as HQ'
1717
import Unison.Name (Name)
1818
import Unison.Name qualified as Name
1919
import Unison.NameSegment.Internal (NameSegment (..))
20+
import Unison.NameSegment.Internal qualified as NameSegment
2021
import Unison.NamesWithHistory (SearchType (..))
2122
import Unison.Reference qualified as V1
2223
import Unison.Reference qualified as V1Reference
@@ -123,4 +124,4 @@ nameSearchForPerspective namesPerspective =
123124

124125
-- Fully qualify a name by prepending the current namespace perspective's path
125126
fullyQualifyName :: Name -> Name
126-
fullyQualifyName name = fromMaybe name $ Path.maybePrefixName (Path.AbsolutePath' . Path.Absolute $ (Path.fromList . fmap NameSegment . coerce @PathSegments @[Text] $ pathToMountedNameLookup namesPerspective)) name
127+
fullyQualifyName name = fromMaybe name $ Path.maybePrefixName (Path.AbsolutePath' $ Path.Absolute (Path.fromList . (fmap NameSegment.NameSegment) . into @[Text] $ pathToMountedNameLookup namesPerspective)) name

src/Unison/Server/Share/NamespaceDetails.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ namespaceDetails runtime namespacePath rootCausalId mayWidth = runMaybeT $ do
2828
mayReadme <- lift $ RenderDoc.findAndRenderDoc readmeNames runtime namespacePath rootCausalId mayWidth
2929
pure $ NamespaceDetails namespacePath ("#" <> from @CausalHash @UnisonHash causalHashAtPath) mayReadme
3030
where
31-
readmeNames = Set.fromList $ fmap NameSegment ["README", "Readme", "ReadMe", "readme"]
31+
readmeNames = Set.fromList . fmap NameSegment $ ["README", "Readme", "ReadMe", "readme"]

transcripts/run-transcripts.zsh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ transcripts=(
1818
contributions transcripts/share-apis/contributions/
1919
projects-flow transcripts/share-apis/projects-flow/
2020
project-maintainers transcripts/share-apis/project-maintainers/
21-
release transcripts/share-apis/releases
22-
branche transcripts/share-apis/branches
23-
branch-brows transcripts/share-apis/branch-browse
24-
loose-code transcripts/share-apis/loose-code/
25-
sync-apis transcripts/sync-apis
21+
release transcripts/share-apis/releases/
22+
branche transcripts/share-apis/branches/
23+
branch-browse transcripts/share-apis/branch-browse/
24+
code-browse transcripts/share-apis/code-browse/
25+
sync-apis transcripts/sync-apis/
2626
)
2727

2828
for transcript dir in "${(@kv)transcripts}"; do

0 commit comments

Comments
 (0)