Saturday, June 18, 2011

ClearCase - Promote Files From Sub Branches to Main Branch

ClearCase is a source control management (SCM) tool from IBM. I use ClearCase in the company that I'm working on right now. There are many things to learn for ClearCase and I find that it is so complicated. We have to deal with the cleartool commands most of the time to get something done.

There are times where we need to promote the codes from our development branch to the main branch, especially after the codes go into production. The purpose of doing so is ensure that all the related source files from development branch are "copied" to the main branch and the changes are visible in the future branches sprout out from main branch. We just don't want to miss any changes. Besides that, having the changes promoted to main also means that, the config spec of the future branches will be much more cleaner and will not dependent on the past release branch.

The promote to main process can be automated by using a series of cleartool commands. There is an article in IBM website that guide us how to do so, which you can refer it here. However, when we did it for my company, we found out some issues (perhaps it is more suitable to say, need some enhancement) on the cleartool commands provided from that article. The problem is when we have some files with very large version tree that never promote to main before. New branch sprout out from previous development branch and it keeps going on like that for few years. For this kind of files, we encountered failure in copying the files from development branch to the main branch. It failed at the native windows copy command. This is because, when the file's version tree grows huge, the version extended pathname also grows. When the path grows exceeding the pathname limitation of windows, the copy command will fail.

To prevent this, we can simply replace the windows copy command to use cleartool get command. However, there are some limitations using get command. The command only support static / snapshot view and it can only be used to copy file elements. Here's an example of using the get command in windows environment (make sure you run the command in the root directory of your clearcase view):






What the command above does is to first, find a file that we want to perform the "get" operation using the cleartool find command. After that, perform the get command towards the target file.

There are 2 ClearCase variables being used here, which are: %CLEARCASE_PN% and %CLEARCASE_XPN%. The first variable represents the file(s) on the branch your current view is pointing to (we usually set the current view to main branch for this purpose), while the latter, represents the development branch where you would like to get the file(s) from.

From my experience on this, it tells me that we should always plan, control and manage the source repository carefully which will save us a lots of time solving unforeseen issues.

Converting .dmg to .iso

I think those who familiar with Mac OS will know what a .dmg file is. It is 1 of the file type in Mac OS environment that is similar to windows .iso file.

There are several tools out there to convert the file type from .dmg to .iso. I found one tool that I think is reliable (at least I tried converting 2 .dmg files to .iso files and they worked well) and it's name is dmg2iso.

Here's the link on how to use that tool http://www.blogsdna.com/3183/convert-dmg-to-iso-with-dmg2iso.htm

You will need to run the tool from command prompt and passing in some valid arguments. That's not a big problem for a IT guy I think. Cheers~

Friday, June 17, 2011

Report Viewer - Problem Showing Chinese Characters on PDF

One of the common problem on Report Viewer is showing unicode characters on the pdf report. Instead of showing the correct characters, the report will show question mark (????) for the unicode characters. For me, I need to display chinese character in the pdf report. There are 2 steps required to get it done:

1. Install East Asian Languages on the server  (I'm not 100% sure though, whether client's machine also need to install it. ). Server restart is required after the installation.

2. Change the font type of your report / textbox in your report that will need to display unicode characters. I tried several chinese fonts but so far, only 1 works for me, which is DFKai-SB.

Hope this helps. Happy programming!