Subject: Objects

Keywords: ::implementation
          ::history
          ::version

Title: version history merge

--------------------------------------------------

Export causes advance, advance is tagged with `export`

Not every advance is caused by export.
 so need to find list of VHs which indicate mod since export.
 finding foreign VH in object chain indicates import (which is mod)
 if prior export in lib then enough to consider only current.

If syncing libs, exports are loaded in order and none are skipped
when exporting, export inlined VH chain to last known major orminor export
 major minor intertwine in an objects chain
when importing, use top VH from import as VH when overwriting. 
  tag VH as import, add tok parm to version history op 
  if no change detected should overwrite anyways to update VH chain
majors are included in incremental chain, distinquished by `major` parm 
on version_info term

overwrite?
 overwrite if local is ancestor of remote.
 previous export, must have been imported by other 
 previous import, must have been exported by any

overwrite inherit foreigh VH
merge chain current VH after foreign VH
  two puts 
    one put of raw import which saves import data and pushes cur data
      onto stack with foreigh VH
    second to save merged data which pushes imported data onto stack with current VH    
noop if top VH of import is same as top of local

major VHs are chained in objects.
minor VHs are chained in object.

Demonstrate sending of VH chain in export
LibA:
Initial    VHa1    D1,[(VH0,D0)] 
Modify     VHa1    D2,[(VH1,D1);[(VH0,D0)]
Export     D2,VHa1,[VH0]
           VHa2{x} D2,[(VHa1,D1);[(VH0,D0)]

LibB:
Initial    VHb1    D1,[(VH0,D0)] 
Import     VHb1    D2,[(VHa{i},D1);[(VH0,D0)]

LibA:
Modify     VHa2{x} D3,[(VHa2{x},D2);(VHa1,D1);[(VH0,D0)]
Advance    VHa3    D3,[(VHa2{x},D2);(VHa1,D1);[(VH0,D0)] 
Modify     VHa3    D4,[(VHa3,D3);(VHa2{x},D2);(VHa1,D1);[(VH0,D0)]
Export     D4,VHa3,[VHa2{x};VHa1]
           VHb4{x} D4,[(VHa3,D3);(VHa2{x},D2);(VHa1,D1);[(VH0,D0)]

LibB:
Import     VHb1    D4,[(VHa3{i},D2);(VHa{i},D1);[(VH0,D0)]

LibA:
Modify     VHa4{x} D5,[(VHa4{x},D4),(VHa3,D3);(VHa2{x},D2);(VHa1,D1);[(VH0,D0)]
Modify     VHa4{x} D6,[(VHa4{x},D4),(VHa3,D3);(VHa2{x},D2);(VHa1,D1);[(VH0,D0)]
Advance    VH5     D6,[(VHa4{x},D4),(VHa3,D3);(VHa2{x},D2);(VHa1,D1);[(VH0,D0)] 
Export     D6,VHa4{x},[VHa3]
           VHa6{x} D6,[(VHa4{x},D4),(VHa3,D3);(VHa2{x},D2);(VHa1,D1);[(VH0,D0)]

Demonstrate Merge
LibB:
Import     VHb1    D6,[(VHa4{i},D4);(VHa3{i},D2);(VHa1{i},D1);[(VH0,D0)]
Modify     VHb1    D7,[(VHb1,D6);(VHa4{i},D4);(VHa3{i},D2);(VHa1{i},D1);[(VH0,D0)]
Export     D7,     [(VHb1;VHa4{i}]
           VHb2{x} D7,[(VHb1,D6);(VHa4{i},D4);(VHa3{i},D2);(VHa1{i},D1);[(VH0,D0)] 

LibA:
Modify     VHa6{x} D8,[(D6,VHa6{x});(VHa4{x},D4); ...
Import     VHa6{x} TMP: D7,[(D8,VHb1{i});(D6,VHa6{x});(VHa4{x},D4); ...
Ignore   VHa6{x} D8,[(D6,VHa6{x});(VHa4{x},D4); ...
Ovewrite VHa6{x} D7,[(D8,VHb1{i});(D6,VHa6{x});(VHa4{x},D4); ...
Merge    VHa6{x} D9,[(D7,VHa6{x}); (D8,VHb1{i}; (VHa4{x},D4); ...⌜[term]⌝
   note that two entries added to VH chain
   important that foreign VH, eg VHb1 come later


Find previous export VH in object chain, then send  as prev VH

--------------------------------------------------

Authors: RICH:t

Contributors: NUPRL:t



Home