TortoiseSVN is a free and open-source Subversion client for Microsoft Windows. It is not tied to any particular Integrated Development Environment (IDE); instead, it is a shell extension which integrates into the Windows Explorer, giving you easy access to Subversion repositories from within applications you're already familiar with. This means that it can be used with any software, and by all members of your development team. In the previous article, Working with Revision Logs in TortoiseSVN
, we learnt about differences
and changelists in TortoiseSVN 1.7.
In this article by Lesley Harrison
, author of TortoiseSVN 1.7
, we shall:
- Explore working with revision graphs
- Learn how to change views in revision graphs
- Learn how to prune trees to make the revision graph easier to understand
Revision graphs provide an easy way for you to tell at-a-glance what is going on with your project. They provide a map, in easy-to-understand tree form, of the revision history of your project, including copies, branches, and tags.
One useful feature of revision graphs is that you can export them into a vector graphics format (WMF is a good option because they scale well and produce fairly small file size images. If you need a more widely supported format, then PNG is a good option) for inclusion with your source code, or on your project's website, giving everyone an easy overview of the status of your project.
You can view revision graphs for files, directories, or the whole project.Time for action – viewing a revision graph
What just happened?
- To view a revision graph, go to your working copy, and right-click inside the project, and then select TortoiseSVN | Revision Graph.
- The graph that appears in the following screenshot shows the history of any branches and tags created, in an easy-to-understand, tree-like structure:
- If you prefer to read from top to bottom, rather than having the newest node at the top of the screen, then click the Show oldest node at top button (this can be found two buttons to the right of the drop-down which allows you to change the zoom level). This will invert the view, as shown in the following screenshot:
- You can view information about a particular branch by right-clicking on it and selecting Show Log:
- You can also use the same context menu to merge revisions, switch your working copy to a particular branch or tag, browse the repository, and collapse trees.
You have just used the revision graph to get an overview of the revisions, branches, and tags in your project. The last revision graph that we saw is a simple one, taken from our example project. In a real-world scenario, it is likely that the revision graph would be much more complex, and it is in these complex projects that having a revision graph becomes so useful.
When there are dozens of branches which are being created and merged, it can become difficult to keep track of what happened when, and why. A revision graph gives you a clear high-level view of everything that is happening in your software project.
To fully understand the revision graph, it helps to understand what each node means. The following table will help with this:
Items which have been added or copied Branch HEAD revisions (if you have elected to show these) Plain with bold outline (a red outline indicates modifications)
You can use the graph to get more detailed information about the differences between revisions. Just Ctrl
-click on the two revisions you are interested in, right-click to bring up the context-sensitive menu, and then select Compare Revisions
. You will be able to see a list of the revisions made to each file. Compare them using TortoiseDiff, as shown in the following screenshot:
You can also compare HEAD revisions, and view the unified differences using this method.Changing your view
If your software project is quite large and complex, then you may find it useful to change the view used in the revision graph. There are several options that you can use to change the view you are using, and they can all be found under the view menu.
Rather than replicating the TortoiseSVN documentation by describing every single option, only the more interesting options will be described here. The other options are mostly clearly labelled, and otherwise are explained in the online help for TortoiseSVN:
Keeping your view up-to-datePruning trees
If you are viewing a revision graph of an active project, you may want to check for updates. Just as you would in your web browser, you can refresh the revision graph by pressing F5. This will connect you to the server (if you have been working offline) and check to see if there have been any new commits. Pressing F5 to refresh works for most screens in TortoiseSVN. You can update your log dialog, for example, by pressing F5 too.
Large software projects can end up with lots of trees. This can make the revision graph look excessively complex, and can make it harder for you to find the information that you need. The good news is that you can tame the trees in your graph, shrinking and expanding them as you need them.
To shrink a tree or a branch, simply hover your mouse over the point where the branch begins (where the node link enters the node), and you will be given the option to collapse the related tree (-
), or expand it (+
). If applicable, you will also be presented with the option to split a sub-tree into a separate graph (x
), or re-attach a tree that had been split (o
In this article you learned how to view revision graphs, and how to manipulate your view of the graph to give a clearer view of the things that you are interested in.
Revision graphs are useful for even small development teams. The good thing about the way TortoiseSVN displays them is that they are highly customizable, and scale well for larger projects. So, if you need to keep up with the lifecycle of branches and tags in a big project, then you can do so easily—thanks to the highly customizable views offered by TortoiseSVN!