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)
Related
In our continuous integration we use ClearCase UCM. We occasionally need to access the sources from the recommended baseline (which not necessarily equals the newest baseline). Note: All baselines are full.
I figured out how to access the sources belonging to the recommend baseline manually, by entering cleartool edcs in the command line within the dynamic view and adding the line element * MyRecommendedBaseline below # Select checked out versions, saving and closing the text-file.
Unfortunately I don't know how to do this from a script. One way I could think about is read the contents of the config_spec into a stream, add the line, save it to a new text file and use "cleartool setcs newcs.txt".
But apart from being cumbersome I'm not exactly sure if this is possible. Anyone knows a simple way to do this?
You can script listing the recommended baselines of a given stream: see "How can I list the recommended base line in ClearCase"
On Windows:
cleartool descr -fmt "%[rec_bls]CXp" stream:streamName#\aPVob
On Unix:
cleartool descr -fmt "%[rec_bls]CXp" stream:streamName#/vobs/aPVob
From there, you can generate a new file with simple rules:
element * MyRecommendedBaseline1
element * MyRecommendedBaseline2
...
And you can setcs that file to a dedicate base-CC dynamic view (not an existing UCM view).
As Brian Cowan points out in the comments, this only works because those baselines, as the OP mentions, are full baselines (not incremental or not-labeled, like deliverbl are).
See also "What is the difference between Full baseline and Incremental baseline in Clearcase UCM?".
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.
I have to verify whether any elements are changed in a component vob after the last baseline in applied.
I was trying to find the cleartool command for that but i got upto "finding the list of files changed after a particular date " .
Is there any way to get the list of files changed after the last baseline applied?
One of the fastest way would be simply to try and make a baseline(!)
If nothing has changed, by default, ClearCase UCM will refuse to make one.
If one has change:
a/ You can compare the newly created baseline with its previous to get the list of versions modified:
cleartool diffbl -pred -ver newBaseline#\aPVob
b/ You can delete that newly created baseline if your intention was not to create one right away.
Another relatively fast way (since adding/removing a baseline can take time on a large component, or where there are already a lot of baselines) is:
"Find files in Clearcase view newer than a specific date?"
If you have the date of the last baseline, you can launch a search for newer version:
cleartool find <vobtag>/<component_root_dir> -element "{created_since(target-data-time)}" -print
To get the latest baseline, see "List the latest baseline of a component in a UCM stream one by one".
The date can then be obtain with an fmt_ccase directive:
cleartool describe -fmt "%d" aBaselineName#/aPVob
The best,simplest and easiest way to do that is by creating a view in that baseline and then give a cleartool rebase -recommended .Once you do this just give cleartool lspriv -co This will give you list of all the files that have been modified after your baseline in which you created the view.
I can compare two files in Winmerge by triggering a comparison on the command line with a command similar to:
WinMergeU C:\file1.txt C:\file2.txt
I can query a list of files with particular properties in clearcase with a clearcase query similar to:
Y:\VOB_A>cleartool find . -type l -exec "cleartool describe -fmt "%n %[slink_text]Tp\n\n\" \"%CLEARCASE_PN%\""
.\Directory\createsymlink.txt -->..\..\VOB_B\SymlinkFolder\createsymlink.txt
What I want is to generate a set of clearcase query results that can then be used as input to winmerge (ie generate a bunch of diff commands on checkins fulfilling a certain criteria like user or day).
How can I write a clearcase query to get a list of file elements (referable in clearcase ie winmerge could open the path to the version on a dynamic view), and get their corresponding previous version of the file?
The bit to format this to winmerge I imagine would look somewhat like this:
... describe -fmt "WinMergeU ...
One, you would need to generate the right full extended pathname for each file (one being the result of your query, one being the previous version of the one found by said query)
Two, you need to do so in a dynamic view (in order to access to any version though the extended path name of the file.
Once your query gives you a version, you can ask, with a cleartool descr -fmt "%PSn" (see fmt_ccase man page), for the previous version and add that to your result file.
Trying to do it all in one pass (find + predecessor version + WinMerge call) seems too complicated.
I need to retrieve a list of all the files that have been checked-in across baselines along with the owner name. I tried using the cleartool lsact command :
However, this command fetches just for one task and is a bit cumbersome to use. Is there a command which will retrieve all the tasks if I specify two baselines?
Thanks
A command like:
cleartool diffbl -act bl1#\apvob bl2#\apvob
will give you the list of activities which have new versions between baselines bl1 and bl2.
However, to get the list of files (ie elements, as in files or directories, and not versions as in all the updated versions even for a same file), the best way is to:
ensure those baselines are "full" baseline: promote them to full if needed:
cleartool chbl -full bl1#\apvob
cleartool chbl -full bl2#\apvob
(if they were already full, this command won't do anything)
list all elements which have the bl1 and bl2 labels on different versions:
cleartool find -all -element '{lbtype_sub(REL1) && lbtype_sub(REL2)}' ^
-version '{(lbtype(REL1) && ! lbtype(REL2)) || ^
(lbtype(REL2) && !lbtype(REL1))}' -print
See "Find changes between labels".
Note that this last question also mentions the "report builder packaged with ClearCase, which is interesting if you are after a solution involving a GUI and not a CLI (command line):
Again, if those baselines are full, you can use it to list (under Elements/Labels) either "Elements Changed Between Two Labels" or "Versions Changed Between Two Labels" depending on which you need.