Last active
December 17, 2015 00:38
-
-
Save semistrict/5521958 to your computer and use it in GitHub Desktop.
Script to check all branches have been merged to trunk (Subversion)
This file contains 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
#!/bin/bash | |
# Finds changes on all branches that have not yet been merged to trunk. | |
# Does not consider changes that have happened today. | |
[[ -n $SVNBASE ]] || { | |
echo "Set SVNBASE environment variable" | |
exit 2 | |
} | |
ret=0 | |
trunk_url=$SVNBASE/trunk | |
date=$(date +%Y-%m-%d) | |
while read branch; do | |
branch_url=$SVNBASE/branches/$branch | |
first=true | |
while read rev; do | |
if $first; then | |
first=false | |
ret=1 # fail | |
echo "Unmerged changes on branch: $branch" | |
echo "The following changes have not yet been merged:" | |
fi | |
svn log --incremental -$rev "$branch_url" | |
done < <(svn mergeinfo --show-revs eligible "$branch_url@{$date}" "$trunk_url") | |
done < <(svn ls "$SVNBASE/branches") | |
exit $ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment