ClearCase 希望在交付到备用目标后合并未更改的文件

标签 clearcase clearcase-ucm

将 Rational ClearCase v. 7.0.1.1 与 UCM 一起使用,我在使用 ClearCase 的“从流传递到备用目标”功能时遇到了问题。

想象一下,我们有一个项目集成流和两个从它派生的开发人员流 A 和 B。现在我更改流 A 中的一个文件。我希望拥有流 B 的开发者能够使用我的工作,而无需我将文件交付到集成流,因此我从流 A 交付到备用目标流 B。

到现在为止还挺好。我继续对文件进行另一项更改,但流 B 开发人员不需要此更改,因此我不将其交付给他。

再过一段时间,我将我的工作交付给主集成流。这很好用,尽管我想知道为什么 ClearCase 将合并标记为普通的“合并”而不是“合并(琐碎)”——除了我之外,没有人对文件进行过更改。

交付后,在主集成流上创建一个新基线。

真正的问题出现在开发人员 B 尝试重新设置他的流的基础上。由于开发人员 B 从未对文件进行任何更改,我希望合并是一个微不足道的合并,无需交互。但是发生的情况是,开发人员 B 被迫以图形方式解决该文件上的合并冲突,让他在集成流的基本版本、我交付给他的版本和我交付给集成流的版本之间进行选择。

当解决合并并完成 rebase 后,开发人员 B 想要向主集成流执行交付时,困惑继续存在。除了我最初交付给他的事件之外,他还被提供了一个名为 rebase_... 的事件,我从没想过会提供这个事件。

我在这里错过了什么吗?我们是否错误地使用了 ClearCase,或者这是一个已知的限制/错误?有没有人体验过这个功能?

在此先感谢您的帮助!

最佳答案

实际上,当我查看版本树时,rebase 期间冲突的根源就很清楚了:

version tree with conflict

