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.
Related
I need to modify a Simulink project stored under clearcase. From this project I must generate the C code, but this not the problem. The problem is that all generated files (*.c and other) are saved into clearcase and the code generation delete some file without overwrite the old version with new. Fortunately seems only for files different from *.C but in any case under clearcase (I use a windows client) I found in correspondence of deleted file:
the file name
three colored question marks
I think that clearcase has the information regarding the file stored but is not able to allocate this.
Now I need a command/script for CC which help me to found ALL removed files from the view because the project structure is very complex and a manually search is hard.
Thanks for any suggestion
"three colored question" marks means "checked out but removed", as in this example (you can recover from it by reloading the snapshot view)
If an automatic process is generating or deleting files in a snapshot view (it wouldn't be able to do the same in a dynamic view), then you should end up with a bunch of hijacked files (as identified in a snapshot view).
You could check them out and check them in.
For the files that need to be deleted, you can follow "What's the “proper” way to delete files from a ClearCase snapshot?".
But both process are manual and doesn't scale well.
There are two viable options:
1/ Don't version what is generated (you can re-generate it at any time)
2/ If you must version what is generated, then:
generate it outside of the snapshot view
use clearfsimport to import the result of that generation into the snapshot view: that will checkout the right files and will delete the files that are no longer generated.
That would be the right solution for "w I need a command/script for CC which help me to found ALL removed files"
So the joyful sys admins like to lock down the vob between 9p-7a for backups... why, one can only speculate and loose hours of productivity.... oh wait that is happening anyways since the vob is locked for ... 10 hrs... anyways I digress.
So I recently started using dynamic views and have been pleasantly surprised at how useful it has been with constant integration. But with my old snapshot views when the vob was locked I could always hijack a file and convert it to a check out later, but that is not allowed in a dynamic view so following the following post:
ClearCase: Can I hijack a file in dynamic view?
I've managed to 'hijack' or eclipse said files to continue working, but now comes the question... what is the easiest way to convert said eclipsed files to checkouts?
In a snapshot view with a hijack you simply pass the '-usehijack' flag to the co command, but how do you do this with a eclipsed file.
I can remove the file and get the original version back, but then I'd lose my changes.
The only way I can think of is to move the file elsewhere, let clearcase replace the file, then checkout and copy the file back, but is that the only way?
Thanks to all in advance.
You need to:
rename the file
checkout the original file (no longer eclipsed)
overwrite the checked out file with your copy.
A bit cumbersome, but scriptable.
It's been a little while, and I don't have ClearCase access anymore, but I think that a 'cleartool co -nodata' might do the trick for you.
We have a current set up of VOB such that source code and documents reside in the same VOB.
To reduce the VOB download time we now want to move the documents to a new VOB, so that only the code part remain in the old VOB.
Since there are lot of folders and files, its not possible to manually relocate each file/folder.
To do this, we need to write a script which will detect file types by their extension and move file types such as .doc,.pdf, .txt to the new VOB.
VOB server is Windows Windows 2008 R2 Enterprise edition.
I'm a novice!
Can someone help me out with the script?
Thanks
Nush
The process would involve cleartool relocate: see "Relocating elements to another VOB".
The best practice is to:
group all the right elements you want to relocate in one folder (cleartool move)
remocate that folder
It is best if what you want to split is cleanly group is one folder structure.
Note that relocate wouldn't work if you are using ClearCase UCM though.
See this article:
The reason for this restriction is immutable baselines: if an element has ever been in a baseline, it can never be moved to another place; the baseline needs to know where to look for it. So a UCM element really can't be relocated.
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
I'm looking at a scenario where I have an offline clear case view and I modify files in this view clearing the read-only attribute (hijacking) on the files I modify then several days later I take the view online and need to get my offline changes into the stream.
What I would do is check out the hijacked files and check them back in (merging when necessary).
Is it always safe to work this way?
Is it possible that while adding my changes I would accidentally overwrite other people's changes done while I was working offline?
Any recommendations on how to use ClearCase offline?
Thanks!
(I'm asking because a college says that this offline way of working can lead to overwriting other's changes, specifically in cases when one updates ones view after working offline for a while before converting the hijacked files into checkouts. He says it won't event propose to do a merge in some cases, just completely overwrite the contents of the element being converted with the contents of the hijacked file)
No you won't override anything while working offline.
ClearCase has a reconcliation mechanism for a snapshot view, which, when you get back online, will allow you to:
search for all hijacked files
checkout those files
then checkin them, which is when ClearCase will prompt you for a merge, if any new version has been done on that file during your time offline.
That merge will be a three-way merge with:
root version: the version before any modification by you or other
source version: the matest checkin version (done while you were offline)
destination version: your current file
What about setuping a private branch, working on it, hijacking there files and then merging your private branch on the main branch?