clay: fix %init for -merge

This commit is contained in:
Philip Monk 2020-04-10 20:42:56 -07:00
parent d70431a6b0
commit 17fa15336f
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
5 changed files with 26 additions and 13 deletions

View File

@ -388,7 +388,7 @@
++ thread-fail
|= [=yarn =term =tang]
^- (quip card ^state)
%- (slog leaf+"strand {<yarn>} failed" leaf+<term> tang)
:: %- (slog leaf+"strand {<yarn>} failed" leaf+<term> tang)
=/ =tid (yarn-to-tid yarn)
=/ fail-cards (thread-say-fail tid term tang)
=^ cards state (thread-clean yarn)

View File

@ -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

View File

@ -1122,7 +1122,6 @@
::
=/ ford-disc=disc:ford
?: =(p.ali-disc p.bob-disc)
ali-disc
bob-disc
|^

View File

@ -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]

View File

@ -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 {<ali-ship>}/{<ali-desk>} to {<our>}/{<bob-desk>}"
leaf+"with strategy germ"
tang
==
--