当你重读途中ClearCase 3-way merge works ,您会看到它需要回到版本树中才能找到一个共同的祖先:

  • 来源 (Int/2)
  • 目的地(B/1)

  • 那个共同的祖先是 Int/1

    现在,这两个版本之间可能有一条共同的线路发生了变化,因为:
  • 最后一个 rebase (Int/2) 的来源来自 A/3
  • 最后一个 rebase (B/1) 的目的地来自 A/2
  • 共同祖先 (Int/1) 来自 A/1

  • 如果在 A/2 和 A/3 中修改了公共(public)线(从 A/1 开始)......有一个手动合并解决方案的原因!

    (我现在正在测试这个)

    知道了!冲突达成!

    继续我的previous experiment :

    让我们在 Stream A 中创建一个新的 modif:
    M:\vonc_test_dat_a\adev\test>ct co -nc aFile.txt
    M:\vonc_test_dat_a\adev\test>echo modif by A to B>>aFile.txt
    M:\vonc_test_dat_a\adev\test>ct ci -nc aFile.txt
    
    M:\vonc_test_dat_a\adev\test>type aFile.txt
    first line done on Int
    Second line from Int
    Addition by A to be delivered to B first
    Modification by A to be delivered to Int, B does not need it
    modif by A to B
    

    直接将其交付给 B:
    M:\vonc_test_dat_a\adev\test>ct deliver -to vonc_test_dat_b -target Test_DAT_B@\myPVob -cact -gmerge -force
    Changes to be DELIVERED to non-default target stream in current project "Test_DeliverToAlternateTarget":
              FROM: stream "Test_DAT_A"
              TO: stream "Test_DAT_B"
    Using target view: "vonc_test_dat_b".
    Activities included in this operation:
            activity:test_dat_a@\myPVob   vonc        "test_dat_a"
    Trivial merge: "M:\vonc_test_dat_b\adev\test\aFile.txt" is same as base "M:\vonc_test_dat_b\adev\test\aFile.txt@@\main\Test_DAT_Int\Test_DAT_A\2".
    Copying "M:\vonc_test_dat_b\adev\test\aFile.txt@@\main\Test_DAT_Int\Test_DAT_A\3" to output file.
    Deliver has merged
    
    M:\vonc_test_dat_a\adev\test>ct deliver -target Test_DAT_B@\myPVob -cact -complete -force
    

    (简单的合并)

    现在让我们完全更改该文件的内容:
    M:\vonc_test_dat_a\adev\test>ct co -nc aFile.txt
    M:\vonc_test_dat_a\adev\test>echo change first line>aFile.txt
    M:\vonc_test_dat_a\adev\test>ct ci -nc aFile.txt
    
    M:\vonc_test_dat_a\adev\test>type aFile.txt
    change first line
    

    并交付给 Int,并在交付后立即设置新基线:
    M:\vonc_test_dat_a\adev\test>ct deliver -force
    M:\vonc_test_dat_a\adev\test>ct deliver -force -complete
    M:\vonc_test_dat_a\adev\test>ct mkbl -comp ADV_TST@\myPVob -view vonc_test_dat_int TST_DAT1.2.0
    

    (另一个微不足道的合并)

    B 的 rebase 怎么样?
    M:\vonc_test_dat_b\adev\test>ct rebase -bas TST_DAT1.2.0
    Advancing to baseline "TST_DAT1.2.0" of component "ADV_TST"
    Updating rebase view's config spec...
    Creating integration activity...
    Setting integration activity...
    Merging files...
    Checked out "M:\vonc_test_dat_b\adev\test\aFile.txt" from version "\main\Test_DAT_Int\Test_DAT_B\3".
      Attached activity:
        activity:rebase.Test_DAT_B.20090707.163300@\myPVob  "rebase Test_DAT_B on 07/07/09 4:33:00 PM."
    Needs Merge "M:\vonc_test_dat_b\adev\test\aFile.txt" [to \main\Test_DAT_Int\Test_DAT_B\CHECKEDOUT from \main\Test_DAT_Int\4 base \main\T
    est_DAT_Int\3]
    ********************************
    <<< file 1: M:\vonc_test_dat_b\adev\test\aFile.txt@@\main\Test_DAT_Int\3
    >>> file 2: M:\vonc_test_dat_b\adev\test\aFile.txt@@\main\Test_DAT_Int\4
    >>> file 3: M:\vonc_test_dat_b\adev\test\aFile.txt
    ********************************
    ---------[changed 1-4 file 1]----------|---------[changed to 1 file 2]---------
    first line done on Int                 | change first line
    Second line from Int                   |-
    Addition by A to be delivered to B fir+|
    Modification by A to be delivered to I+|
                                          -|
    *** Automatic: Applying CHANGE from file 2 [line 1]
    ============
    ============
    -----------[after 4 file 1]------------|----------[inserted 5 file 3]----------
                                          -| modif by A to B
                                           |-
    Do you want the INSERTION made in file 3?  [yes] no
    ============
    ============
    Output of merge is in "M:\vonc_test_dat_b\adev\test\aFile.txt".
    Recorded merge of "M:\vonc_test_dat_b\adev\test\aFile.txt".
    Build and test are necessary to ensure that any merges and configuration changes were completed correctly.
    When build and test are confirmed, run "cleartool rebase -complete".
    

    你有它:来自共同祖先的两个不兼容的变化之间的一个很好的冲突。

    这是一张图片来说明这一点:

    conflict during merge

    .

    关于ClearCase 希望在交付到备用目标后合并未更改的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1090911/

    相关文章:

    clearcase - 使用 Cleartool 显示当前基线

    label - ClearCase 配置规范 : load only files with specific label from certain directory

    diff - ClearCase:如何从事件生成补丁(统一差异)文件?

    jenkins - Clearcase rebase 来自 Jenkins 的问题

    tfs - 如何将项目从 ClearCase 转移到 TFS?

    version-control - ClearCase:如何在配置规范选择的当前版本上查找未标记为 "LB"的文件

    continuous-integration - 设置 TeamCity 以与 ClearCase 配合使用

    continuous-integration - Clearcase hudson 问题

    ClearCase:在 Unix 中创建的 View 在 Windows 中不可见,反之亦然吗?

    ClearCase 通用工作流示例