Clicky

I have created 2 new branch types

ct mkbrtype dev_branch1

and

ct mkbrtype dev_branch2

I have checkedin code into dev_branch1
 
How do i copy contents of dev_branch1 into dev_branch2, including all versions of files, everything

asked 05/19/2011 03:44

gram77's gravatar image

gram77 ♦♦


10 Answers:
I take it that these are two branches with a single common ancestor branching point.

The starting place it to look at the merge and findmerge commands:

  • cleartool man merge

  • cleartool man findmerge


If you have any specific questions then let me know.

David.
link
DavidCol's gravatar image

DavidCol

We checkin code into mydev_branch1 and merge it to mydev_branch2

However, i want to work in a dummy branch type mydev_branch3 and merge it to dummy dev branch type mydev_branch4

when i have finished working on mydev_branch3 i want to copy checkedin code into mydev_branch1
and merge mydev_branch1 into mydev_branch2. This way i won't have many versions created of a file.

basically copy contents of mydev_branch1 into mydev_branch3

mydev_branch1 and mydev_branch3 are not related.
link
gram77's gravatar image

gram77

This really seems like a strange way to work..! I don't understand why you want to limit the number of versions. Why are you not delivering / merging the contents of you development stream onto an integration stream / release branch.

When you say
mydev_branch1 and mydev_branch3 are not related
does that mean that they are in different VOBs.

clearfsimport wouild be one way to update mydev_branch3 with the contents of mydev_branch1.

David.
link
DavidCol's gravatar image

DavidCol

does that mean that they are in different VOBs.>> no they are under same VOB.

also please provide example of using clearfsimport. will it copy all elements from elementtype into another elementtype?
link
gram77's gravatar image

gram77

If the two branches are in the same vob and have a common ancestor then the best way to do this is with merge and findmerge I think.

To update the contents of folder A with the contents of folder B using clearfsimport the commands would be something like:

1:
2:
cd <root folder of destination>
clearfsimport -rec -rmname <list of files and folders in source folder> .


You may need to look at the man page for clearfsimport to be sure that I've gotten the syntax correct. A graphical representation of your streaming diagram may help.

Obviously try all this out in a test VOB first and make sure you have backups etc...

David.
link
DavidCol's gravatar image

DavidCol

Here is an excellent material on Clearfsimport.

seems this is a very powerfull tool!

A lot of folks use rational Clear Case LT explorer on Windows to checkin and checkout files. A few who hate to transfer files around will install their Clear Case client on Unix and work with
"cleartool checkout"
"cleartool checkin"
you can take it to the next step. A huge working directory , you ve worked on several scripts - to checkout and check in each one of them can be cumbersome.

"Clearfsimport" is a powerful utility - you can simply do a Recursive Filesystem compare between your VOB and your working directory--->all the rest is taken care of. ClearfsImport will determine what files are newelements(add them to src control), what has changed and update the changed files without the need to checkout and checkin files.
Works great----especially if you work on a lot of code , you don't want to spend an entire day figuring out what to checkin and checkout.

syntax for clearfsimport:
cd to your VOB dir(note you should be in your VOB dir while running clearfsimport)
clearfsimport -preview -recurse -follow -nsetevent your_working_dir .
(the above command will give you a preview of what is going to happen)

clearfsimport -recurse -follow -nsetevent your_working_dir .
will get your VOB in sync with your working dir.
link
gram77's gravatar image

gram77

Celarfsimport as described above does not do a vob element to vob element transfer, it updates the vob with contents of your working directory.
link
gram77's gravatar image

gram77

I would rather go with the clearfsimport script, better equipped to import multiple times the same set of files, and automatically:

add new files,
make new version of existing files previously imported (but modified in the source set of files re-imported)
remove files already imported but no longer present in the source set of files.
make a clear log of all operations made during the import process.

So if your 'zip-file delivery needs to be updated on a regularly basis, clearfsimport is the way to go, but with the following options:

clearfsimport -preview -rec -nset c:\sourceDir\* m:\MyView\MyVob\MyDestinationDirectory
link
gram77's gravatar image

gram77

The clearfsimport command reads the specified file system source objects and places them in the target VOB. This command uses magic files to determine which element type to use for each element created (see the cc.magic reference page). The source and target directories may not be the same; to create an element from a view-private object that already resides in the target directory, use mkelem.
Examples:
1.Preview a VOB—/vobs/projectx/src—that is to be populated with the contents of /usr/src/projectx. Recursively descend all directories encountered and follow UNIX or Linux symbolic links to the target objects.
clearfsimport –preview –follow –recurse /usr/src/projectx
/vobs/projectx/src
2.Convert a .txt file to an element and place it in the VOB lli_vob1.
D:\lli_work>clearfsimport Reqpro_setup.txt M:\lli_nt_view\lli_vob1
Validating directory "M:\lli_nt_view\lli_vob1".
Creating element "M:\lli_nt_view\lli_vob1\Reqpro_setup.txt".
version "\main\1".
Closing directories.
Checked in version "main\1" of directory "M:\lli_nt_view\lli_vob1"
link
gram77's gravatar image

gram77

well, you made me stumble on a very useful utility, but this does not transfer vob-to-vob, but file system to vob
link
gram77's gravatar image

gram77

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 05/19/2011 03:44

Seen: 468 times

Last updated: 06/24/2011 10:40