ClearCase:正在加载特定目录的旧版本? [英] ClearCase : Loading Older Version of a specific Directory?

查看:53
本文介绍了ClearCase:正在加载特定目录的旧版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在UCM快照视图中加载目录的旧版本?在我们的项目中,一位开发人员将未编译且不可编译的代码签入了ClearCase。其他开发人员更新了她的视图,然后由于之前的开发人员未编写代码,他没有在编译项目。因此,开发人员只希望获取目录的先前版本。如何在snahpshot视图中仅针对特定目录执行此操作?

解决方案

第一种可能是尝试选择要还原的子目录的正确版本,例如:

  element / path / to / directory / main / [branch] / [version] 

但是那肯定是错误的,因为:





无论如何,这需要在配置规范中仔细添加,因为: / p>


  • 您不能在配置规范的任何位置添加选择规则(元素...):


    • 最后,它将被忽略(因为首先选择了先前的选择规则)

    • 如果将其放在开头,它将一直工作到下一个 setcs -stream 出现(或下次您按下与流同步)。那时,将重新生成UCM视图(快照或动态)的配置规范(根据流的配置)并覆盖您的自定义规则。







一种可行的解决方案是使用时间修改快照视图的配置规范-基于规则

(它修改特殊版本标签 LATEST 的含义;该规则从分支中选择创建的最后一个版本在特定时间之前;

参见' cleartool man config_spec '):

 #仅在您的子目录中和
以下添加以下临时规则#(因此在 ...之后)
元素/ aVob / myComponent / mySubDirectory / ... ... / STREAM_NAME / LATEST-时间dd-月-yyyy

元素 [02945650fb1411d68504000180bdc4b6 = \aVob] / myComponent / ... ... / STREAM_NAME / LATEST
元素 [02945650fb1411d68504000180bdc4b6 = \aVob] / myComponent / ... FOUNDATION_BASELINE -mkbranch STREA M_NAME
元素 [02945650fb1411d68504000180bdc4b6 = \aVob] / myComponent / ... / main / 0 -mkbranch STREAM_NAME

只需在UCM快照视图中进行测试即可:

将日期格式调整为您需要将该子目录恢复为正确状态的日期和时间。


How Can I load of older version of a directory in a UCM snapshot view? In our project one developer checked-in not complated and non compilable code to ClearCase. Other developer updated her view then he was not compiling project because of previous developers's not complated code. So developer only wants to get previous version of directory.How Can I do this in snahpshot view and only for a specific directory?

解决方案

A first possibility would be to try and select the correct version of the sub-directory to revert, like:

element /path/to/directory /main/[branch]/[version]

But that would be plain wrong, because:

  • extended path names is not supported in snapshot view, as explained in this SO question.

  • to select the directory alone is not enough (the files would still be selected as the LATEST versions available on the stream!)

And anyway, that would need to be added carefully in the config spec because:

  • you cannot add a selection rule (element ...) anywhere in the config spec:
    • if you put that rule at the end, it will be ignored (because of previous selection rules which are picked first)
    • if you put it at the beginning, it will work until the next "setcs -stream" occurrence (or the next time you push "Synchronize with stream"). At that time, the config spec of an UCM view (snapshot or dynamic) is regenerated (according to the configuration of the stream) and overrides your custom rule.

A possible solution would be to modify your config spec of your snapshot view with a time-based rule
(It modifies the meaning of the special version label LATEST; the rule selects from a branch the last version that was created before a particular time;
see 'cleartool man config_spec'):

# Add the following temporary rule only for your sub-directory and below
# (hence the '...')
element /aVob/myComponent/mySubDirectory/... .../STREAM_NAME/LATEST -time dd-Month-yyyy

element "[02945650fb1411d68504000180bdc4b6=\aVob]/myComponent/..." .../STREAM_NAME/LATEST
element "[02945650fb1411d68504000180bdc4b6=\aVob]/myComponent/..." FOUNDATION_BASELINE -mkbranch STREAM_NAME
element "[02945650fb1411d68504000180bdc4b6=\aVob]/myComponent/..." /main/0 -mkbranch STREAM_NAME

Just tested in a snapshot UCM view: it works.
Adapt the date format to the date and time you need to revert that sub-directory to the proper state.

这篇关于ClearCase:正在加载特定目录的旧版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