Skip to content

Commit 0a0d6ad

Browse files
remove upgrade.commit
1 parent 899d6a6 commit 0a0d6ad

File tree

9 files changed

+14
-235
lines changed

9 files changed

+14
-235
lines changed

unison-cli/src/Unison/Codebase/Editor/HandleInput.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import Unison.Codebase.Editor.HandleInput.BranchRename (handleBranchRename)
5151
import Unison.Codebase.Editor.HandleInput.BranchSquash (handleBranchSquash)
5252
import Unison.Codebase.Editor.HandleInput.Branches (handleBranches)
5353
import Unison.Codebase.Editor.HandleInput.CommitMerge (handleCommitMerge)
54-
import Unison.Codebase.Editor.HandleInput.CommitUpgrade (handleCommitUpgrade)
5554
import Unison.Codebase.Editor.HandleInput.DebugDefinition qualified as DebugDefinition
5655
import Unison.Codebase.Editor.HandleInput.DebugFoldRanges qualified as DebugFoldRanges
5756
import Unison.Codebase.Editor.HandleInput.DebugSynhashTerm (handleDebugSynhashTerm)
@@ -761,7 +760,8 @@ loop e = do
761760
BranchSquashI branchToSquash destBranch -> handleBranchSquash branchToSquash destBranch
762761
ReleaseDraftI semver -> handleReleaseDraft semver
763762
UpgradeI old new -> handleUpgrade old new
764-
UpgradeCommitI -> handleCommitUpgrade
763+
UpgradeCommitI ->
764+
Cli.returnEarly (Output.Literal "The `upgrade.commit` command has been removed in favor of `update`.")
765765
LibInstallI remind libdep -> handleInstallLib remind libdep
766766
LibInstallLocalI src destLibName -> handleInstallLocalLib src destLibName
767767
DebugSynhashTermI name -> handleDebugSynhashTerm name

unison-cli/src/Unison/Codebase/Editor/HandleInput/CommitUpgrade.hs

Lines changed: 0 additions & 50 deletions
This file was deleted.

unison-cli/src/Unison/Codebase/Editor/Output.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@ data Output
432432
| MergeConflictInvolvingBuiltin !(Defn Name Name)
433433
| MergeDefnsInLib !MergeSourceOrTarget
434434
| InstalledLibdep !(ProjectAndBranch ProjectName ProjectBranchName) !NameSegment
435-
| NoUpgradeInProgress
436435
| UseLibInstallNotPull !(ProjectAndBranch ProjectName ProjectBranchName)
437436
| PullIntoMissingBranch !(ReadRemoteNamespace Share.RemoteProjectBranch) !(ProjectAndBranch (Maybe ProjectName) ProjectBranchName)
438437
| NoMergeInProgress
@@ -673,7 +672,6 @@ isFailure o = case o of
673672
MergeConflictInvolvingBuiltin {} -> True
674673
MergeDefnsInLib {} -> True
675674
InstalledLibdep {} -> False
676-
NoUpgradeInProgress {} -> True
677675
UseLibInstallNotPull {} -> False
678676
PullIntoMissingBranch {} -> True
679677
NoMergeInProgress {} -> True

