From 26fc59887e8c596dad4e67d350b26c5e908be259 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Thu, 12 Jan 2017 20:23:52 +0700 Subject: T245: improve handling of nodes with duplicate names. Two tag nodes with the same name ("ethernet eth0 {...} ethernet eth0 {...}") is an error. Two leaf nodes with the same name, however, are not an error. Values of the next nodes are merged into the first one, while all other data (comment and inactive and ephemeral properties are inherited from the first node. This mimics the old syntax of multi nodes, so a person who uses the old syntax out of habit in a handwritten config will get the result they expect. --- src/vytree.mli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vytree.mli') diff --git a/src/vytree.mli b/src/vytree.mli index 02d8edf..9bc8844 100644 --- a/src/vytree.mli +++ b/src/vytree.mli @@ -23,7 +23,7 @@ val insert : ?position:position -> 'a t -> string list -> 'a -> 'a t val insert_multi_level : 'a -> 'a t -> string list -> string list -> 'a -> 'a t -val merge_children : 'a t -> 'a t +val merge_children : ('a -> 'a -> 'a) -> 'a t -> 'a t val delete : 'a t -> string list -> 'a t -- cgit v1.2.3