ClearCase: how to list the text all the commit messages? - clearcase

I believe this is a simple question: I want to find which files were modified when I fixed a bug. I know some words in the commit messages. In other version control I'd list all the commit messages and grep for my correction. Something like:
svn log|grep -C 10 'Access Violation'
I can't find in ClearCase how to do the simple task of listing all the commit messages of a stream. I want to see also the commit messages of the child streams. Can someone help me?

That would be because there is no "commit message" per se in ClearCase.
each file can have its own comment when checked-in
the UCM activity in which you are checking in a file has its own comment
the UCM baseline which will include several activities has its own comment.
So, for instance you can list activities (as I illustrate in "how to find the list activities delivered to integration stream on a particular day?"):
cleartool lsact -r -in stream:aStream#\aPVob -fmt "%n %c"|grep "Access Violation"
and grep on their comment message, using the fmt_ccase format to display the associated comment (with %c).
Note the -r (recursive) option, which will include activities from the child streams.

Related

How to get unique changeset using cleartool command?

I am trying to get the changeset of an activity.
"cleartool lsactivity -l Build-Activity.1278"
I have used the above command . But the problem is if a same file has more than one checkin ,it shows all of them and also it shows check-in made in child stream as well as in Integration stream.
I just need to see the files affected by this activities in integration stream. I don't want each version details.
How to format and get the only file list in integration stream with only the latest version?
cleartool lsact should only show version done in a stream, since an activity is always linked to an UCM stream.
You could use fmt_ccase to display only the versions:
cleartool describe -fmt "%[versions]CQp" activity-title#\aPVob
And process the output to remove the ##/main/... part (the extended path) in order to leave only the element. Then pipe the result to the command 'uniq' in order to eliminate duplicates.
For example, for each version listed, you can do a cleartool descr -fmt "%En" /a/version##/main/... in order to get the element name.
cleartool lsact -fmt

How to find activities of a modified files in Clearcase

I have a file test.cpp somebody added a few lines of code i don't know when but i'm assuming it was in a specific range of time that i know.I want to find the activity that was used to deliever this changes, i found a lot of versions of this element in the version tree of this element, but all the activities that i was able to see were as a result of a rebase, i need to find the source activity that was in charge of adding this few lines of code.
Is there any way to do that ?
For each deliver activity (that you can see in the version tree), you can list the contributing activities with
cleartool lsact -contrib activity:anact#/apvob # on unix #/vobs/apvob
See "Finding which developer activities were delivered in a specific delivery"
Then you need to describe each activity found, to see if your file is in it.
cleartool descr -l activity:anact#/avob
Obviously, you also can use a cleartool annotate, in order to see the versions in that file: see "How to use ClearCase Annotate".
If you see one line which interest you, check its version n# 'x' and use cleartool descr -l file#/main/.../x to find its corresponding activity.

Find version and delete it with Cleartool

I'm trying to recursively delete some versions/files from a specific branch.
find delivers the right files. Now it would be up to rmver to remove the version but this gives me an error. I'm struggling with the syntax.
cleartool> find Component\Test -element "brtype(P_Testing_device)" -exec "rmver -f \"%CLEARCASE_PN%##\main\G_Testing_device\P_Testing_device\LATEST\""
cleartool: Error: Extra arguments: "%CLEARCASE_PN%##\main\G_Testing_device\P_Testing_device\LATEST\"
What's wrong with that?
How would you recursively delete versions from a Branch?
First don't if you can avoid it. rmver, as I explain in "How do I undo a checkin in ClearCase remote client", is very dangerous.
If you have hyperlinks attached to the versions you are removing (definitively from ClearCase), like merge links (deliver or rebase links of your are using UCM), you risk ending up with many "dangling hyperlinks", which is not good.
Second, I would try first:
find Component\Test -element "brtype(P_Testing_device)" -exec 'rmver -f "%CLEARCASE_PN%##\main\G_Testing_device\P_Testing_device\LATEST"'
To rule yout any issue with weak vs. strong quoting (as in "CLEARCASE_XPN not parsed as variable in clearcase command")
If that doesn't work, I would recommend finding all the right versions and putting them into a file, then piping the content of that file to a cleartool rmver.
A much safer route is to cleartool lock -obs the branch, making it non-modifiable and invisible for the future version trees.

