ClearCase time and query - clearcase

This config-spec show the files I need:
element -dir * '{version(/main/LATEST) && !version(SLT-T)}'
element -file * '{version(/main/LATEST) && !version(SLT)}'
Now I need to see how the source looked at some point in the future, so I do this:
time 01-Nov-2008
element -dir * '{version(/main/LATEST) && !version(SLT-T)}'
element -file * '{version(/main/LATEST) && !version(SLT)}'
Unfortunately this still shows me "the present". The manual says:
Time rules may be nested. They may not include any query language constructs.
Okay, but what do I do then?
How do I exclude files and directories with a certain label, without using query language? Or is there way to specify time in the query language?
(No files has a SLT-T label, and no directories has a SLT label.)

Did you try adding some query-language directives like:
&& !ver{created_since(1-Nov-2008)}
&& ver{created_since(1-Nov-2008)}
(all the versions existing before/after 1 Nov. 2008)
That is part of the query language and may help you refining your selection rules.
I confirm for having tested it:
element /myPath/... /main/{!created_since(01-Sep-2008)}
element /myPath/... /main/LATEST
would give you all version created before September the first in this instance.
I am not sure it can be combined with your rules to successfully achieve what you are looking for, though.
My point was just to make sure you can include time-based selection rules in your config spec.

Related

ClearCase pathnames involving more than one element

