Commit Graph

7115 Commits

Author SHA1 Message Date
Chris Penner
d53f26775c Create scratch project during codebase creation 2024-06-12 15:06:53 -07:00
Chris Penner
95fd37ad3f Bootstrap scratch project in migration 2024-06-12 13:00:32 -07:00
Chris Penner
7aabcf5d89 Fix up Execute 2024-06-12 12:39:33 -07:00
Chris Penner
23fd0a005b Allow passing project and branch as starting path 2024-06-12 10:43:53 -07:00
Chris Penner
2863b668fa Convert transcript parser to be project based 2024-06-12 10:08:49 -07:00
Chris Penner
815c1b1f1c
Auto-create project-branches referenced in transcript prompts (#5077) 2024-06-12 09:28:12 -04:00
Chris Penner
91527b6008 Merge trunk 2024-06-11 11:10:47 -07:00
Chris Penner
48371c021f Propagate ProjectPath into CLI Main 2024-06-11 09:41:47 -07:00
Chris Penner
8138e61a2a toText and output munging 2024-06-10 16:33:16 -07:00
Chris Penner
18cde10b98 WIP 2024-06-10 15:39:30 -07:00
Mitchell Rosen
e1802a1e2a make edit.namespace not put record accessors 2024-06-10 15:35:15 -04:00
Chris Penner
bcc39d879d Remerge trunk 2024-06-10 10:24:37 -07:00
Chris Penner
0b16a7c9de Fixup BranchId 2024-06-07 15:49:42 -07:00
Chris Penner
e65f6e1968 Remove ability to push loose code paths (local or on share) 2024-06-07 12:13:23 -07:00
Greg Pfeil
ce33057385
Refine Path-prefixing operations
This replaces `prefix :: Absolute -> Path' -> Path` with a couple
alternatives:
- `prefixAbs :: Absolute -> Relative -> Absolute`,
- `maybePrefix :: Path' -> Path' -> Maybe Path'`, and
- `prefix :: Path' -> Relative -> Path'`.

The previous `prefix` could fail to prefix (covered by either the new
`prefix` or `maybePrefix`, depending on whether you want to guarantee
success or capture failure), always threw away the knowledge that the
result was necessarily `Absolute` (covered by `prefixAbs`), and then
always returned an ambiguous result type (covered by all three
replacements).

Then it also provides `prefixRel` as the complement of `prefixAbs` (both
of which are used in the implementation of `prefix`).

Similar changes are made in the replacements for `prefixName :: Absolute
-> Name -> Name`. First, we don’t currently have absolute/relative
variants of `Name`, so we can generalize the first argument to `Path'`.
Then `maybePrefixName :: Path' -> Name -> Maybe Name` exposes the case
where prefixing can’t succeed, and `prefixNameIfRel :: Path' -> Name ->
Name` handles the common case of using the original `Name` if it can’t
be prefixed. Both of these new functions also preserve the `Position` of
the new `Name`, whereas the old implementation always returned a
`Relative` `Name`, despite knowing when it was `Absolute`. And
`prefixName2 :: Path -> Name -> Name` has been removed as there is no
ambiguous variant of `Name` (as `Split` is to `Split'`), so prefixing
with a `Path` isn’t particularly meaningful.

Finally, `nameFromSplit'` is added as a dual to `splitFromName'` to make
it possible to operate on the `Path'` portion of a `Name` without introducing partiality.

These new operations are then propagated through the code, and enable a
couple other type changes: `StructuredArgument.ShallowListEntry` and
`StructuredArgument.SearchResult` now take a `Path'` prefix rather than
the `Path.Absolute` and `Path` prefixes they took previously. This fixes
the absolute `Name` issue in `ls` results.
2024-06-06 23:53:00 -05:00
Chris Penner
36c63e42e9 Merge trunk 2024-06-05 13:50:53 -07:00
Chris Penner
5ad808c9bd Update MoveTerm, MoveType, MoveBranch 2024-06-05 13:47:33 -07:00
Greg Pfeil
cab24bbb28
Remove partiality from hqSplitFromName'
This function previously converted the `Name` to a `Path'`, so
recovering the `Name` became partial. It now goes through `Split'`
instead of `Path'`, preserving the guaranteed segment.
2024-06-05 10:51:29 -06:00
aryairani
0247854e70 [create-pull-request] automated change 2024-06-04 18:34:00 +00:00
Chris Penner
c3a2dfb001 Don't include causalHashId in ProjectBranch 2024-06-04 10:09:02 -07:00
Chris Penner
3267a3e54c Fix up Merge2 2024-06-03 16:54:58 -07:00
Chris Penner
4e2ccf23cc Fix up some more root branch gets 2024-06-03 14:18:29 -07:00
Chris Penner
33458a8141 Fix LSP to work with projects 2024-06-03 14:12:46 -07:00
Chris Penner
2773153f97 Fix argparse for running 'main' within project
Add projectPath parser
2024-06-03 14:12:46 -07:00
Chris Penner
33610106ca Fix up uses of root branch in Backend 2024-06-03 10:08:33 -07:00
Chris Penner
1d906b3765 Clean up uses of root in Codebase, kill the root branch cache 2024-06-03 10:02:57 -07:00
Chris Penner
0d80992da9 Remove root branch accessors from codebase 2024-06-03 09:49:47 -07:00
Chris Penner
965f36f7cb Merge trunk 2024-06-03 09:36:30 -07:00
Chris Penner
8377f68545 merge trunk 2024-06-03 09:34:37 -07:00
Chris Penner
035f75ab36 Merge trunk 2024-06-03 08:44:11 -07:00
Greg Pfeil
5a7e001d7c
Merge remote-tracking branch 'upstream/trunk' into restrict-NameSegment 2024-05-31 15:43:27 -06:00
Greg Pfeil
ae70852257
Move sentinel segment names to Unison.NameSegment
They don’t belong in `Unison.Syntax.NameSegment` because they are not
part of the syntax – they are names stored in the codebase that need to
match regardless of the syntax used.
2024-05-31 14:11:51 -06:00
Chris Penner
63f32a6144 Merge! 2024-05-30 15:56:27 -07:00
Chris Penner
0dcbc126a1 Update all uses of internal branch0 fields 2024-05-30 15:41:56 -07:00
Chris Penner
6384038ee0 Don't expose Branch0 internals, (and add add lens utils to prelude) 2024-05-30 15:21:47 -07:00
Greg Pfeil
06c4b695f6
Type the main arg to execute
This avoids throwing away the type information from `NumberedArgs` and just
generally gets text handling out of the domain logic.
2024-05-29 17:12:31 -06:00
Greg Pfeil
e9d2a21d8a
Merge remote-tracking branch 'upstream/trunk' into structured-numbered-args 2024-05-29 16:28:32 -06:00
Greg Pfeil
f8474ff457
Handle SCH carefully in StructuredArguments
When `StructuredArgument`s are used as an input, preserve the entire hash. When
printed, take the length as an optional argument (and show the full hash when
unavailable).
2024-05-28 16:54:33 -06:00
Chris Penner
9756ac8c1e WIP 2024-05-28 11:15:36 -07:00
Chris Penner
9de134f98b Merge deletion of git commands into project-root 2024-05-28 11:15:36 -07:00
Chris Penner
1b5c93da11 remove git push/pull 2024-05-28 10:09:52 -07:00
Chris Penner
457ca14a05 Allow updating branch heads 2024-05-28 09:23:13 -07:00
Arya Irani
5732d9a822
Merge pull request #5008 from unisonweb/24-05-24-delete-patch-manipulation-commands 2024-05-24 21:44:25 -04:00
Chris Penner
467dee15f8 Checkpoint 2024-05-24 15:17:25 -07:00
Greg Pfeil
b9c62164f8
Restrict NameSegment operations
With `OverloadedStrings` enabled globally and an `IsString` instance, the
`newtype` was rendered useless.

This extracts the `NameSegment` constructor/eliminator to a `.Internal` module,
has `Unison.NameSegment` only re-export the type, and moves the `*Segment`
members to `Unison.Syntax.NameSegment`.

This forces cascading changes, including eliminating a bunch of magic literals
scattered throughout the code.
2024-05-24 15:50:17 -06:00
Chris Penner
2c98ad1b1e Checkpoint 2024-05-24 10:14:08 -07:00
Mitchell Rosen
6adb88f5b3 delete a bunch of patch manipulation commands 2024-05-24 11:01:45 -04:00
Arya Irani
09efb48303
Merge pull request #5005 from sellout/remove-unused 2024-05-24 10:40:04 -04:00
Greg Pfeil
9aa4bf5168
Remove unused Unison.Util.Convert module 2024-05-23 23:19:33 -06:00
Chris Penner
29fd307ad9 Checkpoint 2024-05-23 15:31:50 -07:00