Friday, 22 June 2007

Script to see svn branch log,
 and follow on from the log if earliest entry was a "rebranch",
 and keep on doing that until branch was really created.

Trac and mergebot very very useful for managing svn branches.
Manages making of branches and essentially  branch merges or rebranch very nicely.
 (works with branches with a parent branch too instead of trunk)

We seem to have been burnt by a big merge out on a branch.
Many revisions and a good few rebranches and merges back to parent.
So need to follow log revisions.

On command line svn log --stop-on-copy reports how to get "Previous log" revision. And now that I know what to look for I see a "Previous log" link in the trac log of any changeset which is a rebranch merge.


if [[ "$1" == "" ]] ; then
  echo "usage: xt <ticket-nnn>"


touch ${TICKET}follow.log

while [[ $BRANCHREV != "" ]] ; do
#echo go go go;
svn log  ${SVNROOT}/${BRANCHREV} --stop-on-copy >> ${TICKET}follow.log
BRANCHREV=`tail -2 ${TICKET}follow.log |grep "Previous log" | sed "s/.*log:\(.*\) Previous.*/\1/"`

No comments: