Install using pip (>= 19.0).
pip install --upgrade pip
pip install git+https://github.com/cms-l1-globaltrigger/tm-diff.git@0.9.2
Compare 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:
unified
for unified diff formatcontext
for contextual diff formathtml
for a complete diff in as HTML filereport
to be copy-pasted into TWiki reports
Default format is unified
.
Example:
tm-diff ... -fhtml -o diff.html # dumps diff as HTML table to file
Use flag -s|--skip <mode>
to ignore certain attributes. Options are
module
to skip implementation details (attributesuuid_firmware
,n_modules
,module_id
,module_index
)comment
to skip comments (attributecomment
)labels
to skip algorithm labels (attributelabels
)
Example:
tm-diff ... -smodule -scomment # ignores module_is/index and any comments
Use flag --sort <key>
to sort algorithms by attribute. Options are
index
to sort by algorithm indexname
to sort by algorithm nameexpression
to 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.txt
Use flag -o <file>
to write the output to a file.
Example:
tm-diff foo.xml bar.xml -o diff.txt # write output to file
This is equivalent to:
tm-diff foo.xml bar.xml > diff.txt # pipe stdout to file