Where do new elements appear when mkelem is used?

2019-05-30 19:21发布

My config spec is set up as:

element * CHECKEDOUT
element * .../BRANCH/LATEST
element * baseline -mkbranch(BRANCH)
element * /main/LATEST

When I make a new element I know it goes along with the rule /main/LATEST. When I do a cleartool ls I can find the new element, but how can I find the new element with a cleartool find command.

Also this is assuming the new element has been checked in and all existing elements that where checked out under the branch have been checked in. The new element does not yet have any labels.

I've been trying:

cleartool find -avobs -branch 'brtype(BRANCH)' -version 'version(.../main/LATEST)'

I believe this only searches the branch and have not been able to find new checked in elements this way.

1条回答
萌系小妹纸
2楼-- · 2019-05-30 20:05

When I make a new element I know it goes along with the rule /main/LATEST.

Yes, meaning it is created in the /main branch, not in the BRANCH branch.
It would be created in the BRANCH branch only if:

  • it was not a new element
  • it had a label on it (matching the baseline name)

So your find query cannot find a new element, based on your current config spec.

A new element would only have a /main/1 and no /main/2 version:

cleartool find -type f -version "version(/main/1)&&!version(/main/2)" -print

Note: if you wanted to add a new element on the branch BRANCH, your config spec would need to have another rule (as seen here):

element * CHECKEDOUT
element * .../BRANCH/LATEST
element * baseline -mkbranch(BRANCH)
element * /main/0 -mkbranch(BRANCH)  <=====
element * /main/LATEST
查看更多
登录 后发表回答