Using clear case reporting wizard how could i retreive the list of unlabelled files in a branch from a specific date?
You would need first a view configured to select element on that specific date: use a time-based selection rule config spec:
element /myPath/... /main/{!created_since(16-Sep-2009)}
element /myPath/... /main/LATEST
I would recommend a dynamic view for that, as you can easily tweak said config spec until you see the versions you want, and quickly refresh the view after each config spec modification.
Once the view is properly set, you can use:
a simple find query to list all version not labelled with a specific label
or try the ClearCase reporting wizard, after having to select first the appropriate script (which are in C:\Program Files\Rational\ClearCase\reports\scripts, like mentioned in this thread).
I suspect it is easy to configure those scripts to report all labelled versions, I don't know if you can report the "negative" form (all non-labelled version for a given label).
Related
I want to make a new icon and a fuction for clearcase, i want to activate and deactivate the element * MAIN/LATEST function without to change manually the config spec.
I would like to have also the icon on my toolbox so i could know every time if MAIN/LATEST is active. My question is if someone could manipulate the clearcase's Toolbox. I was searching in google without to find out an answer!
The usual customization I see is through the ClearCase Context Menu Editor for Windows Explorer.
That would apply for Windows client only, and for ClearCase 7.x, not ClearTeam Explorer 8 though:
The tool that allows you to change the behavior of existing dialog boxes in Windows and ClearCase Explorer is ClearCase Context Menu Editor (tool called clearmenuadmin typical found in C:\Program Files\Rational\ClearCase\bin\clearmenuadmin.exe) which is available on all ClearCase Windows installations.
With the Context Menu Editor it is possible to:
Create new commands and other menu items available to ClearCase context menus.
Change properties of built-in and custom ClearCase context menu items.
Add items to or remove items from ClearCase context menus.
Test the changes to ClearCase context menus.
It would be good to know why you want to "disable /main/LATEST" and how you plan on doing that. Completely removing the line may cause problems if you need to create new elements, for example.
Whatever script that you're planning on using would need to:
Grab the current view configspec using cleartool getcs
Edit it to make the desired changes
use cleartool setcs {filename} to apply the changes
Some key "gotchas".
Removing /main/LATEST completely will break mkelem, unless have a "element * /main/0 -mkbranch {some branch}" rule.
If you use "-time now" to prevent seeing stuff on /main that others may still be checking in, that will work up to a point. This "now" means "when the configspec is recompiled" which can happen: on starting the view server process or if "cleartool setcs -current" is used to clear view caches.
Not having a configspec line for /main is intentionally introducing "no version selected by configuration" errors. As is using "element ... -none" rules. If you use snapshot or snapshot-derived view types (Web views, and likely Automatic views), you may see error messages on updating/loading views. You can ignore these messages, but only if you're aware they will happen. If you're doing automated updates (say as part of a build process) that tooling needs to be set up to ignore the "spurious" errors and catch the "real" ones.
I have noticed the behavior of a Dynamic view is different than a web view with the following config spec:
element * CHECKEDOUT
element * MYLABEL
element * /main/latest
With a web view, my view is filtered by MYLABEL.
But in Dynamic views, I always get the "latest" files.
What am I doing wrong?
It depends on:
the config spec of the dynamic view
(you need to double-check if it is the same than the web view, with a cleartool catcs)
the files you are considering (that LABEL might not be applied on all those files)
how long the web view was updated: a web view is basically like a snapshot view: you might see those versions now, but if the label was moved, then a refresh might give you different result.
Beside that, there is no differences in the selected versions a web view or a dynamic view would return.
The OP Kevin Zamora adds in the comments:
I got it to work.
The problem is that Clearteam explorer is slowwww... and if you work remotely, it could take forever (and we reportedly have a fast connection).
Even at work, it takes many seconds.
Also, I notice that you have to kill the show version tree window and restart it completely. Sometimes the window doesn't update properly.
From a snapshot view using base ClearCase, I want to checkout the latest version of a file from a branch that is NOT selected in my snapshot view. I would expect this to be possible, because you can do it from the version tree browser tool.
However, the documentation for the checkout command claims that you can't do this in a snapshot (emphasis mine): [edit: Yes you can! See below.]
Nonstandard checkouts
By default, the checkout command checks out
these versions:
The most recent version on a branch, if you are using a dynamic view
The version currently loaded in the view, if you are using a snapshot view
To modify a different version, you can either use the –version option or create a subbranch at that version. (See the mkbranch
reference page). Furthermore, from a single view, you can have only
one checkout per element at a time.
Note: When you work in a snapshot view, the only version of a
directory element that can be checked out is the version currently
loaded in the view. Therefore, the –version and –branch options do not
work.
How can I check out an unselected version from the command line?
[edit: Here I misread the "Note:" section. What the help means is that directories can't be checked out using the -version or -branch args, but normal files can be.]
The actual solution selected by the OP dss539 is to use cleartool checkout directly (see cleartool checkout man page)
cleartool checkout -bra/nch branch-pname | -ver/sion
It would work for files (not directories) in dynamic or snapshot view.
If you don't want to modify the config spec of your current snapshot file, then you can:
either use a separate view (a dynamic one in order to have the right version immediately selected), and modify at will the config spec of that other (dynamic view),
And copy the version back to your snapshot view.
See also "How would you select versions from a specific branch in ClearCase?" for config spec example.
...
Actually, you don't even need to modify the config spec of that dynamic view:
You can use the extended pathname of the version you want to directly access and copy the right version.
or use the cleartool get command (which is what "Send To" is doing on the version Tree).
See "clearcase command to backup predecessor version of a file?"
(You don't need a separate view here)
My company has recently switched from using Perforce to Rational ClearCase for version control.
In the P4Win client it was possible to select View -> Entire Depot and browse depot files that were outside my client spec and this was useful for figuring out exactly what I needed to add to my client spec.
Significantly this avoided the need to synch the files from the depot before viewing them, and was therefore quicker.
I'm now using ClearTeam Explorer and can't seem to find an equivalent. I'd like to have this for a similar purpose, to figure out exactly what I need in the load rules for my snapshot view and also to decide what views I need to create.
Does anyone know if it is possible to view what files exist under a project in ClearTeam Explorer without first creating a view on the project / joining it?
ClearTeam Explorer is basically a trimmed down Eclipse with ClearCase specific plugins.
thanks.
The easiest way would be to create a dynamic view (you need to add -stream yourStream#\yourPvob to the mkview command, I know it looks like you "joining a project", but still, dynamic view are quick to setup).
The idea is to configure your config spec with the right selection rules (a dynamic view will display the files instantly), and then make your snapshot view with those same selection rules (and the appropriate load rules, specific to a snapshot view)
Note that, according to the CCRC wiki:
With the Release of v8.0, the ClearTeam Explorer is the common Eclipse UI client that supports MVFS on native clients, as well as webviews.
CM Server in 7.1.x was renamed to CCRC Wan Server in v8.
If you don't have cleartool installed, that means you are using webviews (which are snapshot views with web access to the CCRC Wan server).
In that case, there is no easy way to browse any code from any Baseline (other than joining a project)
FWIW now, wanted to suggest a different solution here.
I would create a web view on the stream with empty load rule.
This will ensure a faster view creation.
Then from ClearTeam Navigator menu, I will enable the options to show
Unloaded VOBs
Unloaded Elements
This will ensure that the unloaded elements chosen from my element rules are displayed in ClearTeam Details and ClearTeam Navigator.
Note: You need to be connected to the CCRC server to view the unloaded elements.
Then I can browse the file structure and decide which files needs to be added to my view's load rule.
Or I can just right click on any unloaded/partially loaded resource and select "Load Resource..." which will load the item to my view.
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.