Can we omit element * /main/LATEST in the config spec of base clear case project?

元气小坏坏 提交于 2019-12-10 11:02:55

问题


In a base clear case project that I have, the config spec handed to me reads like this:

element * CHECKEDOUT
element * .../PROJ_1.5.0/LATEST
element * .../main/LATEST -mkbranch PROJ_1.5.0
element * /main/LATEST

I read up a bit on config specs here at his guide: http://www.philforhumanity.com/ClearCase_Support_17.html It seems to me that in my config spec, the last line has no value. Because element * /main/LATEST is already there on the second last line. Is my understanding correct?


回答1:


That last line is a selection rule stopper: it is a rule which will always be selected if all the other fail.
(That would be because there always is a branch named main -- unless you renamed it, but that is rare --, and always at least a version 0 -- placeholder -- for each element added to source control in ClearCase)

So it is important to have it.

Suppose a directory isn't selected at all (by any of the other rules), all that directory content will be invisible, even though the sub-directories and their content might have been selected by one of the rules.
But with element * /main/LATEST, you are sure all the elements will be visible, at the version selected by your rules, or, by default, at /main/LATEST.


That being said, re-reading your config spec, you can replace the last two lines with:

element * /main/LATEST -mkbranch PROJ_1.5.0

.../main/LATEST makes no sense: it means "main coming from any other branch", which isn't what you would see in a normal config spec: all the other branches comes from main, not the reverse.

So with that last rule, not only you are sure you will see all the elements, but if you checkout them, you will create and go into branch PROJ_1.5.0.




回答2:


If you don't want to see files from main/LATEST which don't exist on your branch, use

element -directory * /main/LATEST

Then only directories from main/LATEST and the files from your branch are visible.



来源:https://stackoverflow.com/questions/12062431/can-we-omit-element-main-latest-in-the-config-spec-of-base-clear-case-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!