ClearCase: Launching 2-way diff into existing BC3 session displays as 3-way merge

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Andy Stevenson
    Journeyman
    • Nov 2007
    • 11

    ClearCase: Launching 2-way diff into existing BC3 session displays as 3-way merge

    I have build 457 installed, and I tested this with both BComp.exe and BCompare.exe in the ClearCase 'map' file.

    1) Close all BC3 sessions
    2) Select a file in Clearcase and choose "Compare to previous version"
    3) Launches into new BC3 session as 2-way diff (as expected)
    4) Select another file in Clearcase and choose "Compare to previous version"
    5) Launches into existing BC3 session as 3-way merge with Center and Right panels populated (oops)



    Command lines (from Process Explorer) to BComp.exe are identical for both instances:

    xcompare -fname E:\....\ControlRequest.cpp@@\main\5 -fname E:\....\ControlRequest.cpp \\2k3-clearcase\.....\88f24fe21e2b434aa0994299dd05c72b E:\....\ControlRequest.cpp

    xcompare -fname E:\....\ControlRequest.h@@\main\3 -fname E:\....\ControlRequest.h \\2k3-clearcase\.....\505123511b984a4f8f25d798e3c7a402 E:\....\ControlRequest.h
  • Lutz
    Veteran
    • Oct 2007
    • 356

    #2
    As I can see in your command lines this appears in snapshot views and I can reproduce this, too.

    In dynamic views the behaviour is correct in your case (both subsequent calls result in 2-way-diffs).

    The difference between dynamic view-calls and snapshot view-calls are the additional '-fname'-switches and the real filenames of the versions on the CC-server.

    dynamic view:
    xcompare
    M:\view\vob\path\element@@\main\1
    M:\view\vob\path\element@@\main\2
    snapshot view:
    xcompare
    -fname
    M:\view\vob\path\element@@\main\1
    -fname
    M:\view\vob\path\element@@\main\2
    //server\path\vob-storage\path\9ea7001c5b034d19ab8fc89d93a8e6d7
    //server\path\vob-storage\path\f33cc17c51134888836443a8a249e9ae
    The error only occurs if BC3 is already running when called with the snapshot view-parameters, but not with the dynamic view-parameters.

    Comment

    • Lutz
      Veteran
      • Oct 2007
      • 356

      #3
      ClearCase: another calling xcompare (i. e. BC3) issue

      BC3 help says:
      For a 3-way merge, use:
      bcomp.exe <Left File> <Right File> <Center File> <Output File>
      This behaviour causes trouble with ClearCase (but also inside BC3):

      BC3:
      Selecting 3 files offers 'Merge In New View' which opens Text Merge with the 3 files as left/center/right source files and no output file specified. I can use this to merge changes in the source files to any other file or one of the source files (but have to specify the output file first). It would be nice to enable editing and hide the output file for this case, so I can change all 3 files directly.

      ClearCase:
      From an elements history the compare call of different versions (2 .. oo) adds the predecessor of the newest selected version as the first parameter (this means the base file for a merge of the selected versions). Builtin CC-cleardiffmrg.exe handles this by comparing all versions (including the added base) side-by-side. It seems to be an error as I want to compare the versions and not to merge them.

      If I replace cleardiffmrg.exe with bcomp.exe BC3 shows files in the left/center/right/output panes depending on the number of given filenames (3 or 4, more are ignored). This is not really useful, i. e. because the output pane shows an old read-only version of the element.

      If it's possible BC3 should ignore the first name from a ClearCase-call if there are more than 2 files specified and use only the second and the third file to compare (files 4 .. should be ignored).

      The Text Merge should only be used, if the call includes the parameters -base, -out.

      For reference I add the link to CC-typemanager.pdf (also have a look at chapter 5 - a recommendation of Beyond Compare - did You know that?).

      Comment

      • Andy Stevenson
        Journeyman
        • Nov 2007
        • 11

        #4
        Thanks Lutz, for verifying the behavior.. and narrowing it down to the Snapshot view case with the two '-fname' parameters.

        I'm fairly certain that BC has special handling for the ClearCase command-line syntax... I can easily work around this for now by closing any existing sessions. I likely didn't see this before because of the previous implicit '/solo' behavior that would always launch into a new instance of BC3.



        As background, I've been using the clearcase integration with Beyond Compare 3 for >18 months with fantastic success. I was even able to displace Araxis and the obviously sub-standard built-in diff/merge tool in ClearCase.

        I would say that BC3 has saved our team countless man-weeks of otherwise lost time over that time period.. especially since it has handled the silent auto-merge directly.


        Here are snippets from my clearcase map file, for reference .. in case anyone is is interested (or has suggested corrections).

        Code:
        text_file_delta        compare                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        text_file_delta        xcompare            C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        text_file_delta        merge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        text_file_delta        xmerge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        ...
        _html            compare                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _html            xcompare            C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _html            merge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _html            xmerge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        ...
        _xml            compare                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _xml            xcompare            C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _xml            merge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _xml            xmerge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        ...
        _html2            compare                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _html2            xcompare            C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _html2            merge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _html2            xmerge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        ...
        _xml2            compare                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _xml2            xcompare            C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _xml2            merge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe
        _xml2            xmerge                C:\Program Files (x86)\Beyond Compare 3\BComp.exe

        Comment

        • Zoë
          Team Scooter
          • Oct 2007
          • 2666

          #5
          Hey guys,

          Yeah, sorry about that. Removing the auto-/solo behavior for ClearCase revealed a bug in the command line parsing when it handles the second instance. We'll have it fixed in the next release.
          Zoë P Scooter Software

          Comment

          • Glyn Williams
            Visitor
            • Dec 2007
            • 7

            #6
            Using bcomp instead of bcompare now that solo is gone

            The return code from bcomp.exe or bcomp.com always seems to be 0, when sometimes it should be 1. Return code from bcompare is always correct.

            -------------------------------------------------------------------

            A note on the use of bcomp in the ClearCase map
            bcomp.exe is the GUI version and bcomp.com is the console version.
            Windows will normally sort out the correct one if you just use bcomp.
            ClearCase cannot do this, it needs a complete path in the map file to spawn a process
            This means that the ClearCase map file should specify which program to run - the 'x' version is the graphical version. In the map file, compare should use bcomp.com and xcompare should use bcomp.exe
            I noticed that Andy is using the exe version for everything.
            Code:
             
            text_file_delta  compare    C:\Program Files\Beyond Compare 3\bcomp.com
            text_file_delta  xcompare   C:\Program Files\Beyond Compare 3\bcomp.exe
            text_file_delta  merge    C:\Program Files\Beyond Compare 3\bcomp.com
            text_file_delta  xmerge    C:\Program Files\Beyond Compare 3\bcomp.exe

            Comment

            • Zoë
              Team Scooter
              • Oct 2007
              • 2666

              #7
              Glyn,

              You didn't say which version you're running. Are you still seeing the incorrect return code in build 459?
              Zoë P Scooter Software

              Comment

              • Zoë
                Team Scooter
                • Oct 2007
                • 2666

                #8
                Glyn, Andy, Lutz, anyone else, can you confirm whether using bcomp.com for the non-x versions is necessary?

                Also, in case you haven't seen it, there's another customer posting at http://www.scootersoftware.com/vbull...ead.php?t=3483 with suggestions for changing the merge/xmerge behavior. His suggestions may change the way things work for you, so let me know if any of it is wrong.
                Zoë P Scooter Software

                Comment

                • Andy Stevenson
                  Journeyman
                  • Nov 2007
                  • 11

                  #9
                  I'm still using BComp.exe for all the targets -- haven't had a chance to test BComp.com.

                  Comment

                  • Zoë
                    Team Scooter
                    • Oct 2007
                    • 2666

                    #10
                    Thanks Andy. I figured that would be the case; from what I understand about how ClearCase calls us, there really shouldn't be a difference, and I'd lean towards using BComp.exe for everything just for consistency's sake.
                    Zoë P Scooter Software

                    Comment

                    • Zoë
                      Team Scooter
                      • Oct 2007
                      • 2666

                      #11
                      Andy,

                      Have you tried modifying your map file and including BC3 for the binary_delta lines? Is that what it uses for images, executables, etc?
                      Zoë P Scooter Software

                      Comment

                      • Andy Stevenson
                        Journeyman
                        • Nov 2007
                        • 11

                        #12
                        Originally posted by Craig
                        Andy,

                        Have you tried modifying your map file and including BC3 for the binary_delta lines? Is that what it uses for images, executables, etc?
                        I just tried that.. seemed to have no effect.
                        binary_delta compare C:\Program Files (x86)\Beyond Compare 3\BComp.exe
                        binary_delta xcompare C:\Program Files (x86)\Beyond Compare 3\BComp.exe
                        binary_delta merge C:\Program Files (x86)\Beyond Compare 3\BComp.exe
                        binary_delta xmerge C:\Program Files (x86)\Beyond Compare 3\BComp.exe

                        I tried a .png file, and it still showed up in cleardiff.

                        the 'whole_copy' type appears to be tied to .zip files. I just changed this to see what would happen:
                        whole_copy compare C:\Program Files (x86)\Beyond Compare 3\BComp.exe
                        whole_copy xcompare C:\Program Files (x86)\Beyond Compare 3\BComp.exe
                        whole_copy merge C:\Program Files (x86)\Beyond Compare 3\BComp.exe
                        whole_copy xmerge C:\Program Files (x86)\Beyond Compare 3\BComp.exe

                        Then the .zip file showed up when I did a "Compare with Previous Version" -- pretty cool actually! I don't know what the implications are for doing a merge on a .zip file, so I may revert to just the 'compare/xcompare' options.

                        Comment

                        • Zoë
                          Team Scooter
                          • Oct 2007
                          • 2666

                          #13
                          Cool, I found a description of the type managers.

                          http://publib.boulder.ibm.com/infoce...pe_manager.htm

                          It looks like a bunch of them are just related to how it's stored in the system, so I'd expect binary_delta, whole_copy, or z_whole_copy to work for images too. Since we don't support merges for anything besides text files, I'd only suggest using them for "xcompare" and maybe "compare".
                          Zoë P Scooter Software

                          Comment

                          Working...