Manually undo delivery in ClearCase

I currently have a jacked-up delivery from a child stream to a parent in ClearCase. If I try to undo the delivery it tells me I can't because the "integration activity has checkins" or "checked in versions".
If I try to resume the delivery it says it encountered an error attempting to checkout or merge an element, but doesn't specifically tell me which one.
So I'm looking for a way to either:
Manually stop the delivery (undo all checkouts in the parent stream?)
Find out what element is causing the delivery problem (is it same as the one causing the undo problem)
or Find out what element is causing the undo problem and find a way to undo the checkin (I don't know how to do this. I tried to delete a version in the version tree, but I don't have permission).
For 3/ "Find out what element is causing the undo problem", this is easy (but not recommended): you need to remove all the checked-in versions done during the complete phase of the deliver.
And that is by far the most dangerous solution, especially if any type of activity (other checkins, baselines, ...) has been done on the destination Stream (the stream to which you are delivering file, ie the Stream with the view you are using to deliver to)
You can see those checked-in file by describing the deliver activity (which always starts with deliverbl.xxx)
cleartool descr -l activity:deliverbl.xxx#\myPVob
1/ and 2/ are linked.
A good solution to easily detect the issue is to resume the deliver graphically: open the ClearCase project Explorer (clearprojexp), right-click on the source Stream and select deliver (Baseline or Activities, to default or alternate target: it doesn't matter).
ClearCase will detect that a deliver is in progress and will propose to resume.
All you need to do is check all the files with a red circle and white cross (not the files with a yellow warning sign, those are not blocking the deliver).
Once you have one of those files, right-click on it, and select "display element merge": you will have a more precise error message that you can copy-paste.
If those files are in lost+found directory, all you need to do is to edit the config spec of the view used for the deliver, and add a non-selection rule to avoid selecting anything from lost+found:
cd /path/to/your/view
cleartool edcs
#add at the start of the config spec
element /myVob/lost+found/... -none
Then resume again your deliver, and you will see that those 'lost+found' files become ignored (with a warning non-blocking status attached to them).
If those files aren't in lost+found and are failing the deliver because of "Not a vob object <directory name>", the first check to do is to go to the parent directory of said files in a shell session and type cleartool ls: you will see their status.
In this case, the OP Ian reports them as hijacked, so it was simply about undoing their hijacked status.
He reports also having to delete (rmname) some binary files, although my answer to the question "Clearcase UCM is trying to merge pdf files" is pointing to an alternative solution (copy merge).
My recommendation: in that particular state (deliver with checkins already there), try hard to complete the deliver, not to cancel it.

How to find new undelivered files for a given UCM "stream"

We use UCM for development. We create streams under streams, like this
Question is how to find new files in a given stream.
In the example "feat1" would have new files relative to its parent lis1 (lis=local integration stream). The new files could be from "feat1" or its child streams like "developer1". How could I identify new files in lis1?
One option is to create dynamic views on a stream (say feat1) and its parent stream(lis1) and take diff and figure out files new in the child stream.
Another option is to use cleartool deliver -preview and get list of versions and then somehow (I do not know it yet) figure out the list of files.
The problem is the child stream is not necessarily rebased to its parent, and we enforce a "rebase to latest baseline before delivery" rule.
I hope there is a better and correct way :)
I don't think a cleartool deliver -preview (like its non-UCM equivalent cleartool findmerge -preview) would display the full list of modified/new files.
For new files, it would only display the directories that need merges (in order to reference or un-reference the files added/removed during that merge).
One way (without using an external diff tool) would be a cleartool find request in order to find any file:
with versions in a 'developer1' branch
without any versions in a 'lis' branch
Something like (not tested):
cleartool find . -type f -version "brtype(developper1) && !brtype(lis)" -print
In the OP Jayan's case:
cleartool find . -type f -element "brtype(developper1) && !brtype(lis)" -print
Will list only the needed elements (ie files, and not all the versions of those files)

Resources