ClearCase Config Spec:仅从特定目录加载带有特定标签的文件 [英] ClearCase Config Spec: load only files with specific label from certain directory
问题描述
假设我有一个VOB foo/.在此VOB中,有一个目录栏/,其中包含已标记和未标记的文件.但是bar/不是foo/中的唯一目录,但是其他所有目录都没有标签文件. 有没有一种方法可以编写具有以下行为的配置规范:
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:
- 加载所有已检出的元素
- 对于每个目录除 foo/bar/加载主/最新版本
- 对于目录foo/bar/,仅加载具有特定标签的文件,如果该标签不存在,则不加载主/最新版本
- 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
正常的配置规范为
element * CHECKEDOUT
element * LABEL
element * /main/LATEST
load /foo
但是很明显,它随后还将在/foo/bar中加载未标记的版本.预先感谢.
But obviously it would then load also the non-labeled versions in /foo/bar. Thanks in advance.
推荐答案
您可以将路径添加到配置规范中,以便将特定选择规则应用于所述路径:
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.
三个点表示法(foo/bar/...
)表示:bar
文件夹及其所有子元素.
The three dots notation (foo/bar/...
) means: the bar
folder and all its subelements.
请注意,这不会总是显示标有MYLABEL
的 all 个元素:如果一个父文件夹的标签是 not ,而MYLABEL
则没有其他子标签,元素将可见,可访问且已选择.
在考虑规则element foo/bar/... -none
的情况下尤其如此,因为该规则可以防止为foo/bar
选择/main/LATEST
(没有MYLABEL
)
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
)
这里的规则顺序很重要,因为第一个适用的规则是ClearCase使用的规则:您可以在"
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)"
这篇关于ClearCase Config Spec:仅从特定目录加载带有特定标签的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!