@@ -7,12 +7,15 @@ open Commitd_client
77
88module VT = Vytree
99module CT = Config_tree
10- module CD = Config_diff
1110module RT = Reference_tree
1211module TA = Tree_alg
13- module CM = Commit
14- module VC = Vycall_client
1512module CDict = Config_dict
13+ module D = Diff
14+ module DT = Diff_tree
15+ module DC = Diff_compare
16+ module DS = Diff_show
17+ module UN = Union
18+ module M = Mask
1619
1720module I = Internal. Make (Config_tree )
1821module IR = Internal. Make (Reference_tree )
@@ -416,57 +419,68 @@ let copy_node c_ptr old_path new_path =
416419 | Vytree. Insert_error s -> error_message := s; 1
417420
418421let diff_tree path c_ptr_l c_ptr_r =
419- (* alert exn CD .diff_tree:
420- [Config_diff .Incommensurable] caught
421- [Config_diff .Empty_comparison] caught
422+ (* alert exn DT .diff_tree:
423+ [Diff .Incommensurable] caught
424+ [Diff .Empty_comparison] caught
422425 *)
423426 let path = split_on_whitespace path in
424427 let ct_l = Root. get c_ptr_l in
425428 let ct_r = Root. get c_ptr_r in
426429 try
427- let ct_ret = (CD . diff_tree[@ alert " -exn" ]) path ct_l ct_r in
430+ let ct_ret = (DT . diff_tree[@ alert " -exn" ]) path ct_l ct_r in
428431 Ctypes.Root. create ct_ret
429432 with
430- | CD .Incommensurable -> error_message := " Incommensurable" ; Ctypes. null
431- | CD .Empty_comparison -> error_message := " Empty comparison" ; Ctypes. null
433+ | D .Incommensurable -> error_message := " Incommensurable" ; Ctypes. null
434+ | D .Empty_comparison -> error_message := " Empty comparison" ; Ctypes. null
432435
433436let diff_compare cmds path c_ptr_l c_ptr_r =
434- (* alert exn CD.show_diff :
435- [Config_diff .Incommensurable] caught
436- [Config_diff .Empty_comparison] caught
437+ (* alert exn DC.diff_compare :
438+ [Diff .Incommensurable] caught
439+ [Diff .Empty_comparison] caught
437440 *)
438441 let path = split_on_whitespace path in
439442 let ct_l = Root. get c_ptr_l in
440443 let ct_r = Root. get c_ptr_r in
441444 try
442- (CD . diff_compare[@ alert " -exn" ]) ~cmds: cmds path ct_l ct_r
445+ (DC . diff_compare[@ alert " -exn" ]) ~cmds: cmds path ct_l ct_r
443446 with
444- | CD. Incommensurable -> error_message := " Incommensurable" ; " #1@"
445- | CD. Empty_comparison -> error_message := " Empty comparison" ; " #1@"
447+ | D. Incommensurable -> error_message := " Incommensurable" ; " #1@"
448+ | D. Empty_comparison -> error_message := " Empty comparison" ; " #1@"
449+
450+ let diff_show r_ptr c_ptr_l c_ptr_r path =
451+ let path = split_on_whitespace path in
452+ let rt = Root. get r_ptr in
453+ let ct_l = Root. get c_ptr_l in
454+ let ct_r = Root. get c_ptr_r in
455+ try
456+ (DS. diff_show[@ alert " -exn" ]) rt path ct_l ct_r
457+ with
458+ | D. Incommensurable -> error_message := " Incommensurable" ; " #1@"
459+ | D. Empty_comparison -> error_message := " Empty comparison" ; " #1@"
446460
447461let tree_union c_ptr_l c_ptr_r =
448- (* alert exn CD .tree_union:
462+ (* alert exn UN .tree_union:
449463 [Tree_alg.Incompatible_union] caught
450464 [Tree_alg.Nonexistent_child] caught
451465 *)
452466 let ct_l = Root. get c_ptr_l in
453467 let ct_r = Root. get c_ptr_r in
454468 try
455- let ct_ret = (CD . tree_union[@ alert " -exn" ]) ct_l ct_r in
469+ let ct_ret = (UN . tree_union[@ alert " -exn" ]) ct_l ct_r in
456470 Ctypes.Root. create ct_ret
457471 with
458472 | TA. Nonexistent_child -> error_message := " Nonexistent child" ; Ctypes. null
459473 | TA. Incompatible_union -> error_message := " Trees must have equivalent root" ; Ctypes. null
460474
461475let tree_merge destructive c_ptr_l c_ptr_r =
462- (* alert exn CD .tree_merge:
476+ (* alert exn UN .tree_merge:
463477 [Tree_alg.Incompatible_union] caught
464478 [Tree_alg.Nonexistent_child] caught
465479 *)
466480 let ct_l = Root. get c_ptr_l in
467481 let ct_r = Root. get c_ptr_r in
468482 try
469- let ct_ret = (CD . tree_merge[@ alert " -exn" ]) ~destructive: destructive ct_l ct_r in
483+ let ct_ret = (UN . tree_merge[@ alert " -exn" ]) ~destructive: destructive ct_l ct_r in
470484 Ctypes.Root. create ct_ret
471485 with
472486 | TA. Nonexistent_child -> error_message := " Nonexistent child" ; Ctypes. null
@@ -488,19 +502,33 @@ let reference_tree_to_json internal_cache from_dir to_file =
488502 let s = Printf. sprintf " Write_error \' %s\' " msg in
489503 error_message := s; 1
490504
491- let mask_tree c_ptr_l c_ptr_r exclusive =
492- (* alert exn CD.mask_tree:
493- [Config_diff.Incommensurable] caught
494- [Config_diff.Empty_comparison] caught
505+ let mask_inclusive c_ptr_l c_ptr_r =
506+ (* alert exn M.mask_inclusive:
507+ [Diff.Incommensurable] caught
508+ [Diff.Empty_comparison] caught
509+ *)
510+ let ct_l = Root. get c_ptr_l in
511+ let ct_r = Root. get c_ptr_r in
512+ try
513+ let ct_ret = (M. mask_inclusive[@ alert " -exn" ]) ct_l ct_r in
514+ Ctypes.Root. create ct_ret
515+ with
516+ | D. Incommensurable -> error_message := " Incommensurable" ; Ctypes. null
517+ | D. Empty_comparison -> error_message := " Empty comparison" ; Ctypes. null
518+
519+ let mask_exclusive c_ptr_l c_ptr_r =
520+ (* alert exn M.mask_exclusive:
521+ [Diff.Incommensurable] caught
522+ [Diff.Empty_comparison] caught
495523 *)
496524 let ct_l = Root. get c_ptr_l in
497525 let ct_r = Root. get c_ptr_r in
498526 try
499- let ct_ret = (CD. mask_tree [@ alert " -exn" ]) ~exclusive: exclusive ct_l ct_r in
527+ let ct_ret = (M. mask_exclusive [@ alert " -exn" ]) ct_l ct_r in
500528 Ctypes.Root. create ct_ret
501529 with
502- | CD .Incommensurable -> error_message := " Incommensurable" ; Ctypes. null
503- | CD .Empty_comparison -> error_message := " Empty comparison" ; Ctypes. null
530+ | D .Incommensurable -> error_message := " Incommensurable" ; Ctypes. null
531+ | D .Empty_comparison -> error_message := " Empty comparison" ; Ctypes. null
504532
505533let subtree_from_partial r_ptr c_ptr i_ptr path =
506534 let rt = Root. get r_ptr in
@@ -509,10 +537,10 @@ let subtree_from_partial r_ptr c_ptr i_ptr path =
509537 let path = split_on_whitespace path in
510538 try
511539 error_message := " " ;
512- let ct_ret = (CD . subtree_from_partial[@ alert " -exn" ]) rt ct input path in
540+ let ct_ret = (Derived . subtree_from_partial[@ alert " -exn" ]) rt ct input path in
513541 Ctypes.Root. create ct_ret
514542 with
515- CD .Malformed_path s ->
543+ Derived .Malformed_path s ->
516544 error_message := s; Ctypes. null
517545
518546let validate_tree_filter c_ptr rt_cache_path validator_dir =
@@ -578,10 +606,12 @@ struct
578606 let () = I. internal " return_values" ((ptr void) @-> string @-> returning string ) return_values
579607 let () = I. internal " diff_tree" (string @-> (ptr void) @-> (ptr void) @-> returning (ptr void)) diff_tree
580608 let () = I. internal " diff_compare" (bool @-> string @-> (ptr void) @-> (ptr void) @-> returning string ) diff_compare
609+ let () = I. internal " diff_show" ((ptr void) @-> (ptr void) @-> (ptr void) @-> string @-> returning string ) diff_show
581610 let () = I. internal " tree_union" ((ptr void) @-> (ptr void) @-> returning (ptr void)) tree_union
582611 let () = I. internal " tree_merge" (bool @-> (ptr void) @-> (ptr void) @-> returning (ptr void)) tree_merge
583612 let () = I. internal " reference_tree_to_json" (string @-> string @-> string @-> returning int ) reference_tree_to_json
584- let () = I. internal " mask_tree" ((ptr void) @-> (ptr void) @-> bool @-> returning (ptr void)) mask_tree
613+ let () = I. internal " mask_inclusive" ((ptr void) @-> (ptr void) @-> returning (ptr void)) mask_inclusive
614+ let () = I. internal " mask_exclusive" ((ptr void) @-> (ptr void) @-> returning (ptr void)) mask_exclusive
585615 let () = I. internal " subtree_from_partial" ((ptr void) @-> (ptr void) @-> (ptr void) @-> string @-> returning (ptr void)) subtree_from_partial
586616 let () = I. internal " validate_tree_filter" ((ptr void) @-> string @-> string @-> returning (ptr void)) validate_tree_filter
587617 let () = I. internal " config_dict" ((ptr void) @-> (ptr void) @-> (ptr void) @-> string @-> bool @-> bool @-> returning string ) config_dict
0 commit comments