Skip to content

Instantly share code, notes, and snippets.

@semistrict
Last active December 17, 2015 00:38
Show Gist options
  • Save semistrict/5521958 to your computer and use it in GitHub Desktop.
Save semistrict/5521958 to your computer and use it in GitHub Desktop.
Script to check all branches have been merged to trunk (Subversion)
#!/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