I'd like to understand what makes ClearCase create paths like these (more than one ##):
\TUNE\Integration\XmlFiles\PM_Content##\main\integ_mp1601\4\CommunityLink.png##\main\integ_mp151\151x\1
Rather than the more typical (single ##):
\TUNE\Integration\XmlFiles\PM_Content\CommunityLink.png##\main\integ_mp160\160x\1
I don't seem to have a control over it and it is not immediately obvious to me why CC does that. And when it happens there seems to be nothing I can do to "convince" it to use the simpler format.
First, a bit of context:
'##' is linked with dynamic views
You can see that concept with version extended path: using a pathname_ccase syntax, you can add characters to the end of a relative or full path name, turning it into a VOB-extended path name.
VOB-extended path names that specify versions of elements are the most commonly used; they are called version-extended path names.
/vobs/proj/foo.c##/main/motif/4
That means you can:
The idea is: in a dynamic view, you can access (read the content of) any version of a file through the extended pathname.
Now, why multiple '##'?
The documentation adds:
This symbol is required to effect a switch from the standard file/directory namespace to the extended element/branch/version namespace.
There are two equivalent ways to think of ##:
When appended to the name of any element, the extended naming symbol turns off transparency (automatic version-selection).
Thus, you must specify one of the element's versions explicitly.
The extended naming symbol is part of an element's official name.
For example, foo.c is the name of a version (the particular version that appears in the view); foo.c## is the name of the element itself.
So with:
TUNE\Integration\XmlFiles\PM_Content##\main\integ_mp1601\4\CommunityLink.png##\main\integ_mp151\151x\1
You have:
PM_Content## the name of the element (folder) PM_Content at its version \main\integ_mp1601\4
CommunityLink.png## the name of the element (gile) CommunityLink.png at its version \main\integ_mp151\151x\1
That happens when the current PM_Content folder, visible in the view, no longer lists CommunityLink.png (which was deleted/rmname'd):
you need to select the right folder version (which does list the file)
then you can access to any version of the file you want

What is the Spinnaker pipeline expression for the current stage?

I'm trying to write a Spinnaker pipeline expression that determines some criteria based on the current stage and its ancestors. Per the documentation, you can use the #root helper to get the current stage context; however, it doesn't appear there is any way to get the current stage.
For example, if you wanted to find out if the current stage has any ancestors that have a failure status, right now you have to know the stage name, which seems counter-intuitive given the existence of #root.
${ #stage("My Stage").ancestors().?[status.isFailure() && name != "My Stage"] }
I'd like to replace the #stage("My Stage") with something similar to #root however, again #root is the context object inside the stage, not the stage itself.
Note it also appears the Stage.ancestorsOnly() method is private at the moment so if you want to find only ancestors that have failed (or have some other criteria) you need to manually exclude the current stage. That's why I have the extra name comparison in there.
root and #this in SPEL are just aliases for when you need to reference the current object used in places like filters, I wouldn't get too caught up with it.
Maybe the right thing here is to add a few more values to the augmented context we evaluate SPEL against https://github.com/spinnaker/orca/blob/7de225679cf19cbcbfcfdbdcd08dc1962247f0fe/orca-core/src/main/java/com/netflix/spinnaker/orca/pipeline/util/ContextParameterProcessor.java#L90 to include values such as stage id so it would be easier to add helper functions like #currentStage() or #ancestorStaget() here https://github.com/spinnaker/orca/blob/fc87a8e99ec59a4e129646026987aa5adbde2d31/orca-core/src/main/java/com/netflix/spinnaker/orca/pipeline/expressions/ExpressionsSupport.java#L60
There are subtle issues here because stage expressions get evaluated before a stage runs so for static values like ancestors it should be ok, but for values like status the value you get will not be updated

Eclipse - How do I view java arrays / collections better in debugger

Viewing/Searching java arrays and collections in the Eclipse Java debugger is tedious and time-consuming.
I tried this promising plugin (in alpha as of Aug 2012)
http://www.cvast.tuwien.ac.at/projects/visualdebugging/ArrayExplorer
But it freezes Eclipse for simple arrays beyond a few hundred elements.
I do use Detail formatters, but that still needs clicking on each element to see the values.
Are there any better ways to view this array/collection data?
Use the 'Expressions' tab.
There you can type in any number of expressions and have them evaluated in the current scope.
ie: collection.size(), collection.getValueAt(i), ect...
Eclipse > Preferences > Java > Debug >Detail Formatter
This may be close to what you are looking for. It is another tedious work to setup but once done you can see the value of objects in Expressions window.
Here is link to start
override toString method of your class and you will be able to see what you want to see. i'm attaching example to show you exactly that.
Even though i could not find a way to see them in nice table/array, i found a halfway workaround.
The solution is to define a static method in a throwaway class that takes the array as input and returns a string of concatenated values that one wants to quickly glance at. it could include the array index and newlines to view results formatted nicely. It can be fine tuned to print out only certain array indices to reduce clutter.
This static method can then be used in the watch area.

Branching from ' 0 ' Version

Any one please let me know, How can we create branch from Main 0 -version.
we have Main & The latest Current Version is 50-version. But i want to make branch from O-Version.So that Branch should not ahve any data into it.
Please let me know how can this be done !.
You should be able to do it by modifying the config spec of your view (assuming you are in Base ClearCase, not UCM)
element .../aNewBranch /main/LATEST
element /path/... /main/0 -mkbranch aNewBranch
Note the order:
first try to select the LATEST version of the "aNewBranch",
then select version 0 with possibility of making a branch if there is a checkout
See How a ConfigSpec works and Writing a ConfigSpec for more.
In addition to the answer by VonC, do not assume that branch with name /main always exist. The type of the "main" branch can be changed, so for example it can be called /head instead.

How to I combine ClearCase config spec element selections

Is it possible to combine the following two configspec lines in one?
Original configspec:
element .../test_dir_A/... .../my_branch/LATEST
element .../test_dir_B/... .../my_branch/LATEST
To something like
element .../[test_dir_A or test_dir_B]/... .../my_branch/LATEST
Thanks!
Regex in general aren't supported for config spec path.
The man page about config_spec confirms the use of pattern, so maybe something like:
element .../test_dir*/... .../my_branch/LATEST
could work (even though it wouldn't be restrict to just A or B)
The wildcard man page lists all the possibilities:
element .../test_dir_[AB]/... .../my_branch/LATEST
should be what you want.
[xyz]
Matches any of the listed characters.

Resources