Recursive folder import into a ClearCase VOB

ClearCase Explorer GUI version 8.0.1.5 (and many other version, I suppose) miss a fundamental functionality to recursively import new projects. I think this feature has been removed by IBM by purpose from GUI, to leave it available by command line tool.

This is starting point to populate new VOBs from existing projects that may had a life before ClearCase team introduction. The idea is very simple, with a single action we want to import a folder we prepared for the purpose, if some file must not versioned, then those files are simply eliminated from import folder.The command line tool we’re talking about is “clearfsimport” which is documented at this link. I found strange the way command options are parsed, if you switch order of some then command doesn’t work … or worst behave in unwanted way so … pay attention and follow next steps.

Clearfsimport command execution

  • Prepare the folder to import outside de ClearCase view
  • Change directory going into the view filesystem, it is not necessary to checkout the folder which will contain the new imported data. Execute the clearfsimport command:

C:\cc\gmula_testVOB\test_vob\test_import>clearfsimport -recurse -rmname -nsetevent -identical -comment “Project import by fsimport command” C:\tmp\folder_to_import .\target_folder

  • In example path “C:\tmp\folder_to_import” is local folder to import.
  • Last parameter is the target folder, relative to the folder where the command is executed. As result, into CC view will obtain filesystem like “target_folder\folder_to_import” plus all subfolders.

If destination folder already exist (at least in a partial way) then remove “-identical” parameter so to import only new files and folders.

Conclusions

As just mentioned the procedure is very easy, but it must be highlighted that the command shall be executed from inside the ClearCase view, while the folder to import must be outside. These small details will allow you to save a lot of time (the same I wasted when I first tried to import following online guide from IBM).

 

Leave a Reply