Topic
  • 3 replies
  • Latest Post - ‏2013-06-04T06:54:34Z by marcdb
marcdb
marcdb
16 Posts

Pinned topic How to compare a baseline with its predecessor on the same stream

‏2013-05-27T12:26:49Z |

Hello,

Here is a scenario that we have frequently:

  • we have a "main stream" (main UCM project) containing baselines which are used as foundation baselines for the actual UCM development projects.
  • We rebase the Integration stream of  a development project, to a new baseline from the main stream.
  • Then we create a new baseline in the development project (we create a baseline on the compound/rootless component used for the development project).

If we then execute the command "cleartool diffbl -pred <latest_baseline_on_int_stream>", then ClearCase seems to compare the latest baseline on the integration stream of the development project, with its foundation baseline on the main stream. The result of this, is actually the complete change set of the development project (everything that has been delivered to its integration stream), since it was created.

This is however not what I want: I would like to compare the changes that have been injected through the rebase operation, by comparing the new baseline with the previous baseline on the same stream. Does anybody know if this can be done via an option of the diffbl command ?

(We are using ClearCase 8.0.0.3.)

Tx,

Marc

 

  • Tgefen
    Tgefen
    724 Posts
    ACCEPTED ANSWER

    Re: How to compare a baseline with its predecessor on the same stream

    ‏2013-05-27T21:43:58Z  

    I don't think that diffbl provides such a filter. This is one of the filters that are provided in R&D Reporter (http://gomidjets.com/rnd). You can download a free edition and try it.

    Furthermore, you can define a baseline convention that enables you to compare consequent baselines that match this naming convention.

     

    Join our US and Canada roadshow: Los Angeles; Rational Innovate (Orlando); Boston; Montreal and NYC: http://www.gomidjets.com/blog/?p=1749





     

    Updated on 2013-05-27T21:44:50Z at 2013-05-27T21:44:50Z by Tgefen
  • Dave-Robinson
    Dave-Robinson
    116 Posts
    ACCEPTED ANSWER

    Re: How to compare a baseline with its predecessor on the same stream

    ‏2013-06-01T10:02:49Z  

    Thinking of the question "what components do you want to do this for?", I answered "components where the stream is recommending a baseline", and came up with the following Perl

     

    ($stream,@recbls) = split (' ',`cleartool lsstream -fmt "%Xn %[rec_bls]Xp" -cview`);
    foreach (@recbls)
    {
        $component = `cleartool lsbl -fmt "%[component]Xp" $_`;
        chomp( @BLs = `cleartool lsbl -fmt "%Xn\\n" -stream $stream -component $component` )
            or next; # "No baselines for component $component in stream $stream\n";
        system ('cleartool','diffbl','-baselines','-activities','-versions',    # whatever opts you want, '-graphical' ?
                    (@BLs > 1 ?        # was there a previous for the latest ?
                            '-predecessor' :    # no, compare  foundation
                            $BLs[-2]),        # yes, compare second latest
                    $BLs[-1]);                # compare to latest
    }

     

  • Tgefen
    Tgefen
    724 Posts

    Re: How to compare a baseline with its predecessor on the same stream

    ‏2013-05-27T21:43:58Z  

    I don't think that diffbl provides such a filter. This is one of the filters that are provided in R&D Reporter (http://gomidjets.com/rnd). You can download a free edition and try it.

    Furthermore, you can define a baseline convention that enables you to compare consequent baselines that match this naming convention.

     

    Join our US and Canada roadshow: Los Angeles; Rational Innovate (Orlando); Boston; Montreal and NYC: http://www.gomidjets.com/blog/?p=1749





     

    Updated on 2013-05-27T21:44:50Z at 2013-05-27T21:44:50Z by Tgefen
  • Dave-Robinson
    Dave-Robinson
    116 Posts

    Re: How to compare a baseline with its predecessor on the same stream

    ‏2013-06-01T10:02:49Z  

    Thinking of the question "what components do you want to do this for?", I answered "components where the stream is recommending a baseline", and came up with the following Perl

     

    ($stream,@recbls) = split (' ',`cleartool lsstream -fmt "%Xn %[rec_bls]Xp" -cview`);
    foreach (@recbls)
    {
        $component = `cleartool lsbl -fmt "%[component]Xp" $_`;
        chomp( @BLs = `cleartool lsbl -fmt "%Xn\\n" -stream $stream -component $component` )
            or next; # "No baselines for component $component in stream $stream\n";
        system ('cleartool','diffbl','-baselines','-activities','-versions',    # whatever opts you want, '-graphical' ?
                    (@BLs > 1 ?        # was there a previous for the latest ?
                            '-predecessor' :    # no, compare  foundation
                            $BLs[-2]),        # yes, compare second latest
                    $BLs[-1]);                # compare to latest
    }

     

  • marcdb
    marcdb
    16 Posts

    Re: How to compare a baseline with its predecessor on the same stream

    ‏2013-06-04T06:54:34Z  

    Thinking of the question "what components do you want to do this for?", I answered "components where the stream is recommending a baseline", and came up with the following Perl

     

    ($stream,@recbls) = split (' ',`cleartool lsstream -fmt "%Xn %[rec_bls]Xp" -cview`);
    foreach (@recbls)
    {
        $component = `cleartool lsbl -fmt "%[component]Xp" $_`;
        chomp( @BLs = `cleartool lsbl -fmt "%Xn\\n" -stream $stream -component $component` )
            or next; # "No baselines for component $component in stream $stream\n";
        system ('cleartool','diffbl','-baselines','-activities','-versions',    # whatever opts you want, '-graphical' ?
                    (@BLs > 1 ?        # was there a previous for the latest ?
                            '-predecessor' :    # no, compare  foundation
                            $BLs[-2]),        # yes, compare second latest
                    $BLs[-1]);                # compare to latest
    }

     

    The reason why I asked this, is that we started using the ClearCase UCM plugin for Jenkins: https://wiki.jenkins-ci.org/display/JENKINS/ClearCase+UCM+Plugin.

    This plugin monitors a stream and looks for new baselines. When a new baseline is found, the changes with the previous baseline are calculated and a new build is triggered. The changes are shown in the output of the Jenkins-job in the same way as it is done for SVN, Git etc. 

    This works fine until the monitored stream is rebased. At that moment the difference with the new foundation baseline is calculated because the plugin uses "diffbl -pred" to calculate the differences, and that's not what we want at that moment. Furthermore, executing the command "diffbl -pred" when the presumed predecessor is the foundation baseline can take many hours, while the same command between two baselines on the same stream would take only a minute or so.

    The perl script might be useful as inspiration to request a change request for this plugin.

    Thanks,

    Marc