Announcement

Collapse
No announcement yet.

How to ignore ProductVersion by using Rules-Based ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to ignore ProductVersion by using Rules-Based ?

    Hi,

    we need to compare the actual build results with a stored one. At the moment I use the following script to run the task:

    Code:
    log normal "delta.log"
    load "New_Release" "Old_Release"
    expand all
    compare rules-based
    criteria
    criteria rules-based
    select lt.diff
    copy lt->rt
    folder-report layout:side-by-side title:test output-to:folder_report.html output-options:html-color
    In BC Gui I had to remove the ProductVersion-Rule from the list of important differences, so the files will be similar. But when I run my script, the files are treated as different (red in folder-report), even when I set the registry key like it is told here (http://www.scootersoftware.com/vbull...ead.php?t=4716). As conclusion of this, I think that the ProductVersion is not seen as unimportant information in the script run, but how to do this?

    The second problem I might have, is that no files are copied into the "Old_Release" folder. Is there something wrong with my select command?

    We use BC 2.5.1, if this makes any differences.
    Thanks for your help,

    Michael

  • #2
    Hello,

    Your script needs updating a bit.

    the load command can load 1 session, or 2 folders, but not 2 sessions.
    the compare command is used on a selection (after a select command).

    Are you able to perform the sync interactively the way you wish? Each step of script is a manual action you can take in the interactive GUI. Once you are syncing in the GUI, we can then work on getting the script itself working.

    Code:
    log normal "delta.log"
    load "New_Release"
    expand all
    select lt.diff
    copy lt->rt
    folder-report layout:side-by-side title:test output-to:folder_report.html output-options:html-color
    What type of information do you expect to see in the Folder-Report? That both sides are completely equal (except for Orphan files)?

    Use the same script a 2nd time, but load your other session to perform the same actions on the other session. Also, go into the session interactively and Save it with the proper criteria in the Comparison Control (disable all except Rules-based).

    If you are still having trouble, please let us know.
    Aaron P Scooter Software

    Comment


    • #3
      Hi,

      I have changed the order of the compare, but nothing has changed.
      My script now looks like:
      Code:
      log normal "delta.log"
      load "New_Release" "Old_Release"    <- these are folder, not sessions
      expand all
      criteria  <- clear criterias to ignore timestamp (read in forum)
      criteria rules-based
      select lt.diff
      compare rules-based
      copy lt->rt
      folder-report layout:side-by-side title:test output-to:folder_report.html output-options:html-color
      As I read in the post I have linked in my first post, it seems not possible to load sessions using BC2. Even if it is possible, how can I change the folders for the session using arguments? The folders have the buildnumber in its name, so they are always different.
      The content of the both folders are the buildresults where no source code has been changed, so they have to be identical except of the (Product-)Version, that is what I expect, but the most of them is shown red in folder-report. When I use the GUI, I can set the rules and filters as I wish and so the files are similar, ignoring unimportant differences.
      Regards,

      Michael

      Comment


      • #4
        Hello,

        The load command can load a session name. The issue is the toggle Ignore Unimportant Differences cannot be set via script. You can set that interactively, and the script will use how it was last set.

        I would recommend creating a session that has filters and comparison criteria set the way you want. Then just load sessionName (as detailed in the Help file).
        load sessionName
        load folder1 folder2 (if you need to, otherwise skip if saved with the session)
        expand all
        select lt.diff
        copy lt->rt
        folder-report

        Setting Criteria will run the comparison on any open, aligned files. You should not need to then select them and run the comparison again.
        Aaron P Scooter Software

        Comment


        • #5
          Hi Aaron,

          sorry for the late response, but haven't found the time to test your suggestions. I have tested your changes, but the loading of the session does not work.
          To test the loading of a session (session name is "test") I used a very simple script:
          Code:
          log normal "build.log"
          load "test"
          But the log shows the following error (also tested without ") :
          Code:
          22.10.2009 09:25:49  >> log normal "build.log"
          22.10.2009 09:25:49  >> load "test"
          22.10.2009 09:25:49  Load Comparison:  <->
          22.10.2009 09:25:49  Script Error: Unable to load base folder
          22.10.2009 09:25:49  >> User Canceled
          22.10.2009 09:25:49  Script completed in 0,01 seconds
          Am I doing something wrong or does it not work with BC 2.5.1 ?
          Thanks,

          Michael

          Comment


          • #6
            Sorry about that,

            BC2 does not support loading an empty session, it would require to have two temp folders loaded. BC3 does support loading the session without folders defined.

            Here's your script, modified a bit. Having the criteria section above the load means the load will trigger the correct comparison, and you won't need to do it twice. You also don't need the 2nd compare, since the initial criteria will be used during the load.

            log normal "delta.log"
            criteria <- clear criterias to ignore timestamp (read in forum)
            criteria rules-based
            load "New_Release" "Old_Release" <- these are folder, not sessions
            expand all
            select lt.diff
            copy lt->rt
            folder-report layout:side-by-side title:test output-to:folder_report.html output-options:html-color

            What issues do you run into if you use this?

            Also, what do you see if you use the program interactively, set your Comparison Criteria, then Load your Folders, then click the Expand All button, then use the Display Filters to show Only Diff (or Show All and look for Red)?

            You can email us screenshots to support@scootersoftware.com . If you do, please include a link back to this forum post.
            Aaron P Scooter Software

            Comment


            • #7
              Side Note:
              All BC2.x updates are free for 2.x users. You can download the latest BC2 here:
              http://www.scootersoftware.com/download.php?zz=dl2_en

              Also, you may be eligable for a discount or upgrade for BC3:
              http://www.scootersoftware.com/shop.php?zz=upgrades

              You can install and try BC3 without uninstalling BC2. They install to separate folders and keep their settings separate. This way, you can trial BC3 while still using BC2 for day to day work.
              http://www.scootersoftware.com/download.php
              Aaron P Scooter Software

              Comment


              • #8
                Hi,

                the problem with this script is, that the unimportant differences are taken into consideration, so that even if the DateTimeModified is the only change, the file will be copied. Additionaly to the normal unimportant differences the ProductVersion has to be one too.
                Regards,

                Michael

                Comment


                • #9
                  Hello Michael,

                  If you set the toggle Ignore Unimportant Differences to 'On' in the GUI, then it will be used in the script as well. The issue is this option cannot be set in script.

                  So if you open the files in the GUI, and the date is by default Blue, toggle on Ignore Unimportant Differences (and leave the toggle on). This should hide all Blue Text as black. Make sure the toggle is on in the Directory Viewer as well.

                  Does that clear up the issue with script for you?
                  Aaron P Scooter Software

                  Comment


                  • #10
                    Hi Aaron,

                    I use the following script now and it seems to work. It seems not to be a good idea, to start BC GUI and the script with different credentials. Because after using the same account used for BC GUI it works.
                    Code:
                    criteria
                    criteria rules-based
                    load "New_Release" "Old_Release"
                    expand all
                    select lt.diff
                    copy lt->rt
                    But only those files are copied, that exists in both folders, new ones are ignored. What do I have to change to make this work?
                    Is there any possibility to create the rules/settings with an script or batch file?
                    Thanks,

                    Michael

                    Comment


                    • #11
                      Hello Michael,

                      BC2 Settings are stored per Windows User Account by default. So if a different user account is activating the script, you will need to log in as them to setup BC2. Otherwise, convert BC2 into a Single Directory Install (like is used on a USB stick) for *all* users of that install to share settings, sessions, etc.
                      http://www.scootersoftware.com/suppo...vablemedia.php

                      To copy different files and files that only exist on one side (new files):
                      Code:
                      criteria
                      criteria rules-based
                      load "New_Release" "Old_Release"
                      expand all
                      select lt.diff lt.orphan
                      copy lt->rt

                      Side Note:
                      If you need to copy left differences and newer files, you may just want to use the sync update command instead of manually selecting and copying.
                      Code:
                      criteria rules-based
                      load "New_Release" "Old_Release"
                      sync create-empty update:lt->rt
                      or add a selection of newer files
                      Code:
                      criteria rules-based
                      load "New_Release" "Old_Release"
                      expand all
                      select lt.diff lt.newer lt.orphan
                      copy lt->rt
                      lt.diff only selects files that are content different, but have equal timestamps.
                      lt.newer selects files that are newer on the left
                      lt.orphan selects files that only exist on the left, and are not aligned to a file on the right.

                      If you have any questions, please let us know. I recommend testing script with test data while you are still working out how it is going to affect your files.
                      Last edited by Aaron; 27-Oct-2009, 10:54 AM. Reason: added the example needed. topmost.
                      Aaron P Scooter Software

                      Comment


                      • #12
                        Hello,

                        I just re-read your script and realized you are clearing out the timestamp as part of the comparison. If you want to copy files that are newer in timestamp, then the timestamp must be enabled for the comparison. It would also need to be enabled for sync update to work. I will edit the above code examples to reflect that.

                        By New you mean files that are orphans, and for that you would simply use:
                        select lt.diff lt.orphan
                        Aaron P Scooter Software

                        Comment

                        Working...
                        X