how to uncheckout a checked in directory in clearcase - clearcase

I have checked out a directory, modified some files and checked in the directory
Is there a way to revert back the checked in directory and start with original directory
Thanks in advance.

Never delete a version, this is way too dangerous (in that it removes all metadata, and hyperlinks attached to it).
Do a subtractive merge, in order to cancel the contributions recorded in your last directory version.
See in IBM the articles "To remove contributions of some versions".
You can see an example of a cleartool merge -delete in "Undo remove file in ClearCase"

You may try to delete the version. In the version tree, right-click the bubble of the current version and choose "delete". The version tree will automatically refresh and fail to do so, because the version it tries to display does not exist anymore. After an update you should see the old version.
If you have edited multiple files, you will have to do this for each file. I haven't found a way to do this by command line, but then again I haven't looked thoroughly ;)

Related

How find deleted or removed file under clearcase

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"

Provide version to independent files in clearcase

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.

Accidentally deleted page.xml. How do I get it back?

I have accidentally deleted the file app/design/frontend/base/default/layout/page.xml from my directory.
My understanding is that this is the 'default' page.xml file that comes with Magento. How can I get this file back?
You can get the file from:
http://svn.magentocommerce.com/source/branches/1.7/app/design/frontend/base/default/layout/page.xml
If you have an other version of Magento, you might want to tweak with the version in the URL.
You could also redownload Magento and search for the file in the package if this won't work out.
Another way is to just go over to www.magentocommerce.com/download, select the release archive tab, grab the .zip archive for the version you are working with and unzip it into a temp folder. You then have all the files that make up Magento right there stored in the exact same directory tree as exists on your website, very easy to retrieve.
Personally, I keep the archives on hand for the current version, previous version and next version in my upgrade path. That way I always have an easy reference if some code oddity comes up in my custom templates and modules.

updating a file without doing check out in clearcase

In Rational ClearCase. I have updated a file without doing check out, after updating it asked me that it is in read only mode still u want to make the changes , and by mistake I clicked on yes.
After that, I realised the mistake and checked out the file and then checked it in, (say version 4).
Again, I checked out the file and made some changes and checked it in (say version 5).
Now, when I am viewing the version history of that file, this version 4 is not getting displayed, version 3 and then just the version 5, but when I compare version 5 with previous version, then it is compared to version 4.
How can I make this version 4 to appear?
The OP mentions:
I think I have checked in this file in the branch, before updating the main branch file, and so this is causing this problem.
That is probable, and would explain why V4 is not visible in the main branch.
One way to ensure that, is by looking at the cleartool lsvtree (text), but also looking at the result of:
cleartool ls /path/to/parent/directory
(the parent directory of the file)
You can see all the selected version, and compare them with your config spec.
Original answer
This (modifying a file without checkout first) can only be possible in a snapshot view (not a dynamic one), and leads to an hijacked file.
You have correctly resolved the situation by a checkout/checkin.
However, if the version selected at the time of you checkout was not the LATEST (but version 2), then V4 would follow V2.
If you have mixed order versions, one way to get back to a stable situation is to:
update the snapshot view, and check that you are in LATEST on that file.
merge your last modifications (V5) to the current LATEST version
If you have a missing version, that could be because it exist in its own branch (which is not selected by your current config spec). A graphic version tree should display it (with the -all option).
cleartool lsvtree -all --graph /path/to/File

ClearCase: Working offline hijacking files, then checking out / merging

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?

Resources