mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-11 10:35:57 +03:00
Fix Upgrade
This commit is contained in:
parent
bf20459954
commit
2f4e57d41b
@ -19,7 +19,7 @@ import Unison.Cli.ProjectUtils qualified as Cli
|
|||||||
import Unison.Codebase qualified as Codebase
|
import Unison.Codebase qualified as Codebase
|
||||||
import Unison.Codebase.Branch qualified as Branch
|
import Unison.Codebase.Branch qualified as Branch
|
||||||
import Unison.Codebase.Branch.Names qualified as Branch
|
import Unison.Codebase.Branch.Names qualified as Branch
|
||||||
import Unison.Codebase.Editor.HandleInput.Branch (CreateFrom (CreateFrom'ParentBranch))
|
import Unison.Codebase.Editor.HandleInput.Branch (CreateFrom (..))
|
||||||
import Unison.Codebase.Editor.HandleInput.Branch qualified as HandleInput.Branch
|
import Unison.Codebase.Editor.HandleInput.Branch qualified as HandleInput.Branch
|
||||||
import Unison.Codebase.Editor.HandleInput.Update2
|
import Unison.Codebase.Editor.HandleInput.Update2
|
||||||
( addDefinitionsToUnisonFile,
|
( addDefinitionsToUnisonFile,
|
||||||
@ -70,13 +70,14 @@ handleUpgrade oldName newName = do
|
|||||||
let oldPath = Path.Absolute (Path.fromList [NameSegment.libSegment, oldName])
|
let oldPath = Path.Absolute (Path.fromList [NameSegment.libSegment, oldName])
|
||||||
let newPath = Path.Absolute (Path.fromList [NameSegment.libSegment, newName])
|
let newPath = Path.Absolute (Path.fromList [NameSegment.libSegment, newName])
|
||||||
|
|
||||||
currentNamespace <- Cli.getCurrentProjectRoot0
|
currentNamespace <- Cli.getCurrentProjectRoot
|
||||||
let currentNamespaceSansOld = Branch.deleteLibdep oldName currentNamespace
|
let currentNamespaceSansOld = currentNamespace & Branch.step (Branch.deleteLibdep oldName)
|
||||||
let currentDeepTermsSansOld = Branch.deepTerms currentNamespaceSansOld
|
let currentNamespaceSansOld0 = Branch.head currentNamespaceSansOld
|
||||||
let currentDeepTypesSansOld = Branch.deepTypes currentNamespaceSansOld
|
let currentDeepTermsSansOld = Branch.deepTerms currentNamespaceSansOld0
|
||||||
let currentLocalNames = Branch.toNames (Branch.deleteLibdeps currentNamespace)
|
let currentDeepTypesSansOld = Branch.deepTypes currentNamespaceSansOld0
|
||||||
|
let currentLocalNames = Branch.toNames (Branch.deleteLibdeps $ Branch.head currentNamespace)
|
||||||
let currentLocalConstructorNames = forwardCtorNames currentLocalNames
|
let currentLocalConstructorNames = forwardCtorNames currentLocalNames
|
||||||
let currentDeepNamesSansOld = Branch.toNames currentNamespaceSansOld
|
let currentDeepNamesSansOld = Branch.toNames currentNamespaceSansOld0
|
||||||
|
|
||||||
oldNamespace <- Cli.expectBranch0AtPath' (Path.AbsolutePath' oldPath)
|
oldNamespace <- Cli.expectBranch0AtPath' (Path.AbsolutePath' oldPath)
|
||||||
let oldLocalNamespace = Branch.deleteLibdeps oldNamespace
|
let oldLocalNamespace = Branch.deleteLibdeps oldNamespace
|
||||||
@ -158,7 +159,7 @@ handleUpgrade oldName newName = do
|
|||||||
(_temporaryBranchId, temporaryBranchName) <-
|
(_temporaryBranchId, temporaryBranchName) <-
|
||||||
HandleInput.Branch.createBranch
|
HandleInput.Branch.createBranch
|
||||||
textualDescriptionOfUpgrade
|
textualDescriptionOfUpgrade
|
||||||
(CreateFrom'ParentBranch projectBranch)
|
(CreateFrom'NamespaceWithParent projectBranch currentNamespaceSansOld)
|
||||||
project
|
project
|
||||||
getTemporaryBranchName
|
getTemporaryBranchName
|
||||||
scratchFilePath <-
|
scratchFilePath <-
|
||||||
|
@ -93,13 +93,12 @@ proj/main> view thingy
|
|||||||
thingy : Int
|
thingy : Int
|
||||||
thingy =
|
thingy =
|
||||||
use Int +
|
use Int +
|
||||||
new.foo + +10
|
foo + +10
|
||||||
|
|
||||||
proj/main> ls lib
|
proj/main> ls lib
|
||||||
|
|
||||||
1. builtin/ (469 terms, 74 types)
|
1. builtin/ (469 terms, 74 types)
|
||||||
2. new/ (1 term)
|
2. new/ (1 term)
|
||||||
3. old/ (1 term)
|
|
||||||
|
|
||||||
proj/main> branches
|
proj/main> branches
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user