Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generates a list of partial diffs for https://reviewboard.mozilla.org/r/117282
#!/usr/bin/env bash
# assumuing the file is in toolkit/componetsn/telemetry
TELEMETRY="Telemetry.cpp"
# Get the copy of Telemety
hg revert -r central $TELEMETRY
declare -A COMPARE_FILE_AREAS=(
# Filename => from:to (Telemetry.cpp) | from:to (Filename)
["KeyedStackCapturer.cpp"]="427:610|15:164"
["KeyedStackCapturer.h"]="472:510|22:72"
["CombinedStacks.cpp"]="103:244|15:193"
["CombinedStacks.h"]="108:137|19:45"
["HangReports.cpp"]="246:425|12:153"
["HangReports.h"]="246:308|20:78"
)
mkdir -p /tmp/diffs/
for filename in $"${!COMPARE_FILE_AREAS[@]}"; do
# Parse the line diff rage
IFS='|' read range1 range2 <<< ${COMPARE_FILE_AREAS[$filename]}
bash ./diff-lines.sh $range1@$TELEMETRY $range2@$filename > /tmp/diffs/$TELEMETRY-vs-$filename.diff
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment