1

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?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Onkar
  • 25
  • 6

1 Answers1

0

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But i dont want it to check for other files because there are around 3500 files in the SDK folder. I just want the `clearfsimport` be to be restricted to the files i have given it through the text files there reducing the time – Onkar Apr 09 '15 at 08:52
  • @Onkar let clearfsimport do the work: it is all automated for you. – VonC Apr 09 '15 at 08:55
  • @Onkar actually, even simpler: copy those files in a structure `/homes/user/SDK_to_import` where they would be the only files. And `clearfsimport` that. By default, `clearfsimport` will not remove the files of the destination folder which are not present in the source folder. – VonC Apr 09 '15 at 08:58
  • U mean to say the dir structure should look like `/homes/user/SDK_to_import/a/b/abc.cpp` ??? – Onkar Apr 09 '15 at 10:01
  • @Onkar yes, same dir structure, but with only the files you want to `clearfsimport`. – VonC Apr 09 '15 at 10:28
  • @Onkar Great! I have edited the answer to reflect the actual solution. – VonC Apr 09 '15 at 14:07