基于元素属性的 ClearCase 配置规范选择
在 ClearCase 配置规范中,是否可以根据 element 属性(而不是 version 属性)选择版本?例如:
element * ...{SOME_ELEM_ATTR==SOME_VALUE&&lbtype(MY_LABEL1)}
这不起作用,因为“元素”规范的最后一部分是版本选择器,它仅查看版本属性。
我想做的是将我的文件分为两个或多个类,并将不同的“元素”行应用于不同的文件类。我尝试用一个属性标记一个类中的所有元素,但在尝试将选择基于配置规范中时遇到了死胡同。我能看到做这种事情的唯一方法是将一个类的所有文件放在一个地方,并使用第二个构造(“模式”)来区分:
element .../all_class1_files/... MY_LABEL1
但这真的很难看,因为你必须移动所有将一类的文件放到一个地方,或者有一个巨大的配置规范列出所有单独的目录和/或文件。
预先感谢...
雷
In a ClearCase config spec, is it possible to select versions based on element attributres (not version attributes)? For instance:
element * ...{SOME_ELEM_ATTR==SOME_VALUE&&lbtype(MY_LABEL1)}
This doesn't work because the last part of the "element" spec is a version-selector, which only looks at version attributes.
What I'm trying to do is partition my files into two or more classes, and have different "element" lines apply to different classes of files. I tried tagging all the elements in one class with an attribute, but hit a dead end with trying to base the selection on that in the config spec. The only way I can see to do this sort of thing is to put all the files of one class in one place and use the second construct (the "pattern") to differentiate:
element .../all_class1_files/... MY_LABEL1
but this is really ugly because you have to move all the files of one class into one place, or have a giantic config spec listing all the individual directories and/or files.
Thanks in advance...
Ray
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第一个解决方案是用分支替换属性标准。
这样,您就可以更轻松地标记一个分支或另一个分支的所有文件,而不是“具有给定属性的所有文件”。
除了此解决方法之外,您还会发现一些
find< /code> 基于属性的命令
(或在 手册页)。
然后,您可以组合
find
查询,使用“-exec
”指令来放置您要查找的标签想要。这样,您就不必搞乱 配置规范语法(可能不支持您所遵循的确切选择标准)。
我没有测试它,但你可以尝试一下
,因为
lbtype_sub
是一个元素、分支和版本选择器(而lbtype
只是一个版本选择器)。然而,由于 lbtype 似乎不是配置规范标准的一部分,我怀疑它是否可以在所述配置规范中工作。
One first solution would be to replace the attribute criteria by a branch.
That way, you would more easily be able to label all files from one branch or another, instead of "all files with a given attribute".
Other than this workaround, you will find some
find
command based on attribute here (or in the man page).You could then combine a
find
query with an "-exec
" directive to put the label that you want.That way, you don't have to mess with the config spec syntax (which may not support the exact selection criteria you are after).
I didn't test it, but you could try
, because
lbtype_sub
is an element, branch and version selector (whereaslbtype
is just a version selector).However, since
lbtype
doesn't seem to be part of the config spec criteria, I doubt it can work in said config spec.我认为我已经找到了一个很好的解决方案,使用“trtype”作为选择标准(似乎是从元素继承到版本的唯一查询函数)。如果 Class1 和 Class2 元素分别附加了虚拟触发器 Class1Files 和 Class2Files,那么类似的操作
应该可以解决问题。这将选择 Class1 中带有 MY_LABEL1 的文件和 Class2 中带有 MY_LABEL2 的文件。我还没有实际尝试过,但我会让你知道这是如何实现的。
I think I've up with a good solution using "trtype" as a selection criterion (appears to be the only query function that inherits from the element to the version). If the Class1 and Class2 elements have dummy triggers Class1Files andClass2Files attached to them, respectively, then something like
should do the trick. This selects files in Class1 with MY_LABEL1 and in Class2 with MY_LABEL2. I haven't actually tried this out yet, but I'll let you know how this works out.