diff options
author | John Estabrook <jestabro@vyos.io> | 2025-07-08 08:01:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-08 08:01:19 -0500 |
commit | 74c67327160d8dffb8d79bf6691852855715d5f8 (patch) | |
tree | c63ea88a83a0c7bea55ac56729668dd6674ee140 /src/config_diff.ml | |
parent | db5220be72b545863aca753f6d7c159bab98446a (diff) | |
parent | c01c370535640d3cbd4e4c3839d570c596e11695 (diff) | |
download | vyos1x-config-current.tar.gz vyos1x-config-current.zip |
T7499: add non-/destructive configtree merge
Diffstat (limited to 'src/config_diff.ml')
-rw-r--r-- | src/config_diff.ml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config_diff.ml b/src/config_diff.ml index 87b2663..73c379b 100644 --- a/src/config_diff.ml +++ b/src/config_diff.ml @@ -456,3 +456,13 @@ let tree_union s t = Vytree.make_full data (name_of v) (children_of v) in Tree_alg.ConfigAlg.tree_union s t f + +let tree_merge ?(destructive=false) s t = + let f u v = + let data = + match destructive with + | false -> data_of u + | true -> data_of v + in Vytree.make_full data (name_of v) (children_of v) + in + Tree_alg.ConfigAlg.tree_union s t f |