diff --git a/arvo/clay.hoon b/arvo/clay.hoon index 12d171386..9ba939333 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -78,7 +78,6 @@ [%dune p=(set beam) q=(unit cage)] :: unit literal [%mute p=silk q=(list (pair wing silk))] :: mutant [%pact p=silk q=silk] :: patch - [%plan p=beam q=spur r=hood] :: structured assembly [%reef ~] :: kernel reef [%ride p=twig q=silk] :: silk thru twig [%vale p=mark q=ship r=*] :: validate [our his] @@ -97,7 +96,7 @@ $: lim=@da :: complete to qyx=cult :: subscribers ref=(unit rind) :: outgoing requests - wok=work :: outstanding diffs + wok=(unit work) :: outstanding diffs dom=dome :: revision state == :: ++ riff ,[p=desk q=(unit rave)] :: request/desist @@ -290,58 +289,61 @@ | :_ yel [hen %note '=' %leaf :(weld (trip p.lem) " " (spud pre))] & |- ^+ yel - ?~ q.q.lem yel - :_ $(q.q.lem t.q.q.lem) + ?~ q.p.lem yel + :_ $(q.p.lem t.q.p.lem) :- hen :+ %note - ?-(-.q.i.q.q.lem %del '-', %ins '+', %mut ':') - [%leaf (spud (weld pre p.i.q.q.lem))] + ?-(-.q.i.q.p.lem %del '-', %ins '+', %mut ':', %dif ';') + [%leaf (spud (weld pre p.i.q.p.lem))] == == :: ++ edit :: apply changes |= [wen=@da lem=nori] ^+ +> - ?. -.lem + ?: ?=(%| -.lem) =+ axe=(~(edit ze lim dom ran) wen lem) =+ `[l=@da d=dome r=rang]`+<.axe - +>.$(dom d, ran r) - ?^ wok + +>.$(dom d, ran r) :: XX checkout-ankh + ?. =(~ wok) ~& %already-applying-changes !! =+ ^- lon=(list path) - (murn q.p.lem |=([a=path b=miso] ?.(?=(%mut -.b) ~ `a))) + (murn q.p.lem |=([a=path b=miso] ?.(?=(%mut -.b) ~ (some a)))) =+ ^- sot=(list ,[p=path q=misu]) - (murn q.p.lem |=([a=path b=miso] ?:(?=(%mut -.b) ~ `[a `misu`b]))) - =. wok `[sot lon] + %+ murn q.p.lem + |=([a=path b=miso] ?:(?=(%mut -.b) ~ (some [a `misu`b]))) + =. wok `[sot lon] ?~ lon - apply-edit + (apply-edit wen) =+ ^- los=(list ,[duct path note]) - (murn q.p.lem |=([a=path b=miso] ?.(?=(%mut -.b) ~ `(silkify a b)))) + %+ murn q.p.lem + |=([a=path b=miso] ?.(?=(%mut -.b) ~ (some (silkify wen a b)))) %_(+>.$ tag (welp los tag)) :: ++ silkify - |= [a=path %mut b=cage c=cage] + |= [wen=@da a=path %mut b=cage c=cage] ^- [duct path note] :+ hen - [%diffing (scot %p who) syd a] + [%diffing (scot %p who) syd (scot %da wen) a] [%f %exec who ~ %diff [%done ~ b] [%done ~ c]] :: ++ apply-edit - ^- . + |= wen=@da + ^+ +> ?~ wok ~& %no-changes !! ?^ lon.u.wok ~& %not-done-diffing !! - =+ axe=(~(edit ze lim dom ran) wen %& *cart wok.wok) + =+ axe=(~(edit ze lim dom ran) wen %& *cart sot.u.wok) =+ `[l=@da d=dome r=rang]`+<.axe - +>(dom d, ran r, wok ~) + +>.$(dom d, ran r, wok ~) :: XX checkout-ankh :: ++ take-diff - |= [pax=path res=(each bead (list tank))] + |= [wen=@da pax=path res=(each bead (list tank))] ^+ +> ?~ wok ~& %clay-unexpected-made !! ?. (lien lon.u.wok |=(path =(+< pax))) ~& %clay-strange-made !! - ?. -.res + ?: ?=(%| -.res) %_ +>.$ wok ~ tag @@ -349,17 +351,17 @@ ^- (list ,[duct path note]) %+ murn lon.u.wok |= a=path - ?: =(pax a) - `[hen [%diffing (scot %p who) syd a] %f %exec who ~] + ?: =(pax a) ~ + `[hen [%diffing (scot %p who) syd (scot %da wen) a] %f %exec who ~] :: yel [[hen %note '!' %rose [" " "" ""] leaf/"clay diff failed" p.res] yel] == - =: lon.wok (skip lon.u.wok |=(path =(+< pax))) - sot.wok [[pax %dif q.p.res] sot.u.wok] + =: lon.u.wok (skip lon.u.wok |=(path =(+< pax))) + sot.u.wok [[pax %dif q.p.res] sot.u.wok] == ?~ lon.wok - apply-edit + (apply-edit wen) +>.$ :: ++ edis :: apply subscription @@ -797,12 +799,13 @@ [[[hen %slip %d %flog +.q.hin] ~] ..^$] :: %made - ?> ?=([%diffing @ @ *] tea) + ?> ?=([%diffing @ @ @ *] tea) =+ who=(slav %p i.t.tea) =+ syd=(slav %tas i.t.t.tea) + =+ wen=(slav %da i.t.t.t.tea) =^ mos ruf =+ ^= zat - (take-diff:(di:wake:une syd) t.t.t.tea p.q.hin) + (take-diff:(di:wake:une syd) t.t.t.t.tea p.q.hin) =+ zot=abet.zat [-.zot abet:(pish:une syd +.zot ran.zat)] [mos ..^$] diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index d4bee3555..9de08ebb0 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -2,6 +2,7 @@ :: zuse (3), standard library (tang) :: ~% %zuse + ~ +!: |% :::::::::::::::::::::::::::::::::::::::::::::::::::::: :: :::: chapter 3b, Arvo libraries :::: @@ -1010,7 +1011,7 @@ ?- -.mis %del [%ins p.mis] %ins [%del p.mis] - %dif [%dif (limp p.mis)] + %dif [%dif p.mis] :: XX incorrect %mut [%mut q.mis p.mis] == :: @@ -1048,28 +1049,6 @@ == :: ++ ze !: - =+ ^= silk - $& [p=silk q=silk] - $% [%bake p=mark q=beam r=path] - [%boil p=mark q=beam r=path] - [%call p=silk q=silk] - [%cast p=mark q=silk] - [%diff p=silk q=silk] - [%done p=(set beam) q=cage] - [%dude p=tank q=silk] - [%dune p=(set beam) q=(unit cage)] - [%mute p=silk q=(list (pair wing silk))] - [%pact p=silk q=silk] - [%plan p=beam q=spur r=hood] - [%reef ~] - [%ride p=twig q=silk] - [%vale p=mark q=ship r=*] - == - =+ ^= silk - $% [%diff p=cage q=cage] - [%pact p=cage q=(list cage)] - == - =| mow=(list silk) |_ [lim=@da dome rang] ++ aeon-to-tako ~(got by hit) ++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki) @@ -1083,72 +1062,57 @@ :: ++ tako-to-yaki ~(got by hut) :: grab yaki ++ lobe-to-blob ~(got by lat) :: grab blob - ++ lobe-to-noun :: grab blob - |= p=lobe :: ^- * - %- blob-to-noun + ++ lobe-to-cage :: grab blob + |= p=lobe :: ^- maybe cage + ^- (each cage ,*) + %- blob-to-cage (lobe-to-blob p) :: ++ make-direct :: make blob - |= [p=* q=umph] + |= [p=cage] ^- blob - [%direct (mug p) p q] + [%direct (mug p) p] :: ++ make-delta :: make blob delta |= [p=lobe q=cage] ^- blob =+ t=[%delta 0 p q] - =+ z=(blob-to-noun t) + =+ z=(blob-to-cage t) =+ ^= has %^ cat 7 (sham [%blob z]) (sham [%lobe z]) [%delta has p q] :: - ++ blob-to-umph :: blob umph [prep] - |= p=blob :: used in merge - ^- umph - ?- -.p - %delta p.r.p - %direct r.p - %indirect p.r.p - == - :: - ++ blob-to-noun :: grab blob - |= p=blob - ?- -.p - %delta (lump r.p (lobe-to-noun q.p)) - %direct q.p - %indirect q.p - == - :: - ++ new-blob-to-cage + ++ blob-to-cage |= p=blob :: ^- (each cage ,[cage this]) ?- -.p %direct [%& q.p] %indirect [%& q.p] - %delta [%| r.p $(p q.p)] + %delta [%| r.p $(p (lobe-to-blob q.p))] == :: :: ++ diff-yakis :: fundamental diff |= [p=yaki q=yaki] ^- (map path miso) - %+ roll (~(tap in (luth q.p q.q)) ~) - |= [pat=path yeb=(map path miso)] - =+ leb=(~(get by q.p) pat) - =+ lob=(~(get by q.q) pat) - ?~ leb (~(put by yeb) pat [%ins (lobe-to-noun (need lob))]) - ?~ lob (~(put by yeb) pat [%del (lobe-to-noun (need leb))]) - ?: =(u.leb u.lob) yeb - =+ veq=(lobe-to-blob u.leb) - =+ voq=(lobe-to-blob u.lob) - %+ ~(put by yeb) pat - :- %dif - ?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff - r.voq - =+ zeq=(blob-to-noun veq) - =+ zoq=(blob-to-noun voq) - ((diff (blob-to-umph (lobe-to-blob u.leb))) zeq zoq) + !! + :: %+ roll (~(tap in (luth q.p q.q)) ~) + :: |= [pat=path yeb=(map path miso)] + :: =+ leb=(~(get by q.p) pat) + :: =+ lob=(~(get by q.q) pat) + :: ?~ leb (~(put by yeb) pat [%ins (lobe-to-cage (need lob))]) + :: ?~ lob (~(put by yeb) pat [%del (lobe-to-cage (need leb))]) + :: ?: =(u.leb u.lob) yeb + :: =+ veq=(lobe-to-blob u.leb) + :: =+ voq=(lobe-to-blob u.lob) + :: %+ ~(put by yeb) pat + :: :- %dif + :: ?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff + :: r.voq + :: =+ zeq=(blob-to-noun veq) + :: =+ zoq=(blob-to-noun voq) + :: ((diff (blob-to-umph (lobe-to-blob u.leb))) zeq zoq) :: ++ lobes-at-path :: lobes-at-path:ze |= [yon=aeon pax=path] :: data at path @@ -1322,13 +1286,13 @@ (~(put by bat) pat (lobe-to-blob gar)) :: use original ^= bar ^- (map path blob) %+ roll lar - |= [[pat=path mys=miso] bar=(map path blob)] + |= [[pat=path mys=misu] bar=(map path blob)] ^+ bar ?- -.mys %ins :: insert if not exist ?: (~(has by bar) pat) !! :: ?: (~(has by hat) pat) !! :: - (~(put by bar) pat (make-direct p.mys %c)) :: TODO content type? + (~(put by bar) pat (make-direct p.mys)) %del :: delete if exists ?. |((~(has by hat) pat) (~(has by bar) pat)) !! (~(del by bar) pat) @@ -1351,8 +1315,9 @@ ^- ankh %- cosh ?~ pat - =+ zar=(lobe-to-noun bar) - ank(q [~ (sham zar) zar]) + =+ zar=(lobe-to-cage bar) + ?> ?=(%& -.zar) + ank(q [~ (sham `cage`p.zar) p.zar]) =+ nak=(~(get by r.ank) i.pat) %= ank r %+ ~(put by r.ank) i.pat @@ -1558,261 +1523,260 @@ == == == - ++ qeal :: merge p,q - |* [us=[ship desk] th=[ship desk] pat=path p=miso q=miso r=(list) con=?] - ^- miso :: in case of conflict - ~| %qeal-fail - ?> ?=(%dif -.p) - ?> ?=(%dif -.q) - ?> ?=(%c -.q.p.p) - ?> ?=(%c -.q.p.q) - =+ s=(clean p.q.p.p) - =+ t=(clean p.q.p.q) - :- %dif - :- %c :: todo is this p.p.p? - :- %c - |- ^- (urge) - ::?~ s ?: (qual t) t - :: ~| %qail-conflict !! - ::?~ t ?: (qual s) s - :: ~| %qail-conflict !! - ?~ s t - ?~ t s - ?- -.i.s - %& - ?- -.i.t - %& - ?: =(p.i.s p.i.t) - [i.s $(s t.s, t t.t, r (slag p.i.s r))] - ?: (gth p.i.s p.i.t) - [i.t $(t t.t, p.i.s (sub p.i.s p.i.t), r (slag p.i.t r))] - [i.s $(s t.s, p.i.t (sub p.i.t p.i.s), r (slag p.i.s r))] - %| - ?: =(p.i.s (lent p.i.t)) - [i.t $(s t.s, t t.t, r (slag p.i.s r))] - ?: (gth p.i.s (lent p.i.t)) - :- i.t - $(t t.t, p.i.s (sub p.i.s (lent p.i.t)), r (slag (lent p.i.t) r)) - ?. con ~| %quil-conflict !! :: conflict - ~& [%quil-conflict-soft pat] - =+ mar=(match-conflict us th s t r) - [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] - == - %| - ?- -.i.t - %| - ?. con ~| %quil-conflict !! - ~& [%quil-conflict-soft pat] - =+ mar=(match-conflict us th s t r) - [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] - %& - ?: =(p.i.t (lent p.i.s)) - [i.s $(s t.s, t t.t, r (slag p.i.t r))] - ?: (gth p.i.t (lent p.i.s)) - :- i.s - $(s t.s, p.i.t (sub p.i.t (lent p.i.s)), r (slag (lent p.i.s) r)) - ?. con ~| %quil-conflict !! - ~& [%quil-conflict-soft pat] - =+ mar=(match-conflict us th s t r) - [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] - == - == - ++ quil :: merge p,q - |= $: us=[ship desk] - th=[ship desk] - pat=path - p=(unit miso) - q=(unit miso) - r=(unit (list)) - con=? - == - ^- (unit miso) - ?~ p q :: trivial - ?~ q p :: trivial - ?- -.u.p - %ins ?> ?=(%ins -.u.q) - ?. con !! - %- some - :- %ins - %- role - %- annotate - :- us - :- th - :- (lore ((hard ,@) p.u.p)) - :- (lore ((hard ,@) p.u.q)) - ~ - %del p - %dif ?> ?=(%dif -.u.q) - %- some - %^ qeal us th - :^ pat u.p u.q :: merge p,q - :- %- need r - con - == - :: - ++ meld :: merge p,q from r - |= [p=yaki q=yaki r=yaki con=? us=[ship desk] th=[ship desk]] - ^- (map path blob) - =+ s=(diff-yakis r p) - =+ t=(diff-yakis r q) - =+ lut=(luth s t) - %- |= res=(map path blob) :: add old - ^- (map path blob) - %- ~(uni by res) - %- mo - %+ turn - %+ skip (~(tap by q.r) ~) :: loop through old - |= [pat=path bar=lobe] ^- ? - (~(has in lut) pat) :: skip updated - |= [pat=path bar=lobe] ^- [path blob] - [pat (lobe-to-blob bar)] :: lookup objects - %+ roll (~(tap in (luth s t)) ~) - |= [pat=path res=(map path blob)] - =+ ^= v - %- need - %^ quil us th - :- pat - :+ (~(get by s) pat) - (~(get by t) pat) - :_ con - %- %- lift lore - %- %- lift %- hard ,@ :: for %c - %- %- lift lobe-to-noun - %- ~(get by q.r) - pat - ?- -.v - %del res :: no longer exists - %ins :: new file - %+ ~(put by res) pat - %+ make-direct p.v %c :: TODO content type? - %dif :: patch from r - %+ ~(put by res) pat - %- make-direct - :_ %c - %+ lump p.v - %- lobe-to-noun - %- ~(got by q.r) pat - == - :: - :: merge types - :: - ++ mate :: merge p,q - |= con=? :: %mate, %meld - |= [p=yaki q=yaki us=[ship desk] th=[ship desk]] - ^- (map path blob) - =+ r=(~(tap in (find-merge-points p q)) ~) - ?~ r - ~|(%mate-no-ancestor !!) - ?: =(1 (lent r)) - (meld p q i.r con us th) - ~|(%mate-criss-cross !!) - :: - ++ keep :: %this - |= [p=yaki q=yaki [ship desk] [ship desk]] - ^- (map path blob) - %+ roll (~(tap by q.p) ~) - |= [[pat=path lob=lobe] zar=(map path blob)] - ^- (map path blob) - (~(put by zar) pat (lobe-to-blob lob)) - :: - ++ drop :: %that - |= [p=yaki q=yaki r=[ship desk] s=[ship desk]] - ^- (map path blob) - (keep q p r s) - :: - ++ forge :: %forge - |= [p=yaki q=yaki s=[ship desk] t=[ship desk]] - ^- (map path blob) - =+ r=(~(tap in (find-merge-points p q)) ~) - ?~ r - ~|(%forge-no-ancestor !!) - %- |= [r=yaki lut=(map lobe blob) hat=(map tako yaki)] - =. lat lut - =. hut hat - (meld p q r & s t) :: fake merge - %+ roll t.r :: fake ancestor - |= [par=yaki [for=_i.r lut=_lat hat=_hut]] - =. lat lut - =+ ^= far - ^- (map path lobe) - %- ~(urn by (forge par for s t)) - |= [k=path v=blob] (blob-to-lobe v) - =+ u=(make-yaki [r.par r.for ~] far `@da`0) :: fake yaki - :- u - :_ (~(put by hat) r.u u) - =< - - %- update-lat - :_ ~ - %- ~(urn by q.u) - |= [path k=lobe] - (lobe-to-blob k) - :: - :: actual merge - :: - ++ merge - |= [us=[ship desk] th=[ship desk]] - |= [p=yaki q=yaki r=@da s=$+([yaki yaki [ship desk] [ship desk]] (map path blob))] - ^- [yaki (map path blob)] - =+ u=(s p q us th) - =+ ^= t - ^- (map path lobe) - %+ roll (~(tap by u) ~) - |= [[pat=path bar=blob] yeb=(map path lobe)] - (~(put by yeb) pat (blob-to-lobe bar)) - :_ u - (make-yaki [r.p r.q ~] t r) - :: - ++ strategy :: merge strategy - |= gem=?(%meld %mate %that %this) - ?- gem - %meld (mate %.y) - %mate (mate %.n) - %this keep - %that drop - == - :: - ++ construct-merge :: construct-merge:ze - |= [gem=germ who=ship des=desk sab=saba now=@da] :: construct merge - ^- (unit (unit mizu)) :::::: - =+ for=s.sab :: foreign dome - =+ mer=(merge [who des] [p.sab q.sab]) - ?- gem - %init :: force fine - ?. =(let 0) :: hell no - !! - =+ hot=(~(put by *(map aeon tako)) 1 (~(got by hit.for) let.for)) - [~ [~ [1 hot hut lat]]] :: trivial - %fine - =+ der=(~(got by hit.for) let.for) - =+ owr=(~(got by hit) let) - ?: =(der owr) - [~ ~] - ?: (~(has in (reachable-takos owr)) der) - [~ ~] - ?. (~(has in (reachable-takos der)) owr) - ~ :: not a fast forward - ~& [%merge-fine p.sab q.sab] - [~ [~ [+(let) (~(put by hit) +(let) der) hut lat]]] - ?(%mate %that %this %meld) - =+ foreign-head=(tako-to-yaki (~(got by hit.for) let.for)) - =+ our-head=(tako-to-yaki (~(got by hit) let)) - ?: =(r.foreign-head r.our-head) - [~ ~] :: up to date - ?: (~(has in (reachable-takos r.our-head)) r.foreign-head) - [~ ~] :: up to date - ?: ?& |(=(gem %mate) =(gem %meld)) - (~(has in (reachable-takos r.foreign-head)) r.our-head) - == - $(gem %fine) :: use fast forward - =+ gar=(mer our-head foreign-head now (strategy gem)) - =+ yak=-.gar - =+ hek=+.gar - =. lat -:(update-lat hek ~) :: add new blobs - =. hut (~(put by *(map tako yaki)) r.yak yak) - =. let +(let) - =. hit (~(put by *(map aeon tako)) let r.yak) - [~ [~ [let hit hut lat]]] - == + :: ++ qeal :: merge p,q + :: |* [us=[ship desk] th=[ship desk] pat=path p=miso q=miso r=(list) con=?] + :: ^- miso :: in case of conflict + :: ~| %qeal-fail + :: ?> ?=(%dif -.p) + :: ?> ?=(%dif -.q) + :: ?> ?=(%c -.q.p.p) + :: ?> ?=(%c -.q.p.q) + :: =+ s=(clean p.q.p.p) + :: =+ t=(clean p.q.p.q) + :: :- %dif + :: :- %c :: todo is this p.p.p? + :: :- %c + :: |- ^- (urge) + :: ::?~ s ?: (qual t) t + :: :: ~| %qail-conflict !! + :: ::?~ t ?: (qual s) s + :: :: ~| %qail-conflict !! + :: ?~ s t + :: ?~ t s + :: ?- -.i.s + :: %& + :: ?- -.i.t + :: %& + :: ?: =(p.i.s p.i.t) + :: [i.s $(s t.s, t t.t, r (slag p.i.s r))] + :: ?: (gth p.i.s p.i.t) + :: [i.t $(t t.t, p.i.s (sub p.i.s p.i.t), r (slag p.i.t r))] + :: [i.s $(s t.s, p.i.t (sub p.i.t p.i.s), r (slag p.i.s r))] + :: %| + :: ?: =(p.i.s (lent p.i.t)) + :: [i.t $(s t.s, t t.t, r (slag p.i.s r))] + :: ?: (gth p.i.s (lent p.i.t)) + :: :- i.t + :: $(t t.t, p.i.s (sub p.i.s (lent p.i.t)), r (slag (lent p.i.t) r)) + :: ?. con ~| %quil-conflict !! :: conflict + :: ~& [%quil-conflict-soft pat] + :: =+ mar=(match-conflict us th s t r) + :: [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] + :: == + :: %| + :: ?- -.i.t + :: %| + :: ?. con ~| %quil-conflict !! + :: ~& [%quil-conflict-soft pat] + :: =+ mar=(match-conflict us th s t r) + :: [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] + :: %& + :: ?: =(p.i.t (lent p.i.s)) + :: [i.s $(s t.s, t t.t, r (slag p.i.t r))] + :: ?: (gth p.i.t (lent p.i.s)) + :: :- i.s + :: $(s t.s, p.i.t (sub p.i.t (lent p.i.s)), r (slag (lent p.i.s) r)) + :: ?. con ~| %quil-conflict !! + :: ~& [%quil-conflict-soft pat] + :: =+ mar=(match-conflict us th s t r) + :: [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] + :: == + :: == + :: ++ quil :: merge p,q + :: |= $: us=[ship desk] + :: th=[ship desk] + :: pat=path + :: p=(unit miso) + :: q=(unit miso) + :: r=(unit (list)) + :: con=? + :: == + :: ^- (unit miso) + :: ?~ p q :: trivial + :: ?~ q p :: trivial + :: ?- -.u.p + :: %ins ?> ?=(%ins -.u.q) + :: ?. con !! + :: %- some + :: :- %ins + :: %- role + :: %- annotate + :: :- us + :: :- th + :: :- (lore ((hard ,@) p.u.p)) + :: :- (lore ((hard ,@) p.u.q)) + :: ~ + :: %del p + :: %dif ?> ?=(%dif -.u.q) + :: %- some + :: %^ qeal us th + :: :^ pat u.p u.q :: merge p,q + :: :- %- need r + :: con + :: == + :: :: + :: ++ meld :: merge p,q from r + :: |= [p=yaki q=yaki r=yaki con=? us=[ship desk] th=[ship desk]] + :: ^- (map path blob) + :: =+ s=(diff-yakis r p) + :: =+ t=(diff-yakis r q) + :: =+ lut=(luth s t) + :: %- |= res=(map path blob) :: add old + :: ^- (map path blob) + :: %- ~(uni by res) + :: %- mo + :: %+ turn + :: %+ skip (~(tap by q.r) ~) :: loop through old + :: |= [pat=path bar=lobe] ^- ? + :: (~(has in lut) pat) :: skip updated + :: |= [pat=path bar=lobe] ^- [path blob] + :: [pat (lobe-to-blob bar)] :: lookup objects + :: %+ roll (~(tap in (luth s t)) ~) + :: |= [pat=path res=(map path blob)] + :: =+ ^= v + :: %- need + :: %^ quil us th + :: :- pat + :: :+ (~(get by s) pat) + :: (~(get by t) pat) + :: :_ con + :: %- %- lift lore + :: %- %- lift %- hard ,@ :: for %c + :: %- %- lift lobe-to-cage + :: %- ~(get by q.r) + :: pat + :: ?- -.v + :: %del res :: no longer exists + :: %ins :: new file + :: %+ ~(put by res) pat + :: (make-direct p.v) + :: %dif :: patch from r + :: %+ ~(put by res) pat + :: %- make-direct + :: %+ lump p.v + :: %- lobe-to-cage + :: %- ~(got by q.r) pat + :: == + :: :: + :: :: merge types + :: :: + :: ++ mate :: merge p,q + :: |= con=? :: %mate, %meld + :: |= [p=yaki q=yaki us=[ship desk] th=[ship desk]] + :: ^- (map path blob) + :: =+ r=(~(tap in (find-merge-points p q)) ~) + :: ?~ r + :: ~|(%mate-no-ancestor !!) + :: ?: =(1 (lent r)) + :: (meld p q i.r con us th) + :: ~|(%mate-criss-cross !!) + :: :: + :: ++ keep :: %this + :: |= [p=yaki q=yaki [ship desk] [ship desk]] + :: ^- (map path blob) + :: %+ roll (~(tap by q.p) ~) + :: |= [[pat=path lob=lobe] zar=(map path blob)] + :: ^- (map path blob) + :: (~(put by zar) pat (lobe-to-blob lob)) + :: :: + :: ++ drop :: %that + :: |= [p=yaki q=yaki r=[ship desk] s=[ship desk]] + :: ^- (map path blob) + :: (keep q p r s) + :: :: + :: ++ forge :: %forge + :: |= [p=yaki q=yaki s=[ship desk] t=[ship desk]] + :: ^- (map path blob) + :: =+ r=(~(tap in (find-merge-points p q)) ~) + :: ?~ r + :: ~|(%forge-no-ancestor !!) + :: %- |= [r=yaki lut=(map lobe blob) hat=(map tako yaki)] + :: =. lat lut + :: =. hut hat + :: (meld p q r & s t) :: fake merge + :: %+ roll t.r :: fake ancestor + :: |= [par=yaki [for=_i.r lut=_lat hat=_hut]] + :: =. lat lut + :: =+ ^= far + :: ^- (map path lobe) + :: %- ~(urn by (forge par for s t)) + :: |= [k=path v=blob] (blob-to-lobe v) + :: =+ u=(make-yaki [r.par r.for ~] far `@da`0) :: fake yaki + :: :- u + :: :_ (~(put by hat) r.u u) + :: =< - + :: %- update-lat + :: :_ ~ + :: %- ~(urn by q.u) + :: |= [path k=lobe] + :: (lobe-to-blob k) + :: :: + :: :: actual merge + :: :: + :: ++ merge + :: |= [us=[ship desk] th=[ship desk]] + :: |= [p=yaki q=yaki r=@da s=$+([yaki yaki [ship desk] [ship desk]] (map path blob))] + :: ^- [yaki (map path blob)] + :: =+ u=(s p q us th) + :: =+ ^= t + :: ^- (map path lobe) + :: %+ roll (~(tap by u) ~) + :: |= [[pat=path bar=blob] yeb=(map path lobe)] + :: (~(put by yeb) pat (blob-to-lobe bar)) + :: :_ u + :: (make-yaki [r.p r.q ~] t r) + :: :: + :: ++ strategy :: merge strategy + :: |= gem=?(%meld %mate %that %this) + :: ?- gem + :: %meld (mate %.y) + :: %mate (mate %.n) + :: %this keep + :: %that drop + :: == + :: :: + :: ++ construct-merge :: construct-merge:ze + :: |= [gem=germ who=ship des=desk sab=saba now=@da] :: construct merge + :: ^- (unit (unit mizu)) :::::: + :: =+ for=s.sab :: foreign dome + :: =+ mer=(merge [who des] [p.sab q.sab]) + :: ?- gem + :: %init :: force fine + :: ?. =(let 0) :: hell no + :: !! + :: =+ hot=(~(put by *(map aeon tako)) 1 (~(got by hit.for) let.for)) + :: [~ [~ [1 hot hut lat]]] :: trivial + :: %fine + :: =+ der=(~(got by hit.for) let.for) + :: =+ owr=(~(got by hit) let) + :: ?: =(der owr) + :: [~ ~] + :: ?: (~(has in (reachable-takos owr)) der) + :: [~ ~] + :: ?. (~(has in (reachable-takos der)) owr) + :: ~ :: not a fast forward + :: ~& [%merge-fine p.sab q.sab] + :: [~ [~ [+(let) (~(put by hit) +(let) der) hut lat]]] + :: ?(%mate %that %this %meld) + :: =+ foreign-head=(tako-to-yaki (~(got by hit.for) let.for)) + :: =+ our-head=(tako-to-yaki (~(got by hit) let)) + :: ?: =(r.foreign-head r.our-head) + :: [~ ~] :: up to date + :: ?: (~(has in (reachable-takos r.our-head)) r.foreign-head) + :: [~ ~] :: up to date + :: ?: ?& |(=(gem %mate) =(gem %meld)) + :: (~(has in (reachable-takos r.foreign-head)) r.our-head) + :: == + :: $(gem %fine) :: use fast forward + :: =+ gar=(mer our-head foreign-head now (strategy gem)) + :: =+ yak=-.gar + :: =+ hek=+.gar + :: =. lat -:(update-lat hek ~) :: add new blobs + :: =. hut (~(put by *(map tako yaki)) r.yak yak) + :: =. let +(let) + :: =. hit (~(put by *(map aeon tako)) let r.yak) + :: [~ [~ [let hit hut lat]]] + :: == :: ++ read :: read:ze |= mun=mood :: read at point @@ -1848,7 +1812,7 @@ |= [pat=path lob=lobe] =+ zat=(~(get by q) pat) ?~ zat %.n - =((lobe-to-noun u.zat) (lobe-to-noun lob)) + =((lobe-to-cage u.zat) (lobe-to-cage lob)) :: ++ edit :: edit:ze |= [wen=@da lem=nuri] :: edit @@ -1868,7 +1832,8 @@ hit (~(put by hit) +(let) r.yak) hut (~(put by hut) r.yak yak) == - +>.$(ank (checkout-ankh q.yak)) + +>.$ + :: +>.$(ank (checkout-ankh q.yak)) | +>.$(lab ?<((~(has by lab) p.lem) (~(put by lab) p.lem let))) == -- @@ -1954,60 +1919,58 @@ =. +.^$ rm-r:(descend p.i.dyr) $(dyr t.dyr) :: - ++ drum :: apply effect - |= [pax=path mis=miso] :: XX unused (++dune) - ^+ +> - ?^ pax - update-hash:(ascend:$(pax t.pax, +> (descend i.pax)) i.pax ank) - ~| %clay-fail - ?- -.mis - %del - ?> &(?=(^ q.ank) =(q.u.q.ank p.mis)) - +>.$(p.ank (mix p.u.q.ank p.ank), q.ank ~) - :: - %ins - ?> ?=(~ q.ank) - =+ sam=(sham p.mis) - +>.$(p.ank (mix sam p.ank), q.ank [~ sam p.mis]) - :: - %dif - ?> ?=(^ q.ank) - =+ nex=(lump p.mis q.u.q.ank) - =+ sam=(sham nex) - +>.$(p.ank :(mix sam p.u.q.ank p.ank), q.ank [~ sam nex]) - == - :: - ++ dune :: apply - |- ^+ + :: XX unused (++durn) - ?~ myz + - => .(+ (drum p.i.myz q.i.myz)) - $(myz ?>(?=(^ myz) t.myz)) - :: - ++ durn :: apply forward - |= nyp=soba :: XX unused - ^+ +> - ?: =([0 0] p.nyp) - dune(myz q.nyp) - => ?: =(p.ank p.p.nyp) . - ~& [%durn-in-wrong p.ank p.p.nyp] - . - =. +> dune(myz q.nyp) - => ?: =(p.ank q.p.nyp) . - ~& [%durn-out-wrong p.ank q.p.nyp] - . - +> + ::++ drum :: apply effect + :: |= [pax=path mis=miso] :: XX unused (++dune) + :: ^+ +> + :: ?^ pax + :: update-hash:(ascend:$(pax t.pax, +> (descend i.pax)) i.pax ank) + :: ~| %clay-fail + :: ?- -.mis + :: %del + :: ?> &(?=(^ q.ank) =(q.u.q.ank p.mis)) + :: +>.$(p.ank (mix p.u.q.ank p.ank), q.ank ~) + :: :: + :: %ins + :: ?> ?=(~ q.ank) + :: =+ sam=(sham p.mis) + :: +>.$(p.ank (mix sam p.ank), q.ank [~ sam p.mis]) + :: :: + :: %dif + :: ?> ?=(^ q.ank) + :: =+ nex=(lump p.mis q.u.q.ank) + :: =+ sam=(sham nex) + :: +>.$(p.ank :(mix sam p.u.q.ank p.ank), q.ank [~ sam nex]) + :: == + :::: + ::++ dune :: apply + :: |- ^+ + :: XX unused (++durn) + :: ?~ myz + + :: => .(+ (drum p.i.myz q.i.myz)) + :: $(myz ?>(?=(^ myz) t.myz)) + :::: + ::++ durn :: apply forward + :: |= nyp=soba :: XX unused + :: ^+ +> + :: ?: =([0 0] p.nyp) + :: dune(myz q.nyp) + :: => ?: =(p.ank p.p.nyp) . + :: ~& [%durn-in-wrong p.ank p.p.nyp] + :: . + :: =. +> dune(myz q.nyp) + :: => ?: =(p.ank q.p.nyp) . + :: ~& [%durn-out-wrong p.ank q.p.nyp] + :: . + :: +> -- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 3bF, filesystem interface :: :: ++ feel :: simple file write - |= [pax=path val=*] + |= [pax=path val=cage] ^- miso =+ dir=((hard arch) .^(%cy pax)) ?~ q.dir [%ins val] - :- %dif - ^- udon - [%a %a .^(%cx pax) val] + [%mut ((hard cage) .^(%cx pax)) val] :: ++ file :: simple file load |= pax=path @@ -2016,7 +1979,7 @@ ?~(q.dir ~ [~ .^(%cx pax)]) :: ++ foal :: high-level write - |= [pax=path val=*] + |= [pax=path val=cage] ^- toro ?> ?=([* * * *] pax) [i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]] @@ -2025,7 +1988,7 @@ |= pax=path ^- toro ?> ?=([* * * *] pax) - [i.t.pax [%& [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]] + [i.t.pax [%& [*cart [[t.t.t.pax [%del %$ !>(.^(%cx pax))]] ~]]]] :: ++ furl :: unify changes |= [one=toro two=toro] @@ -2034,7 +1997,7 @@ ?> ?& =(p.one p.two) :: same path &(?=(& -.q.one) ?=(& -.q.two)) :: both deltas == - [p.one [%& [*cart (weld q.q.q.one q.q.q.two)]]] + [p.one [%& [*cart (weld q.p.q.one q.p.q.two)]]] :: ++ meat :: kite to .^ path |= kit=kite @@ -2756,6 +2719,9 @@ [%direct p=lobe q=cage] :: [%indirect p=lobe q=cage r=cage s=lobe] :: == :: +++ blub $% [%direct p=lobe q=cage] :: + [%indirect p=lobe q=cage r=cage s=lobe] :: + == :: ++ boat ,[(list slip) tart] :: user stage ++ boon :: fort output $% [%beer p=ship q=@uvG] :: gained ownership