Topic
8 replies Latest Post - ‏2013-01-29T19:53:55Z by Tgefen
andrew.trobec
andrew.trobec
8 Posts
ACCEPTED ANSWER

Pinned topic How can I use findmerge to extract baseline differences?

‏2013-01-21T12:01:03Z |
Hello,

I am using ClearCase 7.1.2. Here is my scenario:

I have a production stream PROD that has baselines PROD.R1 and PROD.R2. What I am trying to do with findmerge is extract only the files that have been changed between these two baselines and copy them to a folder of my choice. I performed these steps:

1. Create child stream called PROD_R1 based on baseline PROD.R1
2. Create two dynamic views: 1 on PROD and 1 on PROD_R1 with names PROD and PROD_R1 respectively
3. From command prompt browse to the desired folder for the PROD_R1 view and run command: cleartool findmerge . -ftag PROD -exec "cmd /c copy %CLEARCASE_PN% \"C:\OUTPUT""

This does not copy the latest baseline (R2), but rather it copies the contents of R1. I am looking for the inverse.

I tried to use the %CLEARCASE_XPN% variable to copy the to-version, but it returns:

cleartool: Warning: Element ".\filename.txt" requests merge to \main\PROD\1 backwards on same branch from \main\PROD\2
The system cannot find the file specified.

I have also tried to run the command: cleartool findmerge . -ftag PROD_R1 -exec "cmd /c copy %CLEARCASE_PN% \"C:\OUTPUT"" from the PROD view, but it returns no results.

What am I doing wrong?

Are thers any other cleartool commands that I can use to accomplish my task?

Thank you in advance,

Best regards,

Andrew
Updated on 2013-01-29T19:53:55Z at 2013-01-29T19:53:55Z by Tgefen
  • SystemAdmin
    SystemAdmin
    47293 Posts
    ACCEPTED ANSWER

    Re: How can I use findmerge to extract baseline differences?

    ‏2013-01-21T21:26:52Z  in response to andrew.trobec
    You could use the command cleartool diffbl for this and then write a small script to parse the output and copy the changed files.

    But in my opinion, copying your files this way doesn't look like a very good SCM-process. For example, how do you deal this way with added/removed files and directories.
    It is better if you simply keep all the versions in ClearCase, and use the ClearCase commands to do your reporting on the differences and the change set.
    Or you could also use the ClearC
    • SystemAdmin
      SystemAdmin
      47293 Posts
      ACCEPTED ANSWER

      Re: How can I use findmerge to extract baseline differences?

      ‏2013-01-21T21:28:17Z  in response to SystemAdmin
      (finishing my answer)
      Or you could also use the ClearCase reporting tools from GoMidgets.

      Regards,
      Marc
      • andrew.trobec
        andrew.trobec
        8 Posts
        ACCEPTED ANSWER

        Re: How can I use findmerge to extract baseline differences?

        ‏2013-01-22T07:16:42Z  in response to SystemAdmin
        Hello Marc,

        Thank you very much for your feedback.

        I will take a look into the cleartool diffbl command. I'm not sure what you mean by ClearCase reporting. Could you point me in the right direction? I have another forum post (https://www.ibm.com/developerworks/forums/thread.jspa?threadID=468382) where I was asking for support using a base clearcase config spec to extract only the delta, but I have not received any feedback.

        I am currently evaluating the best way of being able to extract baseline deltas but have not managed to accomplish this. Basically I want to be able to extract the changes from a stream's latest baseline (or between two baselines), either by filtering it into a view or by extracting it using cleartool commands.

        Best regards,

        Andrew
        • SystemAdmin
          SystemAdmin
          47293 Posts
          ACCEPTED ANSWER

          Re: How can I use findmerge to extract baseline differences?

          ‏2013-01-22T08:34:30Z  in response to andrew.trobec
          By ClearCase reporting, I mean that you should use cleartool commands like diffbl (or Compare
          Baselines via the GUI), lsactivity, describe etc. to get the information that you are looking
          for and not copy stuff outside of ClearCase to manipulate.

          If you are using UCM, I would use as much as possible the UCM commands from ClearCase
          and use the base ClearCase commands only in exceptional cases. I would not build my
          standard processes around a mix of UCM and base ClearCase commands.

          The process that you are describing in your other question also doesn't look right to me.

          Instead (if you want to continue with UCM), try to implement a branching/stream
          architecture based on a main project/stream.

          The purpose of a main project is that you use the baselines created in its integration
          stream as foundation baselines for your actual development projects (your PROD stream).
          So no development should take place on the main-stream.
          On the other hand, you deliver also your production baselines (PROD.1, PROD.2) to the
          main stream (based on quality criteria that must be defined within your organisation).
          After a baseline has been delivered to the main-stream, it must be baselined again
          in the main-stream. That new baseline will then serve as a new foundation baseline
          for your current PROD-project (or for a new PROD-project.
          The contents of the delivery activities from the PROD stream to the main stream
          contain actually the difference between the current and previous baseline.

          You can find some papers on the IBM website describing the usage of a main-project.

          Good luck,
          Marc
          • andrew.trobec
            andrew.trobec
            8 Posts
            ACCEPTED ANSWER

            Re: How can I use findmerge to extract baseline differences?

            ‏2013-01-22T09:00:19Z  in response to SystemAdmin
            Thanks again Marc,

            I understand the approach, but it doesn't really answer my question. What I want to do is extract the physical differences between the two baselines in a folder outside of ClearCase instead of comparing activities. The activities will contain the changeset and the changeset specifies the file versions. I want to extract those files.

            My intention is not to modify the files outside of ClearCase, but rather to just have a copy that I can transfer to another system outside of ClearCase. To do this I either need to be able to create a view that extracts just the delta, or a way of using cleartool to do it for me.

            Regards,

            Andrew
            • SystemAdmin
              SystemAdmin
              47293 Posts
              ACCEPTED ANSWER

              Re: How can I use findmerge to extract baseline differences?

              ‏2013-01-22T09:15:43Z  in response to andrew.trobec
              Andrew,

              Well in that case, I would definitely use diffbl:
              $ cleartool diffbl -versions baseline1 baseline2

              With a small Perl or Python script you can extract all lines starting with "<<" and then copy them somewhere else.

              Marc
              • andrew.trobec
                andrew.trobec
                8 Posts
                ACCEPTED ANSWER

                Re: How can I use findmerge to extract baseline differences?

                ‏2013-01-22T09:48:12Z  in response to SystemAdmin
                Thanks Marc!

                I am busy exploring this option! I just needed to know whether this was the best approach.

                Best regards,

                Andrew
                • Tgefen
                  Tgefen
                  712 Posts
                  ACCEPTED ANSWER

                  Re: How can I use findmerge to extract baseline differences?

                  ‏2013-01-29T19:53:55Z  in response to andrew.trobec
                  Andrew,

                  Soon we release a new version of R&D Reporter. I believe that two of its new enhancements answer your questions:
                  a) Easily get code differences from two baselines for a specific file element. After you query for a two-baselines comparison report, you just have to right click on any of the files and select "Compare content of two Baseline" - see here.
                  b) It works for directories as well. Furthermore, it seamlessly integrated with your predefined diff tool (cleardiff or 3rd-parties)
                  Regards,
                  Tamir Gefen, GoMidjets