From 17fa15336f4b59d96413f102572d044fc78dbb0e Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Fri, 10 Apr 2020 20:42:56 -0700 Subject: [PATCH] clay: fix %init for -merge --- pkg/arvo/app/spider.hoon | 2 +- pkg/arvo/lib/clay-commit.hoon | 2 +- pkg/arvo/sys/vane/clay.hoon | 1 - pkg/arvo/ted/commit.hoon | 2 +- pkg/arvo/ted/merge.hoon | 32 +++++++++++++++++++++++--------- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index cac00c660..bb2f434e0 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -388,7 +388,7 @@ ++ thread-fail |= [=yarn =term =tang] ^- (quip card ^state) - %- (slog leaf+"strand {} failed" leaf+ tang) + :: %- (slog leaf+"strand {} failed" leaf+ tang) =/ =tid (yarn-to-tid yarn) =/ fail-cards (thread-say-fail tid term tang) =^ cards state (thread-clean yarn) diff --git a/pkg/arvo/lib/clay-commit.hoon b/pkg/arvo/lib/clay-commit.hoon index 47718c970..7b08c7301 100644 --- a/pkg/arvo/lib/clay-commit.hoon +++ b/pkg/arvo/lib/clay-commit.hoon @@ -58,7 +58,7 @@ :: Produce a mime cache :: ++ checkout-cache - |= [=desk deletes=(set path) changes=(map path cage)] + |= [=ship =desk deletes=(set path) changes=(map path cage)] =/ m (strand ,(map path (unit mime))) ^- form:m ;< our=@p bind:m get-our:strandio diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 8c3b5ba29..eff634e53 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1122,7 +1122,6 @@ :: =/ ford-disc=disc:ford ?: =(p.ali-disc p.bob-disc) - ali-disc bob-disc |^ diff --git a/pkg/arvo/ted/commit.hoon b/pkg/arvo/ted/commit.hoon index 23285e658..5acaeedd1 100644 --- a/pkg/arvo/ted/commit.hoon +++ b/pkg/arvo/ted/commit.hoon @@ -58,7 +58,7 @@ :: =/ =ankh (checkout:clay-commit ank.dome deletes cast-results) ;< mim=(map path (unit mime)) bind:m - (checkout-cache:clay-commit desk deletes cast-results) + (checkout-cache:clay-commit our desk deletes cast-results) :: Send to clay :: =/ args [desk r.new-yaki rang ankh mim] diff --git a/pkg/arvo/ted/merge.hoon b/pkg/arvo/ted/merge.hoon index 97389d9d7..ad303ee8b 100644 --- a/pkg/arvo/ted/merge.hoon +++ b/pkg/arvo/ted/merge.hoon @@ -23,8 +23,11 @@ =/ ali-tako=tako (~(got by hit.ali-dome) let.ali-dome) =+ .^(=ali=yaki %cs (weld start-path /yaki/(scot %uv ali-tako))) =+ .^(=bob=dome %cv start-path) -=/ bob-tako=tako (~(got by hit.bob-dome) let.bob-dome) -=+ .^(=bob=yaki %cs (weld start-path /yaki/(scot %uv bob-tako))) +=/ bob-yaki=(unit yaki) + ?~ let.bob-dome + ~ + =/ bob-tako=tako (~(got by hit.bob-dome) let.bob-dome) + `.^(=bob=yaki %cs (weld start-path /yaki/(scot %uv bob-tako))) :: ;< =merge-result bind:m (merge ali-yaki bob-yaki) ?~ merge-result @@ -34,7 +37,7 @@ ;< [=ankh changes=(map path cage)] bind:m (checkout bob-dome new.u.merge-result [deletes changes]:u.merge-result) ;< mim=(map path (unit mime)) bind:m - (checkout-cache:clay-commit bob-desk deletes.u.merge-result changes) + (checkout-cache:clay-commit ali-ship ali-desk deletes.u.merge-result changes) =/ args [bob-desk r.new.u.merge-result rang ankh mim] ;< ~ bind:m (send-raw-card:strandio %pass /merg/[bob-desk]/[ali-desk] %arvo %c %park args) @@ -50,15 +53,13 @@ lat=(map lobe blob) == ++ merge - |= [=ali=yaki =bob=yaki] - |^ + |= [=ali=yaki bob-yaki=(unit yaki)] =/ m (strand ,merge-result) ^- form:m - ?- germ + ?: ?=(%init germ) :: :: If this is an %init merge, we set the ali's commit to be bob's. :: - %init %: pure:m ~ conflicts=~ @@ -68,6 +69,9 @@ changes=~(key by q.ali-yaki) lat=~ == + =/ bob-yaki (need bob-yaki) + |^ + ?- germ :: :: If this is a %this merge, we check to see if ali's and bob's commits :: are the same, in which case we're done. Otherwise, we check to see @@ -123,7 +127,9 @@ ?: (~(has in (reachable-takos r.bob-yaki)) r.ali-yaki) (pure:m ~) ?. (~(has in (reachable-takos r.ali-yaki)) r.bob-yaki) - (strand-fail:strandio %bad-fine-merge ~) + %^ error %bad-fine-merge + leaf+"tried fast-forward but is not ancestor or descendant" + ~ %: pure:m ~ conflicts=~ @@ -193,7 +199,7 @@ |= [=start=path =lobe] ^- schematic:ford =+ .^(=blob %cs (weld start-path /blob/(scot %uv lobe))) - =/ =disc:ford [our bob-desk] + =/ =disc:ford [ali-ship ali-desk] ?- -.blob %direct (page-to-schematic disc q.blob) %delta [%pact disc $(lobe q.q.blob) (page-to-schematic disc r.blob)] @@ -205,4 +211,12 @@ [%volt disc page] [%$ p.page [%atom %t ~] q.page] -- +:: +++ error + |= [=term =tang] + %: strand-fail:strandio term + leaf+"failed merge from {}/{} to {}/{}" + leaf+"with strategy germ" + tang + == --