I have a large number of files that I am trying to check in. This process needs to be done several times and is time and resource consuming. I am using the follow command to do this:
cleartool lsco -cvi -all -s | awk '{print "cleartool ci -c \"<Name of checkin>\" " <path to vob> | sh
This command does work, but it takes a very long time to run, as each file is checked in individually. Is it possible to checkin all files at once, or perhaps a faster method of checkin in the files individually. Is it possible to use the same concept, but for a mass checkout?
As I mentioned in "What are the basic clearcase concepts every developer should know?", ClearCase remains a file-by-file VCS, meaning each operation (checkout; checkin, merge) is done file by file.
clearfsimport remains one possible "bulk" operation (even though behind the scene, it will still checkout or mkelem for new files, copy, and checkin the files one by one)
That means you can use one view as source folder (clearfsimport will import any folder, ClearCase view or not), and a snapshot view with the same config spec as destination. See "ClearCase, use clearfsimport to perform brute force update" and "How can I use ClearCase to “add to source control …” recursively?".
With the -rmane option, it will even remove files which are no longer present in the source folder. See "Remove unused source code files".
Related
I had to deliver some code(a folder and some files inside) from an activity A from dev stream to int stream in ucm clearcase. before delivering I renamed the folder using another activity B and changed some files inside. Now, While delivering from dev to int, I cannot find A and B as undelivered work.
Please advise how to resolve. let me know if any other information is required.
The usual workaround would be to a non-UCM merge by activity, instead of an UCM deliver (which is not listing the expected activities), using cleartool findmerge.
See "How to merge changes from a specific UCM activity from one ClearCase stream to another"
cd /path/to/myView/myFolder
ct findmerge activity:B#\pvob -fcsets -c "deliver B" -merge -gmerge
See also "how to merge new folder from a sub branch to the main branch in clearcase?".
I am attempting to check in hundreds of new files in Base ClearCase. Due to network and server issues, I am wanting to write a batch script of cleartool commands to add each file to source control. All files will be checked in under a single ClearQuest task.
I have tried selecting all the files and adding all at once via the context menu, but after selecting the ClearQuest task association and choosing "apply to all", I am still having a dialog box pop up for every file, asking me to confirm the association.
I want to write a list of commands like:
cleartool mkelem -c "SCR ... / TASK ... - blah blah" filename.ext
However, I don't know how to associate the change with the TASK, and I don't see any documentation for doing this in Base CC/CQ.
First, don't write a script adding new files throug mkelem: if you can isolate those files in their own folder (or tree of folders) outside a view, then you can import them into a view (snapshot or dynamic) through clearfsimport.
clearfsimport is made for that, and will checkout the parent folder of the files to add, and do the required mkelem for each file for you.
See also "How can I use ClearCase to “add to source control …” recursively?"":
clearfsimport -preview -rec -nset c:\sourceDir\* m:\MyView\MyVob\MyDestinationDirectory
You will need first to use cleartool settask in order to set the ClearQuest task for the destination view used for this import.
See "How to configure base ClearCase to use the Change Management integration with ClearQuest".
As the OP Darthfett adds in the comments:
However, as I am using ClearCase 7.*, there is no settask command.
As a workaround, it looks like using set CQCC_AUTO_ASSOCIATE=<TASK ID> will work (see here)
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".
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.
Hi I wanted to know if there is a way to do cleartool findmerge without creating .contrib files. Its a nuisance to have to remove them after merging.
It depends on your version of ClearCase and type of merge, as detailed in this technote:
The .contrib files are generally used to compare the file's previous contents with its new after-merge version; moreover, these files are view-private and can be removed.
There has been discussion around the ability to allow the end-user to disable/enable the .contrib creation; however, with UCM, since all checkouts involved in deliver or rebase activities are reserved, there is no chance of loss changes as a result of the merge.
The .contrib file, in regards to UCM, does not serve the same purpose, or hold the same significance as with base ClearCase.
Change request (RFE) RATLC00608266, was opened to improve the logic used for leaving .contrib files after a deliver or rebase operation. There is no danger for loss of data as a result of the .contrib not getting created.
This behavior has changed in ClearCase 7.0. where feature level 5 was introduced. When using the native client, contrib files are no longer generated when merges occur during deliver and rebase (the Rational ClearCase Remote Client continues to create and use these files)
So with CC7.x and for deliver/rebase types of merge (ie UCM merges), you can aboid the contrib files.
Not with CCRC or base ClearCase merges (which is used by a cleartool findmerge).
That is why that same technote details ways to remove multiple .contrib files in one command (like for /R %i IN (*.contrib) do del %i or del /s *.contrib* for Windows).
While at home for personal projects i use Mercurial, at work we're using ClearCase.
I am attempting to run a few horizontal (touching lots of source files) refactorings in Visual Studio for the code base, however, for since each file is locked by ClearCase, it has to be unlocked and prompts for the actual activity that the check out is for.
In Mercurial, there's no such concept as far as i'm aware of: files are not being locked at all at any point of time!
Is there a way of doing such a refactoring, or any other operation that acts on multiple files, without having to check out each and every one manually?
In a DVCS (distributed VCS like Git or Mercurial), you simply cannot "lock" a file, since all the other repos wouldn't be aware of such a "status".
But with ClearCase and its locking mechanism (optimist with "unreserved checkout" or pessimist with "reserved checkout"), you need to make a checkout to tell ClearCase you will modify some files.
However, you could also, for large refactoring:
make and update a snapshot view
set all the files as writable (through an OS-based command, not through ClearCase "checkout")
perform your changes
search for all hijacked files and checkout/checkin those files then