DiffWML

From The Battle for Wesnoth Wiki
Revision as of 02:02, 14 November 2018 by Celtic Minstrel (talk | contribs) (Document the diff format)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The DiffWML is a special WML format used to describe changes to a WML config.

A diff consists of the following keys and tags:

  • [insert]: Contains keys that were added to the config, or that changed value.
  • [delete]: Contains keys that were removed from the config.
  • [change_child]: Indicates a change to an existing subtag.
    • index: Specifies the index of the tag that changed. The index is 0-based and counts through all tags, not just those of the same name.
    • DiffWML keys and tags
  • [insert_child]: Indicates the insertion of one or more new tags in the config.
    • index: Specifies the index of the tag before which these new tags were inserted. The index is 0-based and counts through all tags, not just those of the same name.
    • All other subtags are the actual tags that were inserted into the config at this position.
  • [delete_child]: Indicates the deletion of one or more tags from the config.
    • index: The index of the tag to delete. The index is 0-based and counts through all tags, not just those of the same name.
    • An empty tag with the same name as each of the deleted tags to remove from that location.

Diffs generated by Wesnoth only use a single tag in each [insert_child], [delete_child], and [change_child]. However, multiple children will be handled when applying a diff to a config.