ClearCase Config Spec: load only files with specif

2019-02-20 06:50发布

Suppose I have a VOB foo/. In this VOB lies a directory bar/ which contains labeled and non-labeled files. But bar/ is not the only directory in foo/, but all others don't have labeled files. Is there a way to write a config spec with the following behaviour:

  • load all elements that are checked out
  • for every directory except foo/bar/ load the main/LATEST version
  • for the directory foo/bar/ load only the files which have that specific label, if this label does not exist, do not load the main/LATEST version

The normal config spec would be

element * CHECKEDOUT
element * LABEL
element * /main/LATEST
load /foo

But obviously it would then load also the non-labeled versions in /foo/bar. Thanks in advance.

1条回答
叛逆
2楼-- · 2019-02-20 07:01

You can add paths to your config spec in order to apply specific selection rule to said paths:

element * CHECKEDOUT
element foo/bar/... MYLABEL
element foo/bar/... -none
element * /main/LATEST
load /foo

I would recommend testing that config spec in a dynamic view first, then apply it to the snapshot view.

The three dots notation (foo/bar/...) means: the bar folder and all its subelements.

Note that this won't always display all elements labelled with MYLABEL: if one the parent folders has not the label MYLABEL, no other sub-element will be visible, accessible and selected.
This is especially true here considering the rule element foo/bar/... -none which is there to prevent selecting /main/LATEST for foo/bar (is there is no MYLABEL)

The order of the rules is important here, since the first one which applies is the one used by ClearCase: you can find a similar idea in "ClearCase view that ONLY shows files/directories attached to a label (not latest)"

查看更多
登录 后发表回答