Merge and minor merge changes

This commit is contained in:
Gavin Whelan 2014-05-30 15:59:58 -07:00
commit 6177ebbb26
4 changed files with 64 additions and 47 deletions

View File

@ -130,6 +130,7 @@
== ::
++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
,[p=a q=b r=c s=d] ::
::
++ rege $| ?(%dote %ende %sart %empt %boun %bout) :: parsed regex
$% [%lite p=char] :: literal
[%pair p=rege q=rege] :: ordering
@ -5449,24 +5450,26 @@
~(duck ut typ)
::
++ spat |=(pax=path (rap 3 (spud pax)))
++ spec
++ spuc
|= vax=vase
^- vase
=. vax
%+ slap vax
:+ %wtgr
[%wtts [%axil ?^(q.vax %cell [%atom %$])] [%$ 1]~]
[%$ 1]
?@ q.vax vax
%+ slap vax
:+ %wtgr
[%wtts ?^(-.q.vax [%axil %cell] [%leaf %$ -.q.vax]) [%$ 2]~]
[%$ 1]
:_ q.vax
~& %spec-in
=- ~& %spec-out
foo
^= foo ^- type
?@ q.vax (~(fuse ut p.vax) [%atom %$])
?@ -.q.vax (~(fuse ut p.vax) [%cell [%cube -.q.vax [%atom %$]] %noun])
(~(fuse ut p.vax) [%cell %noun %noun])
::
++ spec
|= vax=vase
vax
::
++ spud |=(pax=path ~(ram re (dish:ut [~ %path] pax)))
++ slot
|= [axe=@ vax=vase] ^- vase
(slap vax [~ axe])
[(~(peek ut p.vax) %free axe) .*(q.vax [0 axe])]
::
++ slum
|= [vax=vase wad=(map term vase)] ^- vase
@ -9137,39 +9140,28 @@
=| haz=@uw :: hash
=< |%
++ come |= [@ (list ovum) pone] :: 11
^- [(list ovum) _+>]
~& %hoon-come
=^ rey +>+ (^come +<)
[rey +>.$]
!!
++ keep |=(* (^keep ((hard ,[@da path]) +<))) :: 4
++ load |= [@ (list ovum) pane] :: 86
^- [(list ovum) _+>]
~& %hoon-load
=^ rey +>+ (^load +<)
[rey +>.$]
!!
++ peek |=(* (^peek ((hard ,[@da path]) +<))) :: 87
++ poke |= * :: 42
^- [(list ovum) *]
=> .(+< ((hard ,[now=@da ovo=ovum]) +<))
?: ?=(%veer -.q.ovo)
[~ +>.$(+ (veer +.q.ovo))]
[~ +>.$(+ (veer now q.ovo))]
=^ ova +>+ (^poke now ovo)
|- ^- [(list ovum) *]
?~ ova
[~ +>.^$]
?: ?=(%veer -.q.i.ova)
$(ova t.ova, +>+.^$ (veer +.q.i.ova))
$(ova t.ova, +>+.^$ (veer now q.i.ova))
?: ?=(%vega -.q.i.ova)
(vega now t.ova (path +.q.i.ova))
=+(avo=$(ova t.ova) [[i.ova -.avo] +.avo])
++ wish |=(* (^wish ((hard ,@ta) +<))) :: 20
--
|%
++ come :: load incompatible
|= [yen=@ ova=(list ovum) nyf=pone]
^+ [ova +>]
(load yen ova (turn nyf |=([a=@tas b=vise] [a (slim b)])))
::
++ keep :: wakeup delay
|= [now=@da hap=path]
=> .(+< ((hard ,[now=@da hap=path]) +<))
@ -9185,7 +9177,7 @@
?~ ova
[~ +>.^$]
?: ?=(%veer -.q.i.ova)
$(ova t.ova, +>.^$ (veer +.q.i.ova))
$(ova t.ova, +>.^$ (veer _@da q.i.ova))
=+(avo=$(ova t.ova) [[i.ova -.avo] +.avo])
::
++ peek :: external inspect
@ -9227,27 +9219,27 @@
[[[~ %vega hap] ((list ovum) -.raw)] +.raw]
::
++ veer :: install vane/tang
|= *
=> .(+< ((hard ,[lal=@ta pax=path txt=@t]) +<))
?: =(%$ lal)
~& [%tang pax `@p`(mug txt)]
=+ gen=(rain pax txt)
|= [now=@da fav=curd]
=> .(fav ((hard ,[%veer lal=@ta pax=path txt=@t]) fav))
?: =(%$ lal.fav)
~& [%tang pax.fav `@p`(mug txt.fav)]
=+ gen=(rain pax.fav txt.fav)
=+ vax=(slap pit gen)
+>.$(bud vax)
%_ +>
fan
|- ^+ fan
?~ fan
~& [%vane `@tas`lal pax `@p`(mug txt)]
[[lal ves:(vint vil bud pax txt)] fan]
?. =(lal p.i.fan)
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
[[lal.fav ves:(vint vil bud pax.fav txt.fav)] fan]
?. =(lal.fav p.i.fan)
[i.fan $(fan t.fan)]
~& [%vane `@tas`lal pax `@p`(mug txt)]
[[p.i.fan ves:(ruck:(vent vil bud q.i.fan) pax txt)] t.fan]
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
[[p.i.fan ves:(ruck:(vent vil bud q.i.fan) pax.fav txt.fav)] t.fan]
==
::
++ wish :: external compute
|= txt=@
|= txt=@
q:(slap bud (ream txt))
--
. ==

