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.
Related
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
How can I use xpath instead of id to find the element in DOM. I know that for id I can use: $("#id")[0].
I use $("#id")[0] inside Developer mode in browser in order to get the element by id to see what methods (like .getText(), innerHTML or others) am I able to use for the element. I want to know how to do this by XPATH
Thanks in advance
On Firefox console you can find (and explore) the element like this:
$x("//button[#id='myButton']")
But if you want to call a function on the element, you have to call it like this:
$x("//button[#id='myButton']")[0].click()
because there is always an array of elements returned (provided that the element is present and the first one in the array).
Thanks for the comments. I found out the answer. It can be done with:
$x("xpath")
Usually in protractor you can select singular element with:
element(protractor.By.css('#fdfdf'));
Occasionally you get something like this:
element(protractor.By.css('.dfdf'));
which potentially has more than one element. What's the correct way to select an index from a locator that locates multiple elements, and still contain the protractor's methods for sending Keys?
You can get an indexed element from an array returned with
// Get the 5th element matching the .dfdf css selector
element.all(by.css('.dfdf')).get(4).sendKeys('foo');
If you want to get the first element then
element.all(by.css('.dfdf')).first();
element.all(by.css('.dfdf')).get(0);
Try this one. It will work:
element.all(by.css('.dfdf')).get(4).getText();
I don't know why xpath is so much underestimated but you can solve thousands of problems with it, including this one
let elem = element(by.xpath('(//div//a)[3]'))
You can specify the number of element to use. Keep in mind the numbers start from 1, not 0 as usually in js
I need to filter entities based on one of their ListProperties having a certain element present. So kind of like:
entities.filter('listProp IN ',element) except where listProp and element are reversed if you see what I mean.
Anyone know how to filter like this?
If I understand you correctly, you want to find all entities which have that particular element present. You should be able to use: entities.filter('listProp =', element)
Look at: http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html#ListProperty
It says, "list_property = value tests if the value appears anywhere in the list".
Ok so it turns out the IN equality clause takes care of this case for lists automatically.
As in it does a for ... each on the list of elements to be searched for and if any one of them is present in the ListProperty for each entity it will return that entity.
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.