| 8 | val PARENT = "__PARENT__" |
| 9 | |
| 10 | fun commit(box: Box) { |
| 11 | val inplay = box.properties.map.keys.filter { it.name.startsWith(VERSION) }.map { it.name.replaceFirst(VERSION, "") } |
| 12 | if (inplay.isEmpty()) return |
| 13 | |
| 14 | inplay.forEach { |
| 15 | // PARENT is now the hand edited file, this is the edited version of VERSION |
| 16 | box.properties.put(Dict.Prop(PARENT + it), copy<Any>(box.properties.get(Dict.Prop(it)))) |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | fun clearAllFailure(root: Box) { |
| 21 | root.breadthFirst(root.allDownwardsFrom()).forEach { clearFailure(it) } |