I'm trying to list all branches created from a Parent SVN branch to establish a graphical representation of a branch in Subversion.
Are there any SVN command which can be used to achieve this?
Or is there an approach to solve this?
Example:
Parent Branch: Branch1
Child Branch: Branch2 and Branch3 (both branches created from Branch1).
GrandChildren Branch: Branch2.1, Branch3.1 etc.,
Given Branch1, I'm trying to list the child branches and Grand Children branches that were created from Parent Branch (Branch1) and Child Branches respectively.
Result:
Branch1-------------------Branch2-------Branch2.1 , Branch 2.2 ..
|__________________Branch3-------Branch3.1, Branch3.2...
I had a similar problem to solve. However I have limited my search to the children. Making a recursive script will let you find the grand children.
Because the repository I have to examine has a lot of branches and commits,
svn log
commands can be very slow. So, I separated the work in two steps:Retrieve the commits logs that create the Children branches. I save them in a file, with a one line:
The -r1903 is to limit the search to try speed up things a bit. I knew the parent branch was created at r1903, so no need to look before.
I used
ack
, butgrep
would work the same.I wrote a python 2.7 script to parse the
kids.log
file:Tip: I replace the last two lines with the following to gather all the matches:
then you can loop over
allinfo
and print out the information you need as you want.Grand kids: To make a recursive script, steps 1 and 2 have to be converted into functions in one python script. And step 2 would call step 1 with the found kids name as argument. Objects may help keeping track of the entire family tree.