with ClearCase UCM I can create a baseline in a snapshot view directory. When not all files are up-to-date, which version of a file is included in the baseline?
Example: version 3 of foo.txt is located in the snapshot view directory and there already exists a version 4 of this file. Which version of the file is referenced by the baseline?
Does this depends on the version of ClearCase (I am using ClearCase 7.1)? Do I have to consider something?
Background of the question: for a continuous integration build I want to use a snapshot view. When during creating or updating the snapshot view an other user checks in a file to the same stream this new version may or may not be part of the snapshot. At least I want be to be able to identify which files in my snapshot directory have been used by the build.
About Baselines: A mkbl depends on the selection mechanism (the config spec)
of the local access mechanism (snapshot or dynamic view) providing said selection mechanism.
For each element in the component, the baseline records the version of that element selected by the stream's configuration at the time mkbl is executed.
So the -view parameter is only there to reference the Stream (and its associated config spec):
-vie/w view-tag
Specifies the view from which to create baselines. Baselines are created in the stream that the view is attached to.
For example, if you are working in coyne_dev_view, but want to create a baseline from the configuration specified by the view coyne_integration_view, use -view coyne_integration_view.
This option creates a baseline in the project's integration stream that includes all the checked-in versions contained in coyne_integration_view.
If you do not specify view-tag, the current view is used.
In your case, if your UCM view is supposed to select v4, but is currently selecting v3 because that snapshot view hasn't been updated yet, the baseline should reference v3 (what is currently selected by the view).
So for your background question, best to perform a cleartool update before the mkbl.
Related
I want to copy the contents of the integration stream at a certain baseline to a directory outside CC using command line, ie. I want to "export" a baselined version to use a Subversion term. I think the way to do this is to set the view to show the contents of the baseline and perform the copy - or is my thinking wrong for Clearcase? I'm more of a SVN/Git user :)
How can I set a baseline for a snapshot view of an integration stream on command line?
I'm using Clearcase UCM in Windows environment.
If the baseline has been created on that integration stream, you can:
create a child stream (immediately below that integration stream)
rebase it with any of the baselines created on the parent (integration) stream: chose the one you are after
create an UCM snapshot view on that child stream
The content of that snapshot view will be the one of the baseline you wanted to select.
Currently we use ClearCase UCM.. I am trying to evaluate possibility of using git in our project. I decided to create large repo with past three years changes from an integration stream. The pvob has 12 vobs under it. For purpose of evaluation(creating a worst case), I am putting all changes into single repository.
I want to create a base clearcase view and then adjust its spec for every baseline on the pvob. This will then synched to git repository.
Question in short: How can I create a base clearcase view given a pvob base line and keep changing its config spec to match every baseline?
(academic note : A picture of what I am trying to achieve.. )
(Approach discussed in ClearCase UCM: Is it possible to have a temporary view on any given baseline? is kind of work around in my case. I guess I can avoid the step of creating many temporary streams- not sure how!)
I am putting all changes into single repository.
This isn't the right granularity for a git repo.
Having done multiple ClearCase to Git migration, the right scale usually is one UCM component equals one Git repo.
How can I create a base clearcase view given a pvob base line and keep changing its config spec to match every baseline?
You don't have to create a base ClearCase view.
You can create a sub-stream to the Int stream, and manage the baselines you want to see there.
(cleartool rebase -bas xxx#\YourPVob)
You can then use an UCM view to that sub-stream as a source for your git import.
If that approach isn't possible (as I explained in my previous answer you mention, because for instance all baselines haven't been created in the same parent stream), then you can create a base ClearCase view and modify its config spec in order to select the baseline complete ids:
element * BaselineId1
element * BaselineId2
...
(A dynamic view here is more useful to tweak the config spec.
Once the config spec is set, you can update a snapshot view with the same config spec, and appropriate load rules, to use it as a source for your git import).
You need to make sure those baselines are:
full baselines (you can promote an incremental one to a full one)
referenced with their id (not their title, which is their visible name).
See also "Display Current Baseline with Cleartool":
cleartool describe -l baseline:aBaseline#\aPVob
cleartool descr -fmt "%[found_bls]CXp" stream:myStream#\myPVob
The second command would give you all baselines in a stream.
In both cases, you would see the baseline ids in addition of their names.
I have mention the ClearCase to Git migration aspect in :
"Migration from UCM ClearCase to GIT"
"How to integrate ClearCase development history into Git?"
"Save history from ClearCase to Git?"
"How to bridge git to ClearCase?"
"Sync GIT and ClearCase"
A good trick is to use:
git --git-dir=/path/to/git/repo/.git --work-tree=/path/to/ClearCase/view add .
That allows you to consider the ClearCase view as the working tree of your git repo (which is the destination of your import).
I generally don't try to import all baselines from all streams because it is too complex too soon (in order to get the sequence of those histories right).
I just get a few baselines from the main stream, import them and go from there (keeping the ClearCase referential as a read-only archive source for history research).
I have done a mistake by not applying baseline for one of my release.
Now some more changes were done in the integration stream. Is it possible to apply baseline for particular past day's changes.
We are using Clearcase UCM.
You can do it... but not easily on the same branch.
You can create a non-UCM view with the files at the versions referenced by your earlier date (see "Label ClearCase Content As Seen On A Given Date)")
Then you can create and apply a label on all the versions visible in that non-UCM view
Then create a baseline by importing the label
However that will create a baseline on a separate branch, and not on the current stream.
that is not good, as you won't be able to compare that new imported baseline with all your other baselines (because they won't have any common ancestor).
The only way to easily create your baseline on your Stream (and benefit from the comparison with previous baselines) is to use your non-UCM view in order to clearfsimport -rmname the content of that view to your current view, importing all the versions (in your current UCM view) to the right content (ie the content selected by your date in your non-UCM view).
See "Best way to roll back to previous versions without baseline in CC" (and this question for more on clearfsimport).
Do it in a specific activity dedicated to record all the modifications done by that import.
Then you put your baseline.
Finally, cancel that activity, using the cset.pl script: See "Clearcase: how to rollback all changes on specific branch?".
You should get back all the versions you had before making that import.
The drawback is that your history for a given file will reflect a curious 'setback' in the list of versions on the branch of your Stream.
Is there a way to set up a single stream/view that can be used to build releases from any existing baseline (new and old) on any stream of a ClearCase UCM project?
What I usually use is a base ClearCase dynamic view, in order to quickly change baselines in its config spec.
A baseline is a label put on every files of a component, so the config spec would be:
element /vob/Component/... MY_BASELINE
element * /main/LATEST
Note that it will only work with fully labeled baselines (and not incremental baselines)
You can use also a snapshot view, for the compilation will be quicker (but you will have to support the update download time)
How Can I Revert to Earlier baseline? We have a UCM parallel development(multi-stream) project. Each developer have a snapshot view on Project's Integration stream.
Developers want to see earlier version of the application in their snapshot views so They can debug early version of application to find bugs.
When I want to change an existing snapshot views's foundition baselines, clearcase does not allow me. So How Can I do this?
Since you employ the term Baseline, I will assume you are using UCM.
On a stream, you can not revert backward a baseline.
One possibility is to make a parallel stream, with the desired baseline as foundation: this is the quickest way.
After changes on this new stream, you can make a new rebase to change the foundation baseline, but only if that new rebase is using a more recent baseline from the parent stream (not an older baseline)
For your specific need, I would recommand a non-UCM snapshot view with a simple rule
element * thePreviousBaseline
In order for the developer to have:
his/her current UCM view for development (always set on the LATEST of a branch associated to a stream)
a second snasphot view set to whatever baseline he/she needs.
That second snapshot view is completely not-related to the UCM project and takes advantage of the "full" nature of the baseline (do check that your baseline has been put as "full", not "incremental". If it is "incremental", simply change its type and upgrade it to full)
So, beside your current snapshot UCM view, you can create anywhere you want a non-snasphot view:
cleartool mkview -snap -tag mylogin_myComponentname_csl_snap -vws myPathToViewStorage myPathToRootView
cd myPathToRootView
cleartool edcs
[add the selection rule: element * myOlderBaseline]
[add the load rule at the end: 'load /myVob_Including_MyComponent]
[save, type 'yes']
That is fine for consultation/execution, but if you need to patch (that i is to write, check out and in some files), then I would recommend one UCM stream per baseline to be patched.
That way, the stream clearly represents the patch effort for a given baseline. There should not be too many of them, unless you put into production a new version of your application every five minutes... which is not advisable ;)
So to summarize:
the non-UCM snapshot view is unique and serve for a quick consultation/debug of one older baseline at a time.
for patches (source modification), you create a parallel stream properly named, with the correct foundation baseline, and then a UCM view on it. You can not only debug but also fix some bugs in an activity, the deliver that activity to the main Int stream if that bug need to be retro-fitted on an higher stream.
(note: all bugs do not always need to be delivered: they can be obsolete when compared with the current state of the development)
The way I have solved this problem is by making another Stream, a child Stream of the Integration Stream. The easiest way to create this Stream is to open ClearCase Project Explorer (not Rational ClearCase Explorer) and navigate to the Project and then the Stream in question. Right click on the Integration Stream and select "Create Child Stream..."
Click "Advanced Options" and select a baseline for each component. Do this by selecting the component and then selecting "Change..." and selecting the specific baseline you want to see. You probably want to select "Prompt me to create a View for this Stream." Select "OK".
Any developer can do this. You don't need to be a VOB owner or Project or Stream owner.
Well, it depends. Actually, the answer lies in setting up your config spec to point to the proper files. Your config spec tells your view which versions of elements to look at. But how you do write it depends on your project's approach to baselines. Did you apply a label to mark that baseline? If so, and if you only want to read and not checkout anything new, your config spec can be as simple as
element * <LABELNAME>
If you didn't use labels, you can also set up your config spec to show you files based on dates. It gets more complicated the more rules you need to add to constrain your element choices. If you have more specifics, I can try to elaborate on what rules you might need. Otherwise, I would read the manuals that come with ClearCase. If you view the Extended Help from ClearCase Explorer, and then do "Viewing Rational ClearCase Manuals On-Line" it should give you some links to the Command References. This is where I go whenever I need to modify my config spec in some new way.
Also, note that we only use dynamic views, so I don't know if snapshot views work differently.