1

We have two vobs which are "voba" and "vobb". And there is a directory "abc" in both vob and contains the same .h / .cpp files.

Usually, the files in "abc" dir in "voba" are updated quite frequently. And from time to time, I would like to update all files in "abc of vobb" from "abc of voba", which means:

  1. Checkout the updated files in vobb.abc, overwrite them and then check in.
  2. Copy the newly created files to vobb.abc, create element.
  3. Delete the deleted files in vobb.abc by corrspoding to voba.abc.

If it is a common linux directory, I think cp -u and achieve that. But when it comes to the clearcase, I can only do the above 1-3 by hand.

Is there any easy way to finish that update automatically?

Mualig
  • 1,444
  • 1
  • 19
  • 42
user2191818
  • 39
  • 1
  • 4

1 Answers1

0

This is called in ClearCase a clearfsimport (potentially used with the -mirror option)

Since the elements in the directories abc of the two vobs are completely different (different oid, with different history), what you can do is import the content of abc from one vob into another: clearfsimport will automatically checkout, update and checkin only the files that have evolved in the source, and need to be updated in the destination.


Note, this recent thread (March 2013) also points out to the perl script ClearCase::SyncTree

It is superior to clearfsimport in many respects, especially in its evil twin avoidance (it will try with the proper options to link suitable entries from non visible versions).

Description:

This module provides an infrastructure for programs which want to synchronize a set of files, typically a subtree, with a similar destination subtree in VOB space. The enclosed synctree script is an example of such a program.

The source area may be in a VOB or may be a regular filesystem; the destination area must be in a VOB.
Methods are supplied for adding, subtracting, and modifying destination files so as to make that area look identical to the source.

Symbolic links are supported, even on Windows (of course in this case the source filesystem must support them, which is only likely in the event of an MVFS->MVFS transfer). Note that the text of the link is transported verbatim from source area to dest area; thus relative symlinks may no longer resolve in the destination.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Since I am not the owner of the vob and I have my own branch from the vob, when I triead the command: clearfsimport -preview -master -follow ~/t1/* /vobs/..../... I got Error: Permission denied: not VOB owner or privileged user, how shall I do that? – user2191818 Mar 22 '13 at 08:25
  • @user2191818 can you do any checkout of any file in that vob? – VonC Mar 22 '13 at 08:27
  • @user2191818 also, see http://stackoverflow.com/questions/138321/how-can-i-use-clearcase-to-add-to-source-control-recursively#144310: you need the `-nset` option for your `clearfsimport`command. – VonC Mar 22 '13 at 08:28
  • No bother,I achieved that with the "–nsetevent " added. Thanks – user2191818 Mar 22 '13 at 08:35
  • Hi VonC, yes exactly, I used that –nsetevent which works. Thanks a lot – user2191818 Mar 22 '13 at 08:36