Search code examples
version-controlclearcase

What is the most efficient way of adding new files to ClearCase dynamic view by using a text file containing list of changed files?


I have a certain folder(named SDK) containing many other folders as a VOB element in my dynamic view.

/vobs/tools/SDK

I also have a updated version of that folder elsewhere as view private (as flat files).

/homes/user/SDK

I need to add files which were introduced in the updated version to the checked in version which did not have them. I have a text file containing all the files which were newly introduced in the updated version.

/homes/user/files.txt

Contents of files.txt

./a/b/abc.cpp
./s/t/xyz.cpp
.
.
.

Which is the best way to have these files checked in at at appropriate location?

clearfsimport will not work because it takes the leaf of the source path and checks that at the target VOB location.

i.e.

clearfsimport -nset /homes/user/SDK/a/b/abc.cpp /vobs/tools/SDK
clearfsimport -nset /homes/user/SDK/s/t/xyz.cpp /vobs/tools/SDK

wouldn't create the /a/b/ and /s/t/ directories in /vobs/tools/.

I could use mkelem but that would require me to manually create the directory /a/ then /a/b/ and then copy the file abc.cpp and checkin back the newly created directories and the file itself.

Can someone suggest the most efficient way of doing it?


Solution

  • Yet clearfsimport should work (to import multiple files):

    clearfsimport -preview -rec -nset /homes/user/SDK /vobs/tools/SDK
    # or
    clearfsimport -preview -rec -nset /homes/user/SDK/\* /vobs/tools/SDK
    

    That should import all elements, but checkout and update only the ones modified, and create the one missing.

    All that in /vobs/tools/SDK, not /vobs/tools.


    Since there are too many files in /vobs/tools/SDK, copy the ones which have been modified in /vobs/tools/SDK_to_import, with their exact folder structure (like /homes/user/SDK_to_import/a/b/abc.cpp).

    The clearfsimport, by default, will not remove the files of the destination folder which are not present in the source folder.
    But it will update those files in the destination folder /vobs/tools/SDK.