I have read this and run the below command :
cleartool lsact -r -in stream:aStream#\aPVob -fmt "%n %c"
After running this I got :
SOLNSxxxx Created automatically as a result of 'Work on' action in ClearQuest
I didn't get this as I am expecting the comment message against every activity and files checked-in in activity with commit message.
And will this change anything in clearquest too ?
Please let me know.
as I am expecting the comment message against every activity and files checked-in in activity with commit message.
No, that would return the name and comment of the activity only, not of its change set versions.
See "How to find files associated with a ClearCase UCM activity?": for each version return, you would need to apply a cleartool descr -fmt "%n %c"
Try (not tested)
cleartool describe -fmt "%[versions]CQp" activity-title#\aPVob |\
xargs cleartool descr -fmt "%n %c"
If the first describe list all versions on one line, use:
cleartool describe -fmt "%versionsCp\n" activity:<your activity>#<your pVOB> | perl -pe 's/\,\s?/\n/g'
# or
cleartool describe -fmt "%[versions]CQp\n" activity:<your activity>#<your pVOB> | perl -pe 's/\,\s?/\n/g'
Related
How to list the ClearCase versions including the author of each change ?
I tried lsvtree -all which doesn't give me this information.
Check the different options available with fmt_ccase, include "%n %u": %u is for user.
The doc mentions:
Note: In commands that output data on multiple versions, such as lshistory and lsvtree, formatting is applied to each version, not to the command output as a whole.
However, since lsvtree doesn't support fmt, you can fallback to lshistory:
cleartool lshistory -fmt "%n %u\n" afile
I have an integration stream in ClearCase. I want to get a list with the names of all of its child streams that aren't marked as obsolete. Which command should I run?
A simple cleartool lsstream -tree myIntStream#\myPvob should be enough.
(Unix: cleartool lsstream -tree myIntStream#/vobs/myPvob)
As mentioned in cleartool lsstream:
Default
Lists only nonobsolete streams.
neves adds in the comments:
This also list all the activities of the stream. I think it is necessary to pass something the fmt option. I'd like just the name of the streams.
As I mention in "cleartool lsstream -tree get only list of child streams" (using fmt_ccase):
cleartool describe -fmt "%[dstreams]CXp" stream:myStream#\myPVob
The OP neves mentions in the comments having just the names with:
cleartool describe -fmt "%[dstreams]p" stream:myStream#\myPVo
I am a new user to Clearcase/CCRC :
I want to learn using cleartool commands in windows platform for CCRC.
I have created a snapshot view using CCRC.
I want to search for a first occurence of a string in a file (in all the branches) using cleartool command.
For eg :
If a func name XXXX is introduced in File Y at version 10, then i want the command which will search for the function XXXX (in file Y) from base version till the version the function is introduced and should output me as version 10.
Please help me to do this.
Once your snapshot view is loaded, you don't need a cleartool command.
You can use a simple grep command in order to search within the files.
A cleartool find command would be useful to search for a string within the message comment of a version of a file, not for the file content itself. See those examples
UNIX/Linux:
cleartool find -all -ver "! lbtype(<non-existing label>)" -exec 'cleartool
desc -fmt "Version: %n\tComment: %c\n\n" $CLEARCASE_XPN' | grep <the string
you are looking for>
Windows:
cleartool find -all -ver "! lbtype(<non-existing label>)" -exec "cleartool
desc -fmt \"Version: %n\tComment: %c\n\n\" %CLEARCASE_XPN%" | findstr "<the
string you are looking for>"
For a given file, you can list all versions with fmt_ccase:
cleartool find -name "yourfile" -exec "cleartool desc -fmt \"%Ln\" \"%CLEARCASE_XPN%\" && cleartool diff -pred \"%CLEARCASE_XPN%\"|grep XXXX"
(note: on Windows, you can use grep with GoW: Gnu on Windows)
The idea is to list all versions for a given file, and for each:
print the version (cleartool desc -fmt "%Ln")
diff with the previous version and grep for XXXX
Is there any way to get the composte baseline information from the current view in command line .
I am using the comand in my script. It's displaying the list of the commands which include composite and ovverride component baselines in my view .
cleartool lsstream -fmt "%[found_bls]NXp\n" -view $VIEW_NAME
I need only the composite baseline as output for my command.
Is there any command to findout the composite baseline in current view ? pls help .
I guess your composite baselines are rootless components, so you can check the components and display only rootless. You can use cleartool describe for that.
A composite baseline can list its immediate dependencies, so as described in this script, you can attempt to list those for each baselines.
the one that does return an output (without error) is your composite baseline.
cleartool describe -fmt "%[depends_on]Np\n" {baseline selector}
However, building on my previous answer about "search the output line and save in variable", what you can do is describe each baseline, asking for its dependencies, and grepping for the line which contains an arobase '#':
Only composite baselines will return fully qualified baseline names, with arobase in it, as opposed to a non-composite baseline, which will return... nothing)
cleartool lsstream -fmt "%[found_bls]CXp" -view $VIEW_NAME | tr -s " " "\012" | xargs cleartool descr -fmt "%n %[depends_on]Cp" | grep "#" | sed -e "s/ .*//"
For more visibility:
cleartool lsstream -fmt "%[found_bls]CXp" -view $VIEW_NAME \
| tr -s " " "\012"
| xargs cleartool descr -fmt "%n %[depends_on]Cp"
| grep "#" | sed -e "s/ .*//"
Is there a clearcase command to show me say all the files and the respective committers/activities that have changed in the last X hours/days? Something similar to svn/git/hg log?
Not directly, because ClearCase is file-centric, not repository centric.
So you can make your query for a component or a Stream (list of components+baselines).
For instance, to list all activities for a given stream, you can type (using the fmt option of lsact):
cleartool lsact -fmt "%n %d" -in aStream#\aPVob -user auser
But then, you need to filter on the date to get only the activities you want, and you can the describe each activities in order to get their changeset.
For the files, you can use a find query similar to "Find files in Clearcase view newer than a specific date?":
cleartool find <vobtag> -element "{created_since(target-data-time)}" -print
cleartool find <vobtag> -element "{created_since(target-data-time)}" -exec "cleartool desc -fmt \"%n %u %[activity]p\" \"%CLEARCASE_XPN%\""
Using -fmt options, you can display the user for that version, and the activity whose change set contains the specified version.