unison-cli/src/Unison/CommandLine/InputPatterns.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ module Unison.CommandLine.InputPatterns
113113
update,
114114
updateBuiltins,
115115
upgrade,
116-
upgradeCommitInputPattern,
117116
view,
118117
viewGlobal,
119118
deprecatedViewRootReflog,
@@ -3451,7 +3450,7 @@ upgradeCommitInputPattern =
34513450
InputPattern
34523451
{ patternName = "upgrade.commit",
34533452
aliases = ["commit.upgrade"],
3454-
visibility = I.Visible,
3453+
visibility = I.Hidden,
34553454
params = noParams,
34563455
help =
34573456
let mainBranch = defaultBranchName

unison-cli/src/Unison/CommandLine/OutputMessages.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,7 @@ notifyUser dir = \case
20152015
"",
20162016
P.wrap "When you're done, you can run",
20172017
"",
2018-
P.indentN 2 (IP.makeExampleNoBackticks IP.upgradeCommitInputPattern []),
2018+
P.indentN 2 (IP.makeExampleNoBackticks IP.update []),
20192019
"",
20202020
P.wrap $
20212021
"to merge your changes back into"
@@ -2135,8 +2135,6 @@ notifyUser dir = \case
21352135
<> prettyProjectAndBranchName libdep
21362136
<> "into"
21372137
<> P.group (P.text $ into @Text $ Path.fromList [NameSegment.libSegment, segment])
2138-
NoUpgradeInProgress ->
2139-
pure . P.wrap $ "It doesn't look like there's an upgrade in progress."
21402138
UseLibInstallNotPull libdep ->
21412139
pure . P.wrap $
21422140
"The use of"

unison-cli/unison-cli.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ library
5353
Unison.Codebase.Editor.HandleInput.BranchRename
5454
Unison.Codebase.Editor.HandleInput.BranchSquash
5555
Unison.Codebase.Editor.HandleInput.CommitMerge
56-
Unison.Codebase.Editor.HandleInput.CommitUpgrade
5756
Unison.Codebase.Editor.HandleInput.DebugDefinition
5857
Unison.Codebase.Editor.HandleInput.DebugFoldRanges
5958
Unison.Codebase.Editor.HandleInput.DebugSynhashTerm

unison-src/transcripts/idempotent/fix4482.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mybar = bar + bar
3838
3939
When you're done, you can run
4040
41-
upgrade.commit
41+
update
4242
4343
to merge your changes back into main and delete the temporary
4444
branch. Or, if you decide to cancel the upgrade instead, you

unison-src/transcripts/idempotent/help.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -968,18 +968,6 @@
968968
`upgrade old new` upgrades library dependency `lib.old` to
969969
`lib.new`, and, if successful, deletes `lib.old`.
970970
971-
upgrade.commit (or commit.upgrade)
972-
`upgrade.commit` merges a temporary branch created by the
973-
`upgrade` command back into its parent branch, and removes the
974-
temporary branch.
975-
976-
For example, if you've done `upgrade foo bar` from main, then
977-
`upgrade.commit` is equivalent to doing
978-
979-
* switch /main
980-
* merge /upgrade-foo-to-bar
981-
* delete.branch /upgrade-foo-to-bar
982-
983971
version
984972
Print the version of unison you're running
985973

unison-src/transcripts/idempotent/upgrade.md

Lines changed: 9 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -85,102 +85,33 @@ lib.new.foo = +18
8585
thingy = lib.old.foo + 10
8686
```
8787

88-
``` ucm :added-by-ucm
89-
Loading changes detected in scratch.u.
90-
91-
+ lib.new.foo : Int
92-
+ lib.old.foo : Nat
93-
+ thingy : Nat
94-
95-
Run `update` to apply these changes to your codebase.
96-
```
97-
9888
``` ucm
99-
proj/main> add
100-
101-
Okay, I'm searching the branch for code that needs to be
102-
updated...
103-
104-
Done.
89+
proj/main> update
10590
```
10691

10792
``` ucm :error
10893
proj/main> upgrade old new
109-
110-
I couldn't automatically upgrade old to new. However, I've
111-
added the definitions that need attention to the top of
112-
scratch.u.
113-
114-
When you're done, you can run
115-
116-
upgrade.commit
117-
118-
to merge your changes back into main and delete the temporary
119-
branch. Or, if you decide to cancel the upgrade instead, you
120-
can run
121-
122-
delete.branch /upgrade-old-to-new
123-
124-
to delete the temporary branch and switch back to main.
125-
```
126-
127-
``` unison :added-by-ucm scratch.u
128-
-- The definitions below no longer typecheck after upgrading.
129-
-- Please fix the errors, then run `update`.
130-
131-
thingy : Nat
132-
thingy =
133-
use Nat +
134-
foo + 10
135-
13694
```
13795

138-
Resolve the error and commit the upgrade.
96+
Resolve the error and run `update` to finish the upgrade.
13997

14098
``` unison
14199
thingy = foo + +10
142100
```
143101

144-
``` ucm :added-by-ucm
145-
Loading changes detected in scratch.u.
146-
147-
~ thingy : Int
148-
149-
~ (modified)
150-
151-
Run `update` to apply these changes to your codebase.
152-
```
153-
154102
``` ucm
155103
proj/upgrade-old-to-new> update
156-
157-
Okay, I'm searching the branch for code that needs to be
158-
updated...
159-
160-
Done.
161-
162-
proj/upgrade-old-to-new> upgrade.commit
163-
164-
I fast-forward merged proj/upgrade-old-to-new into proj/main.
165-
166104
proj/main> view thingy
167-
168-
thingy : Int
169-
thingy =
170-
use Int +
171-
foo + +10
172-
173105
proj/main> ls lib
174-
175-
1. builtin. (664 terms, 103 types)
176-
2. new. (1 term)
177-
178106
proj/main> branches
107+
```
179108

180-
Branch Remote branch
181-
1. main
109+
``` ucm :hide
110+
proj/main> project.delete proj
182111
```
183112

113+
# Upgrade sad path (showing delete on upgrade branch)
114+
184115
``` ucm :hide
185116
proj/main> builtins.merge lib.builtin
186117
```
@@ -191,103 +122,19 @@ lib.new.foo = +18
191122
thingy = lib.old.foo + 10
192123
```
193124

194-
``` ucm :added-by-ucm
195-
Loading changes detected in scratch.u.
196-
197-
+ lib.old.foo : Nat
198-
~ thingy : Nat
199-
200-
(and 1 unchanged term)
201-
202-
+ (added), ~ (modified)
203-
204-
Run `update` to apply these changes to your codebase.
205-
```
206-
207125
``` ucm
208-
proj/main> add
209-
210-
Okay, I'm searching the branch for code that needs to be
211-
updated...
212-
213-
Done.
126+
proj/main> update
214127
```
215128

216129
``` ucm :error
217130
proj/main> upgrade old new
218-
219-
I couldn't automatically upgrade old to new. However, I've
220-
added the definitions that need attention to the top of
221-
scratch.u.
222-
223-
When you're done, you can run
224-
225-
upgrade.commit
226-
227-
to merge your changes back into main and delete the temporary
228-
branch. Or, if you decide to cancel the upgrade instead, you
229-
can run
230-
231-
delete.branch /upgrade-old-to-new
232-
233-
to delete the temporary branch and switch back to main.
234-
```
235-
236-
``` unison :added-by-ucm scratch.u
237-
-- The definitions below no longer typecheck after upgrading.
238-
-- Please fix the errors, then run `update`.
239-
240-
thingy : Nat
241-
thingy =
242-
use Nat +
243-
foo + 10
244-
245-
```
246-
247-
Resolve the error and commit the upgrade.
248-
249-
``` unison
250-
thingy = foo + +10
251-
```
252-
253-
``` ucm :added-by-ucm
254-
Loading changes detected in scratch.u.
255-
256-
~ thingy : Int
257-
258-
~ (modified)
259-
260-
Run `update` to apply these changes to your codebase.
261131
```
262132

263133
``` ucm
264134
proj/upgrade-old-to-new> update
265-
266-
Okay, I'm searching the branch for code that needs to be
267-
updated...
268-
269-
Done.
270-
271-
proj/upgrade-old-to-new> upgrade.commit
272-
273-
I fast-forward merged proj/upgrade-old-to-new into proj/main.
274-
275-
proj/main> view thingy
276-
277-
thingy : Int
278-
thingy =
279-
use Int +
280-
foo + +10
281-
282135
proj/main> ls lib
283-
284-
1. builtin. (664 terms, 103 types)
285-
2. new. (1 term)
286-
136+
proj/main> ls .
287137
proj/main> branches
288-
289-
Branch Remote branch
290-
1. main
291138
```
292139

293140
``` ucm :hide

0 commit comments

Comments
 (0)