@@ -87,8 +87,6 @@ decideHandOffToProjectOb project = do
8787 -- We don't have ambient's ob source code, so locate its hash from the
8888 -- graph. The last vertex should be it.
8989 ambientHash <- getLast (_migration_graph m)
90− unless (hasVertex ambientHash m) $
91− failWith "Ambient ob's hash is not in its own graph"
9290 return (m, ambientHash)
9391
9492-- | Return the path to the current ('ambient') obelisk process Nix directory
@@ -108,11 +106,11 @@ getObeliskBranch project = readThunk (toImplDir project) >>= \case
108106 Right (ThunkData_Packed tptr) -> case getThunkGitBranch tptr of
109107 Just v -> pure v
110108 Nothing ->
111− failWith "You must specify a git branch to `ob upgrade` as obelisk thunk does not specify any."
109+ failWith "You must run `ob upgrade` with the Git branch specified explicitly, as the project's obelisk thunk does not specify any."
112110
113111updateObelisk :: MonadObelisk m => FilePath -> Text -> m Hash
114112updateObelisk project gitBranch =
115− withSpinner ("Fetching new Obelisk [" <> gitBranch <> "]") $
113+ withSpinner ("Fetching new obelisk [" <> gitBranch <> "]") $
116114 updateThunk (toImplDir project) $ \obImpl -> do
117115 fromHash <- computeVertexHash obImpl
118116 callProcessAndLogOutput (Debug, Debug) $
@@ -123,15 +121,15 @@ updateObelisk project gitBranch =
123121
124122handOffToNewOb :: MonadObelisk m => FilePath -> Hash -> m ()
125123handOffToNewOb project fromHash = do
126− impl <- withSpinner' "Preparing for handoff" (Just $ ("Handed off to new Obelisk " <>) . T.pack) $
124+ impl <- withSpinner' "Preparing for handoff" (Just $ ("Handed off to new obelisk " <>) . T.pack) $
127125 findProjectObeliskCommand project >>= \case
128− Nothing -> failWith "Not an Obelisk project"
126+ Nothing -> failWith "Not an obelisk project"
129127 Just impl -> pure impl
130128 let opts = ["internal", "migrate", T.unpack fromHash]
131129 liftIO $ executeFile impl False ("--no-handoff" : opts) Nothing
132130
133131migrateObelisk :: MonadObelisk m => FilePath -> Hash -> m ()
134−migrateObelisk project fromHash = void $ withSpinner' "Migrating to new Obelisk" (Just id) $ do
132+migrateObelisk project fromHash = void $ withSpinner' "Migrating to new obelisk" (Just id) $ do
135133 updateThunk (toImplDir project) $ \obImpl -> revertObImplOnFail obImpl $ do
136134 toHash <- computeVertexHash obImpl
137135 g <- getMigrationGraph' obImpl MigrationGraph_ObeliskUpgrade >>= \case
@@ -192,18 +190,18 @@ verifyGraph obDir = do
192190 withSpinner "Checking graph integrity" $
193191 ensureGraphIntegrity upgradeGraph
194192 withSpinner "Checking existence of HEAD vertex" $
195− void $ getHeadVertex obDir -- HEAD vertex must be present.
193+ void $ getHeadVertex obDir
196194
195+-- | Create an edge from HEAD vertex to the hash corresponding to the Git
196+-- working copy. The HEAD vertex must already exist.
197197createMigrationEdgeFromHEAD :: MonadObelisk m => FilePath -> m ()
198198createMigrationEdgeFromHEAD obDir = do
199199 headHash <- getHeadVertex obDir
200200 wcHash <- getDirectoryHash migrationIgnore obDir
201201 if (headHash == wcHash)
202202 then
203− putLog Warning "No migration necessary (working copy has not changed from HEAD)"
203+ putLog Warning "No migration necessary (working copy has the same hash as that of HEAD)"
204204 else do
205− -- TODO: Add `ob internal create-migration --backfill=n` do it for all revisions.
206− -- See the failure condition in getHeadVertex
207205 writeEdge (migrationDir obDir) graphNames headHash wcHash >>= \case
208206 Nothing ->
209207 putLog Warning "No migration was created"