clay: don't require head of foreign desks

This commit is contained in:
Philip Monk 2022-05-17 17:06:03 -07:00
parent 9f0e8294db
commit 9548f8333a
4 changed files with 57 additions and 24 deletions

View File

@ -3,11 +3,9 @@
:- %say
|= [[now=@da eny=@uvJ bec=beak] [=ship =desk =path keep=? ~] ~]
:- %helm-pass
=/ =case:clay
?: =(p.bec ship)
da+now
=+ .^([=@ud @da] %cs /(scot %p ship)/[desk]/1/late)
ud+ud
=+ .^(=cone:clay %cx /(scot %p p.bec)//(scot %da now)/domes)
=/ =norm:clay nor:(~(gut by cone) [ship desk] *norm)
=/ =norm:clay
?~ got=(~(get by cone) ship desk)
*norm:clay
nor.u.got
[%c %tomb %norm ship desk (~(put of norm) path keep)]

15
pkg/arvo/gen/norms.hoon Normal file
View File

@ -0,0 +1,15 @@
:: Display tombstone policies
::
=, clay
:- %say
|= [[now=@da eny=@uvJ bec=beak] ~ ~]
:- %tang
=+ .^(=cone %cx /(scot %p p.bec)//(scot %da now)/domes)
%- flop ^- tang
%- zing
%+ turn ~(tap by cone)
|= [[=ship =desk] dome tom=(map tako norm) nor=norm]
:- leaf+"{<ship>}/{<desk>}:"
%+ turn ~(tap of nor)
|= [=path keep=?]
leaf+" {<path>}: {<keep>}"

View File

@ -29,9 +29,9 @@
:: 1. the outer loop `commit-loop` threads down into each commit by ancestor
:: 2. the inner loop `ancestor-loop` threads left-to-right on reverse-ancestors
::
:: +story-read outputs a tang with the least-recent commits at the head
:: +story-read outputs a tang with the least-recent commits at the head
:: of the list, even though we want most-recent commits to print first.
:: But because dojo prints tangs in reverse, we don't flop the results.
:: But because dojo prints tangs in reverse, we don't flop the results.
::::
++ story-read
|= [[our=ship syd=^desk cas=case] this-commit=yaki:clay tale=story]
@ -60,8 +60,8 @@
(msg-from-commit this-commit tale)
::
:: If there is a mergebase and we are visting it right now:
:: stop here and clear the mergebase.
:: skip adding the mergebase's msg itself,
:: stop here and clear the mergebase.
:: skip adding the mergebase's msg itself,
:: because it will be added through the other branch.
:: Otherwise, record the current message if exists and recur.
?: ?&(?=(^ mergebase.state) =(u.mergebase.state r.this-commit))
@ -74,19 +74,19 @@
:: nowline: relative mainline
:: sideline: side-chain, featurebranch
::
:: From the context of e, commit c is on its relative mainline, or nowline,
:: From the context of e, commit c is on its relative mainline, or nowline,
:: while commit d is on its sideline.
::
:: %base a--b-------------X :: mainline
:: %new \--c------e--/ :: nowline
:: %new2 \--d--/ :: sideline
:: %new2 \--d--/ :: sideline
::
::
::
=/ sideline i.reverse-ancestors
=/ mainline i.t.reverse-ancestors
:: XX base-tako ignores beak
::
=/ mergebases
=/ mergebases
.^ (list tako:clay) %cs
(scot %p our) syd (scot cas)
/base-tako/(scot %uv mainline)/(scot %uv sideline)
@ -110,7 +110,7 @@
:: 2 - recur and queue processing on all commits on the sideline
:: 3 - recur and queue processing on all commits on the mainline
::
:: Because mainline messages are cons'd to result last, they are
:: Because mainline messages are cons'd to result last, they are
:: (by definition) towards the less recent side of the flopped list
::
=. state [result=(weld msg result.state) mergebase=next-mergebase] :: 1
@ -122,8 +122,8 @@
:: ~& "in 3+ ancestor commit"
=/ sideline i.reverse-ancestors
=/ nowline i.t.reverse-ancestors
=/ mergebases
.^ (list tako:clay) %cs
=/ mergebases
.^ (list tako:clay) %cs
(scot %p our) syd (scot cas)
/base-tako/(scot %uv nowline)/(scot %uv sideline)
==
@ -151,4 +151,4 @@
(tako-to-text:lib r.commit)
(proses-to-text:lib u.proses)
==
--
--

View File

@ -846,7 +846,7 @@
?: =(%hoon p.page)
:_(nub [%hoon [%atom %t ~] q.page])
?: =(%mime p.page)
:_(nub [%mime =>([..zuse ;;(mime q.page)] !>(-))])
:_(nub [%mime =>([;;(mime q.page) ..zuse] !>(-))])
=^ =dais nub (build-dais p.page)
:_(nub [p.page (vale:dais q.page)])
::
@ -5242,6 +5242,23 @@
::
++ whey
^- (list mass)
?: & :: lac
=/ domestic
%+ turn (sort ~(tap by dos.rom.ruf) aor)
|= [=desk =dojo]
:+ desk %|
:~ mime+&+mim.dom.dojo
flue+&+fod.dom.dojo
dojo+&+dojo
==
:~ :+ %object-store %|
:~ commits+&+hut.ran.ruf
pages+&+lat.ran.ruf
==
domestic+|+domestic
foreign+&+hoy.ruf
ford-cache+&+fad.ruf
==
=/ domestic
%+ turn (sort ~(tap by dos.rom.ruf) aor)
|= [=desk =dojo]
@ -5252,7 +5269,10 @@
==
:~ :+ %object-store %|
:~ commits+&+hut.ran.ruf
pages+&+lat.ran.ruf
:+ %pages %|
%+ turn ~(tap by lat.ran.ruf)
|= [=lobe =page]
[(scot %uv lobe) %& page]
==
domestic+|+domestic
foreign+&+hoy.ruf
@ -5344,7 +5364,7 @@
|- ^- (set [norm yaki])
?~ rooms
~
(~(uni in $(rooms t.rooms)) (draw-dome dom.dojo.i.rooms))
(~(uni in $(rooms t.rooms)) (draw-dome %& dom.dojo.i.rooms))
=/ rung-yakis
=/ rungs=(list [=ship =rung]) ~(tap by hoy.ruf)
|- ^- (set [norm yaki])
@ -5355,11 +5375,11 @@
|- ^- (set [norm yaki])
?~ redes
~
(~(uni in $(redes t.redes)) (draw-dome dom.rede.i.redes))
(~(uni in $(redes t.redes)) (draw-dome %| dom.rede.i.redes))
(~(uni in room-yakis) rung-yakis)
::
++ draw-dome
|= =dome
|= [domestic=? =dome]
^- (set [norm yaki])
=/ =aeon 1
|- ^- (set [norm yaki])
@ -5367,7 +5387,7 @@
~
=/ =tako (~(got by hit.dome) aeon)
=/ yakis=(set [norm yaki])
?. =(let.dome aeon)
?. &(=(let.dome aeon) domestic)
~
[[*norm (~(got by hut.ran.ruf) tako)] ~ ~]
%- ~(uni in yakis)