views:

1084

answers:

6

I have a client who is rather insistent about using Clearcase. Are there any tools/scripts that would allow my team to work against an SVN repository (or really anything other than Clearcase), but periodically automatically sync back changesets to the Clearcase VOB?

My thinking is that if such a tool exists, and it's automatic, reliable, and transparent the client might be pursuaded to allow us to work against SVN.

Thanks, Kent

+2  A: 

I use Git directly within a ClearCase view.
Then I could git2svn back the content to SVN if I had a SVN repo to synchronize with.

Note: for a tool to work directly within a ClearCase view, I have to use a snapshot view, in order to write in files even if they are not checked out yet. Then for any activity I consider finished, I update the snapshot view which allows me to list all "hijacked" files. I check-out them, then check-in them.


The issue I would see with working with SVN in this case (ClearCase repo for the client) would be to:

  • introduced another central repository (meaning to commit, you have to have access to your private central SVN repository, and, for "to-the-client commits", to have access to the central ClearCase VOB - Version Object Base, the "repository" in ClearCase lingo).
  • introduced another branch modeling, where in SVN, it is a cheap copy within a directory, whereas in ClearCase, it is a metadata (branch) not represented as a directory. That means the physical tree of a SVN checkout might not match a snapshot view update in ClearCase, because some of the directories checked out by SVN will simply not exist in ClearCase.

At least, with Git, you have:

  • private repository (you are not adding another central repository everyone should have access to)
  • same branching model (at least when it comes to "not representing a branch by a directory")
VonC
+1  A: 

Just FYI : It might be useful to you in some way : Moving from SVN to ClearCase

This doesn't sync the data, but if you need to migrate over, it might help out.

Spedge
+1  A: 

If clearcase has command line support you will be able to write a script to check into clearcase, and configure svn to execute it automatically when code is committed (post-commit hook)

Alterlife
A: 

That article describes several ways for that:

http://www-01.ibm.com/support/docview.wss?ratlid=cctocbody&rs=984&uid=swg21258843.

Basically the variants:

1) If you are not interested in maintaining version history and merely wish to start from the latest version or a preselected configuration, you can use the clearfsimport command. Review the ClearCase Command Reference Guide on the topic of clearfsimport (cleartool man clearfsimport) for more information.

2) If you require version history, you may want to evaluate the open source tool svn2cc.

WORKAROUNDS:

  1. It is possible to create views in Subversion representing certain milestones in your development stream. From there you can import the versions from each view sequentially using the aforementioned command clearfsimport. The clearfsimport command in this scenario will create a new version of the element each time it is run applying a label to the imported versions automatically.

  2. You can try using clearexport_cvs, as the Subversion repository is very similar to that of CVS (Concurrent Versions System), see IBM Rational ClearCase Command Reference for more details on this export utility.

Zorkus
I think these are to move from clearcase to svn - I think the OP wants to use svn clients but keep the code in clearcase.
Mark
+1  A: 

Yes, CollabNet offers a commercial product specifically for that purpose, called the CollabNet Subversion Connector.

Garen
Interesting - thanks for that. It does seem, however, that one must use the CollabNet subversion "extensions" rather than it working with any old svn repository.
Kent Boogaart
+2  A: 

We needed exactly this for a project I was on. The team was more comfortable in svn, and the corporate standard was ClearCase. So I wrote a script to continously migrate trunk to clearcase, and ran it on our build server.

I've put the script here: http://dvae.net/blog/2009/09/clearcase-to-svn/

What we did was to set up a job on our build server that ran periodically and did a migration using clearfsimport. We used Luntbuild as the build server, but cruise control would work fine too. Like a normal build, we set the script to be run only when svn modifications where detected. We had the job run every 20 minutes as the ClearCase server was in a different country and all operations were slow and a sync took 40 mins to run. I suggest running as often as you can.

The script is based on ClearCase UCM, if you are not then have to remove the 'cleartool mkact' and at the end create a label instead of a baseline.

I set the clearcase comment to be a concatenation of all SVN commits since the last sync.

I found it reliable, and the only reason it would fail was if Clearcase triggers (like the 'evil twin' trigger) stopped the checkin. When that happens the build fails, Lunbuild sends an email, and I then have to manually do a reverse history merge to get rid of the evil twin problem, commit and re-run.

David Roussel
Fantastic! Thanks David.
Kent Boogaart