With Toad for Oracle 9.7 now available, I thought I’d cover how to configure and use Subversion with Toad’s code sharing utility – Team Coding. We had a lot of requests for this integration and here it is !
The Subversion implementation in Toad allows you to use the conventional file-based check-out and check-in via the Editor’s File Open button. All you have to do is browse to the working folder, select your file and open.

However, Team Coding, a standard feature in Toad, makes using Subversion much simpler where you have a team of developers and you require visibility of the project’s code, who has access to it, what it’s status is, what the version history is and maybe compare versions. And this is the subject of this blog.
First things first, though – so what exactly is Team Coding?
This link directs you to a blog written by Jeff Smith last year on what Team Coding is, so if you’re not familiar with it, have a read of it before you read this blog.
http://toadworld.com/Community/Blogs/tabid/67/EntryID/136/Default.aspx
OK... back already?
Step 1 – Installing a Subversion client - TortoiseSVN
To use Subversion on Windows, you will need to use TortoiseSVN.
First download and install Tortoise SVN (http://tortoisesvn.net/downloads ). Please follow the instructions in this document (“Using Toad with TortoiseSVN.doc” ) on AskToad which can be found here:
http://asktoad.com/DWiki/doku.php?id=howtos&DokuWiki=ffb154ea8e0221a691f1805e1516f49f
Step 2 – Installing an SCC plug-in
In order to use Subversion with Team Coding, you will need to install an SCC plug-in.
Although there are a number of SCC plug-in programs you could use, the Toad Development team have tested a program called PushOK which can be downloaded from
http://www.pushok.com/soft_download.php?idprogram=3 . Use the download which is most compatible with the version of Subversion you are using.
The PushOK SVN SCC proxy is an SCC API plug-in for any Microsoft SCC enabled IDE, including Toad for Oracle.
Please note: PushOK provide a free trial, but there is a charge for their software after the trial period. There are other plug-ins you could use (e.g.
Unified SCC (30-day trial) and
TamTam (unlimited eval period)) which will also require a purchased license. We may develop a direct interface to the SVN API for a future version of Toad to obviate the need to install this software.
Follow all the steps described in the “Using Toad with TortoiseSVN” document. If you have it set up correctly, then when you open the Repo-browser from your repository directory, you should see your Work folder registered and any files added displayed.

Step 3 – Configuring Team Coding
In your Team Coding settings windows, you can select the PushOK SCC from the list of available vendors. A login to PushOK should already have been established.

Step 4 – Create a Code Control Group
The next task is to create a Code control Group (CCG) in order to assign your code and other objects to a specific working group. Again, ensure you specify the correct working directory:

Now you need to define a CCG Mask to specify which schema and which code and other files you want associated with this CCG. Open the CCG and define the object types, schema and exclusion mask (or filter) you wish to apply.

Step 5 – Synchronizing code between database and Subversion
In order to synchronize the code you have in the database with Subversion, you need to perform an Export to VCS using the
button.
This will create a copy of the code and other objects you specified in your CCG into your Subversion working folder. A list like this, which shows, based on how you defined the CCG, the code and other objects from which you can select or deselect what you would like to export.

Specify which export options you want, including comments and click OK

Before anything is exported to the Subversion working folder, TortoiseSVN will ask you to confirm the URL, Module and local path to its repository.

If everything is setup correctly, the export should proceed as follows:

Step 6 – Viewing your code
You can confirm that your files have been exported by right-clicking the repository folder and selecting Repo-browser. You should now see all the files located under the Work folder:
You will also open this window if you select “VCS Browser” from the Team Coding menu.

You should also see these files listed in the Team Coding Viewer window:

Select a program from the Toad Editor using the “Open from Database” button will initiate a pull from the VCS. The first time you do this, you will see a Question window (lower left screenshot).
The other window (upper left screenshot) you don’t normally see because it’s kept hidden, but shows how PushOK is accessing the Subversion working folder.
Clicking the Yes button will open the Team Coding Check-Out window (right screenshot) confirming the project from which the code will be accessed and (depending on which Team Coding options you have set) allow you to enter comments for the check-out operation.
Once the code is displayed in the Editor, you should have a “Checked Out” message displayed at the bottom of the window. This code is now write-locked until it is checked back in by the original user (or someone with Team Coding administrator rights).

To view the version history for an object, right-click the object in the Repository Browser and select “Show Log”.

This screenshot shows the revision history for the PL/SQL Function OW_CALC_ORDER_COST. By default, the Repository Browser will show the “Head” or highest version of each object. This can be changed to show specific versions.
The beauty of using Toad’s Team Coding feature with your VCS, is its seamlessness and visibility into your project code. It also enables much better protection of your code’s integrity since it checks the version of the checked-out code against the compiled version in the database, and offers a warning message to the user if they are out-of-sync. The user then has the choice of accepting the VCS version, the database version, or performing a file compare on-the-fly to determine which version to use.
Feel free to post comments on this blog, through ToadWorld, about your experiences of using Toad with your VCS and suggestions on how we can make improvements.
Thank you for reading !
Additional References: