Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN to Clearcase Export

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

like image 857
Kent Boogaart Avatar asked Aug 06 '09 16:08

Kent Boogaart


4 Answers

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")
like image 74
VonC Avatar answered Oct 10 '22 07:10

VonC


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.

like image 38
David Roussel Avatar answered Oct 10 '22 07:10

David Roussel


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.

like image 23
Spedge Avatar answered Oct 10 '22 06:10

Spedge


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)

like image 39
Alterlife Avatar answered Oct 10 '22 06:10

Alterlife