Install using pip (>= 19.0).
pip install --upgrade pip
pip install git+https://github.com/cms-l1-globaltrigger/tm-diff.git@0.9.2Compare the content of two XML trigger menus.
tm-diff [-f|--format <format>] [-s|--skip <mode>] [--sort <key>]
[-d|--dump] [-o <file>]
<file1> <file2>Use flag -f|--format <format> to select diff output format. Options are:
unifiedfor unified diff formatcontextfor contextual diff formathtmlfor a complete diff in as HTML filereportto be copy-pasted into TWiki reports
Default format is unified.
Example:
tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to fileUse flag -s|--skip <mode> to ignore certain attributes. Options are
moduleto skip implementation details (attributesuuid_firmware,n_modules,module_id,module_index)commentto skip comments (attributecomment)labelsto skip algorithm labels (attributelabels)
Example:
tm-diff ... -smodule -scomment # ignores module_is/index and any commentsUse flag --sort <key> to sort algorithms by attribute. Options are
indexto sort by algorithm indexnameto sort by algorithm nameexpressionto sort by algorithm expression
Default sort kay is index.
Use flag -d|--dump to dump the raw text used to diff the menu contents. This
option will create two text files with the menu names at the current working location.
Example:
tm-diff foo.xml bar.xml -d # dumps raw text to foo.xml.txt bar.xml.txtUse flag -o <file> to write the output to a file.
Example:
tm-diff foo.xml bar.xml -o diff.txt # write output to fileThis is equivalent to:
tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file