如何在 UCM ClearCase 中从命令行或脚本设置视图元素基线?
How to set view element baseline from command line or script in UCM ClearCase?
如何从脚本中 select UCM ClearCase 快照视图配置规范中具有特定基线的元素?
我正在编写一个脚本,它将创建给定流的快照视图,并且应该 select 流内容的特定基线版本。我更愿意以与设置加载规则相同的方式设置元素基线,但找不到这样做的方法。
这是我目前所做的:
...
cleartool mkview -snapshot -tag ${cc_view} -ptime -stream ${cc_stream}@\myVob -vws ${cc_dir}/${cc_view}.vws ${cc_dir}/${cc_view} || die "Failed to create view. Exiting."
cd ${cc_dir}/${cc_view}
# Set the element baselines
cleartool edcs -overwrite
cleartool update -overwrite -add_loadrules ${components} || die "Failed to update view. Exiting."
...
另一个问题可能是我无法在自定义块的配置规范中设置元素版本 - 我必须在组件 selection 规则中设置!覆盖 UCM 的 "Component selection rules" 部分感觉有点危险。我在 edcs
阶段这样做:
ucm
identity UCM.Stream <...id...>
# ONLY EDIT THIS CONFIG SPEC IN THE INDICATED "CUSTOM" AREAS
# This config spec was automatically generated by the UCM stream
# "myStream" at 2017-06-01T07:43:33+02:00.
# Select checked out versions
element * CHECKEDOUT
# Component selection rules...
element "[ee5a<...id...>=\MYCOMPONENT]/..." my-component-1.0 -nocheckout
end ucm
#UCMCustomElemBegin - DO NOT REMOVE - ADD CUSTOM ELEMENT RULES AFTER THIS LINE
#UCMCustomElemEnd - DO NOT REMOVE - END CUSTOM ELEMENT RULES
# Non-included component backstop rule: no checkouts
element * /main/0 -ucm -nocheckout
#UCMCustomLoadBegin - DO NOT REMOVE - ADD CUSTOM LOAD RULES AFTER THIS LINE
load \MYCOMPONENT
相关问题:
- UCM: How to create dynamic view (base clearcase) on arbitrary incremental baseline
- Snapshot from old baseline
正如 VonC 所建议的那样,我搬到了 base CC:
...
cleartool mkview -snapshot -tag ${cc_view} -ptime -vws ${cc_dir}/${cc_view}.vws ${cc_dir}/${cc_view} || die "Failed to create view. Exiting."
cd ${cc_dir}/${cc_view}
cat << EOF > config_spec
element * CHECKEDOUT
element * ${baseline} -nocheckout
element * /main/LATEST
EOF
cleartool setcs -force -overwrite config_spec || die "Failed to set config spec. Exiting."
cleartool update -overwrite -add_loadrules ${components} || die "Failed to update view. Exiting."
...
首先,只有 baseline is full.
如果它是增量的,则您可能会选择带有未在父文件夹上设置的标签(与基线相关联)的元素,从而使该元素无法访问。
其次,这种自定义选择最好使用非 UCM 基础 ClearCase 快照视图来完成,您在其中拥有:
- 与您的 UCM 快照视图相同的加载规则
但更简单的一组选择规则:
element * yourBaselineId
element * /main/LATEST
如何从脚本中 select UCM ClearCase 快照视图配置规范中具有特定基线的元素?
我正在编写一个脚本,它将创建给定流的快照视图,并且应该 select 流内容的特定基线版本。我更愿意以与设置加载规则相同的方式设置元素基线,但找不到这样做的方法。
这是我目前所做的:
...
cleartool mkview -snapshot -tag ${cc_view} -ptime -stream ${cc_stream}@\myVob -vws ${cc_dir}/${cc_view}.vws ${cc_dir}/${cc_view} || die "Failed to create view. Exiting."
cd ${cc_dir}/${cc_view}
# Set the element baselines
cleartool edcs -overwrite
cleartool update -overwrite -add_loadrules ${components} || die "Failed to update view. Exiting."
...
另一个问题可能是我无法在自定义块的配置规范中设置元素版本 - 我必须在组件 selection 规则中设置!覆盖 UCM 的 "Component selection rules" 部分感觉有点危险。我在 edcs
阶段这样做:
ucm
identity UCM.Stream <...id...>
# ONLY EDIT THIS CONFIG SPEC IN THE INDICATED "CUSTOM" AREAS
# This config spec was automatically generated by the UCM stream
# "myStream" at 2017-06-01T07:43:33+02:00.
# Select checked out versions
element * CHECKEDOUT
# Component selection rules...
element "[ee5a<...id...>=\MYCOMPONENT]/..." my-component-1.0 -nocheckout
end ucm
#UCMCustomElemBegin - DO NOT REMOVE - ADD CUSTOM ELEMENT RULES AFTER THIS LINE
#UCMCustomElemEnd - DO NOT REMOVE - END CUSTOM ELEMENT RULES
# Non-included component backstop rule: no checkouts
element * /main/0 -ucm -nocheckout
#UCMCustomLoadBegin - DO NOT REMOVE - ADD CUSTOM LOAD RULES AFTER THIS LINE
load \MYCOMPONENT
相关问题:
- UCM: How to create dynamic view (base clearcase) on arbitrary incremental baseline
- Snapshot from old baseline
正如 VonC 所建议的那样,我搬到了 base CC:
...
cleartool mkview -snapshot -tag ${cc_view} -ptime -vws ${cc_dir}/${cc_view}.vws ${cc_dir}/${cc_view} || die "Failed to create view. Exiting."
cd ${cc_dir}/${cc_view}
cat << EOF > config_spec
element * CHECKEDOUT
element * ${baseline} -nocheckout
element * /main/LATEST
EOF
cleartool setcs -force -overwrite config_spec || die "Failed to set config spec. Exiting."
cleartool update -overwrite -add_loadrules ${components} || die "Failed to update view. Exiting."
...
首先,只有 baseline is full.
如果它是增量的,则您可能会选择带有未在父文件夹上设置的标签(与基线相关联)的元素,从而使该元素无法访问。
其次,这种自定义选择最好使用非 UCM 基础 ClearCase 快照视图来完成,您在其中拥有:
- 与您的 UCM 快照视图相同的加载规则
但更简单的一组选择规则:
element * yourBaselineId element * /main/LATEST