Repository navigation
fix: reassemble fails loudly instead of writing incomplete XML - #219
Merged
Merged
Conversation
- Catalogs of ReplaceAction and DeleteAction keep their start tag and their children in the skeleton, like those of AddAction and ModifyAction; they were reassembled without their catalog start tag - Only a missing metadata or DDR_INFO file means an empty element; other read errors are reported instead of dropping the content - Item files are reported as not part of any skeleton also in catalog folders no skeleton refers to, not only in folders that were read - The state after a placeholder that spans several lines is reset, so the catalog end tag that follows is recognized - Warn when the same output file is written more than once in a run, because the content written first is lost Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Only catalog folders are checked for unused item files, so readable scripts written with --script-extension xml aren't reported; the names of the non-catalog folders are shared with the exploder - Folders already read for placeholders aren't listed a second time - Lossless output writes metadata and DDR_INFO also when they are empty, so a missing file is an error when reassembling instead of an empty element - Reassembling fails on catalogs that aren't exploded, because the skeleton keeps only their outline - Reassembling fails when several files have the start tag of one id - A file written twice in one run keeps the content written first, and the warning comes before anything is overwritten Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Metadata of a split export is named after the catalog like DDR_INFO, e.g. metadata_ScriptCatalog.xml, so the files don't overwrite each other - A file written twice in one run warns only if the content differs; the hash of each written file is kept, so there is no race between threads - Only the start tag decides whether an item has an id, so items without an id may still share their key - Value list options of 2.2.3.4 and later count as not exploded when reassembling as well, with one rule shared by both sides - A placeholder without its end tag is an error instead of consuming the rest of the skeleton - Simpler catalog folder listing, and one helper for lines that hold a whole element - Round trip of an export split into catalogs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #218:
reassembleshould never write incomplete XML without saying so. It now either gives back the export or fails with an error that names the cause.Reassembling
--lossless, these files are also written for empty elements, so a missing file always means it was lost.CatalogType::is_exploded(ver), to decide which catalogs are exploded. Because of that, value list options in 2.2.3.4 and later also count as not exploded.--script-extension xmlaren't reported. The exploder andreassemblenow share constants for the names of the non-catalog folders (_,scripts_sanitized,custom_functions_sanitized).reassemblereturns these files andmainprints them.Exploding
metadata_ScriptCatalog.xml. Before, all catalog files wrote the samemetadata.xml.OutputFiles::writekeeps the content written first and warns if the new content differs. A hash of the content is stored per path, so the check doesn't read the file again and threads can't race on it.Changes to output⚠️
metadata.xmlis nowmetadata_<catalog>.xml, with and without--lossless.--lossless,metadata*.xmlandddr_info*.xmlare also written when the element is empty.Tests
metadata.xml, a catalog that isn't exploded, several files for one id, and a placeholder without its end tag.--script-extension xmland checks that no file is reported as unused.OutputFilestest checks that a second write keeps the first content.--script-extension xml: there were no warnings and no unused files, and every file came back identical to the export (the UTF-16 files are identical in content, as documented).Not included
🤖 Generated with Claude Code