View File

@ -722,6 +722,17 @@
^- soba
[[p.ank p.bus] (flop myz:(dist:(zu ank) %c bus))]
::
++ clen
|= [shp=ship des=desk]
|= a=nori
^- ?
?- -.a
| |
&
?~ p.a |
&(=(p.u.p.a shp) =(q.u.p.a des))
==
::
++ ze !:
|_ [lim=@da dome]
++ aeon :: aeon:ze
@ -985,8 +996,8 @@
=+ alt=(alto (awba wak) (alda tak) (alda kat))
[(awoe -.alt) (alot +.alt)]
::
++ auld :: auld:ze
|= [wen=@da gem=germ sab=saba] :: construct merge
++ auld :: auld:ez
|= [gem=germ sab=saba] :: construct merge
^- (unit (unit nori)) ::::::
=+ ^= viq ^- [p=@ud q=@ud r=waks] :: merge status
=+ viq=(~(get by ang) [p.sab q.sab]) ::
@ -998,6 +1009,7 @@
p.r q.viq ::
s (slag (sub q.viq p.r.sab) s.sab) :: remove excess
== ::
=. sab sab(s (skip s.sab (clen p.sab q.sab))) ::
?~ s.sab [~ ~] :: up to date
=+ ^= mus ^- masu :: sync square
[p.sab q.sab [p.viq +(let)] [q.viq q.r.sab] r.viq]

View File

@ -18,9 +18,10 @@
=+ der=((hard dome) .^(%cv /(scot %p bos)/[des]/[wen]))
=+ owr=((hard dome) .^(%cv /(scot %p who)/[des]/[wen]))
=+ sab=`saba`[bos des [0 let.der] (flop (turn hit.der |=(a=frog q.a)))]
=+ lum=(~(auld ze est owr) est ?~(gem %fine -.gem) sab)
=+ lum=(~(auld ze est owr) ?~(gem %fine -.gem) sab)
?~ lum
`gift`[%la %leaf "{(trip des)} failed to merge, please rerun with a merge option"]
^- gift
[%la %leaf "{(trip des)} failed to merge, please rerun with a merge option"]
?~ u.lum
`gift`[%la %leaf "{(trip des)} is up to date"]
`gift`[%ok des u.u.lum]

View File

@ -1,19 +1,31 @@
!:
:: /=try=/bin/merge/hoon
:: Call with two desks and an optional germ as a merge option
::
=> .(-< `who=@p`-<)
|= [est=time eny=@uw]
|= [pes=[ses=span des=span cas=span ~] pen=[sen=span den=span can=span ~] gem=$|([germ ~] ~)]
|= $: pes=[ses=span des=span cas=span ~]
pen=[sen=span den=span can=span ~]
gem=$|([germ ~] ~)
==
^- bowl
:_ ~
^- (list gift)
:_ ~
=+ vsr=((hard dome) .^(%cv pes))
=+ ves=((hard dome) .^(%cv pen))
=+ sab=`saba`[who den.pen [0 let.vsr] (flop (turn hit.vsr |=(a=frog q.a)))]
=+ lum=(~(auld ze est ves) est ?~(gem %fine -.gem) sab)
=+ ^= sab ^- saba :*
(need (slaw 'p' sen.pen))
den.pen
[0 let.vsr]
(flop (turn hit.vsr |=(a=frog q.a)))
==
=+ lum=(~(auld ze est ves) ?~(gem %fine -.gem) sab)
?~ lum
`gift`[%la %leaf "{(trip des.pes)} failed to merge, please rerun with a merge option"]
^- gift
:* %la %leaf
"{(trip des.pes)} failed to merge, please rerun with a merge option"
==
?~ u.lum
`gift`[%la %leaf "{(trip den.pen)} is up to date"]
`gift`[%ok den.pen u.u.lum]