1

I recently started usage of clear case tools for maintenance of code in better way. But after some days my "Company" forgot to take licence from IBM as result I cannot CHECK-IN my code into clearcase. To continue my coding i created a separate folder in other drive and copied code solution in that folder. I and my colleague modified around "9865" files of solution within "45" working days. Now a "Company" borrowed a licence for me and I able to access code clear case tool successfully.

Problem is:

How to check in my "9865" files into clearcase in better way?

I tried:

Copied all solution into Snapshot view folder location. but, all changed files are showing "hijack".

Johan
  • 74,508
  • 24
  • 191
  • 319
Santosh Dhanawade
  • 1,756
  • 14
  • 29

1 Answers1

1

The best way is to use clearfsimport: that will automatically checkout, and import your 9865 in one command.

Make sure to update your snapshot view first, in order to restore its original content.
Then clearfsimport those files.

clearfsimport -preview -rec -nset /path/to/sourceDir\* </myview/VOB>

The clearfsimport command will detect the files added or modified, and do the checkouts for you.
If you are using an UCM view, set an activity first.

The source from where clearfsimport does that copy can be any regular folder.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for quick reply. This will import files in development branch or in main branch? Additionally what about newly added files? – Santosh Dhanawade Apr 06 '15 at 08:05
  • @SantoshDhanawade it will import the files in the branch currently managed by the view: choose a view already set to checkout files in the *right* branch, and `clearfsimport` simply will use that. `clearfsimport` is just there to checkout and import: it doesn't know in which branch, that is entirely controled by the destination view config spec. – VonC Apr 06 '15 at 08:07
  • @SantoshDhanawade yes, but check your config spec: if it says `-mkbranch xxx` (as in http://stackoverflow.com/a/29014592/6309), it would create a branch `xxx` starting from the eye (unless the eye points already to the `xxx` branch) – VonC Apr 06 '15 at 08:12
  • No issues if it create branch. What about newly added files? Is this command add files to source control? – Santosh Dhanawade Apr 06 '15 at 08:14
  • @SantoshDhanawade again, it depends on your config spec (as in http://stackoverflow.com/a/29014592/6309): a `/main/0` rule is needed as a new file will first create a `/main/0` placeholder version, and then create a version `1` in the current branch defined by the config spec. But yes, `clearfsimport` will those new files to source control for you. – VonC Apr 06 '15 at 08:16
  • This one is my config spec "element * CHECKEDOUT element * .../Working/LATEST element * /main/LATEST -mkbranch Working element * /main/LATEST load \OSD_Suprime\Suprime" will it do? – Santosh Dhanawade Apr 06 '15 at 08:20
  • @SantoshDhanawade ok. Have a look at http://stackoverflow.com/a/29014592/6309: you are missing a `element * /main/0 -mkbranch Working`, if you want you new imported elements to be added directly in the `Working` branch. – VonC Apr 06 '15 at 08:22
  • Yup, I looked into it. latest version of my main branch is main/24. so i thought main/LATEST or main/24 should be there. please correct me if am wrong. – Santosh Dhanawade Apr 06 '15 at 08:27
  • @SantoshDhanawade `/main/LATEST` is fine and will allow for new files to be created in `/main`. But existing files would be created in `Working` branch (even when the latest version is in `/main`), according to your config spec. So make sure that is indeed what you want to do. – VonC Apr 06 '15 at 08:39
  • Okay, thanks for discussion. Will try and let you know. Thank you so much but. – Santosh Dhanawade Apr 06 '15 at 09:00
  • I tried "F:\abc>clearfsimport -preview -rec -nset * santosh_view59\TEMP_TEST\dot_net_1" but giving me error. clearfsimport: Error: Unable to determine VOB for pathname "santosh_view59\TEMP_TEST\dot_net_1". – Santosh Dhanawade Apr 06 '15 at 09:39
  • @SantoshDhanawade you need to provide the path of the view/vob in which you import. `santosh_view59\TEMP_TEST\dot_net_1` doesn't seem to be a valid Windows path. – VonC Apr 06 '15 at 09:51
  • I tried F:\abc\windowsformsapplication1>clearfsimport -preview -rec -nset "F:\abc\windowsformsapplication1\windowsformsapplication1\form1.cs" "E:\CC_Work\FromCC\santosh_view60\AOP_TEST\dot_net_1\windowsformsapplication1" E:\CC_Work\FromCC\santosh_view60\AOP_TEST\dot_net_1\windowsformsapplication1\form1.cs new element E:\CC_Work\FromCC\santosh_view60\AOP_TEST\dot_net_1\windowsformsapplication1 new directory version. but nothing happened on server. – Santosh Dhanawade Apr 06 '15 at 11:35
  • @SantoshDhanawade see other examples: http://stackoverflow.com/a/144310/6309 or http://stackoverflow.com/a/24773174/6309 – VonC Apr 06 '15 at 11:43
  • When i remove -nset option i am getting "clearfsimport: Error: Permission denied: not VOB owner or privileged user." But i able to check in check out with "clearcase Explorer". – Santosh Dhanawade Apr 06 '15 at 12:02
  • Yes, you need the nset option – VonC Apr 06 '15 at 12:03
  • once i removed -preview all thinks working properly. – Santosh Dhanawade Apr 06 '15 at 12:12
  • Great. Preview is indeed for previewing first, before actually importing. – VonC Apr 06 '15 at 13:41
  • I am getting "clearfsimport: Error: Type manager "text_file_delta" failed create_version operation." for some files. – Santosh Dhanawade Apr 08 '15 at 11:43
  • @SantoshDhanawadea that would be a separate question. – VonC Apr 08 '15 at 11:48
  • http://stackoverflow.com/questions/29514335/text-file-delta-failed-create-version-operation-in-clearcase – Santosh Dhanawade Apr 08 '15 at 12:19