PDA

View Full Version : HTML optput displaying unimportant differences in Red.


Idiot60
21-Dec-2011, 05:21 PM
Hi Scooter Software,

I've been pottering round with BC for awhile now and I'm still very impressed but I've got a couple of questions, but first I'll try and detail my problem before asking the question (if too long then please skip down to the questions at the end).

I have several programs outputting reports into different folders. I then wish to compare the reports to a 'master' copy I've already created/stored and then report on any differences (that haven't been listed as unimportant in the rules).

E.g. Reports written to multiple folders i.e. \Reports\Mike\ Report 1, 2, 3 then \Reports\Mary\Report 1, 2, 3
Then compare them to the masters kept elsewhere i.e. \Master\Mike Report 1, 2, 3 and \Reports\Mary\Reports 1, 2, 3

I had trouble getting the rules to apply to the CSV files so I've changed them to be opened as a MS Word Document (Tools > File Formats).

I've created and applied the rules (regarding unimportant differences) to everywhere so when I open them they don't appear as red (the rules are generally there to stop it complaining about variations in printed date/time etc).

I use the following bat file to trigger it:
bcompare.exe @CompareFoldersScript.txt
Start \Reports\Report\Audit_%Date:~10,4%-%Date:~4,2%-%Date:~7,2%.html
(the second line is to open the audit report it creates from the script)

The CompareFoldersScript.txt is as follows:
# Set up basic comparison features
criteria rules-based
# Load first comparison
load D:\Reports\Active D:\Reports\Master
#Expand to affect sub-folders and files
expand all
# Generate a report of the differences labelled with todays date
folder-report layout:side-by-side options:display-all output-to: D\Reports\Report\Audit_%date%.html output-options:html-color

Unfortunately I'm still having some troubles.

1. How can I stop the reports than only contain unimportant differences appearing as red in the HTML file? Even though it has a ≈ the text still appears as red on either side (but when I open it in BC later they all match with no red displayed). The thread title "Creating Folder Reports showing ininportant differences " by Markus W was interesting but for reply #4 step number 6 I'm unable to see an option for Enable Rules Based" has this moved or am I overlooking it? (Should I be playing with html-custom?)
2. Leading on from the above question. If a report only contains unimportant differences how can I stop it from appearing in the options:ignore-unimportant output?
3. I've tried using "options:ignore-unimportant,display-context" but I don't believe this is compatible with the folder-report type yet. Is that correct?
4. When manually comparing the two master folders haw can I get it to automatically trigger the comparison between all the files (at present they appear as red but when I drill into it they match due to the unimportant differences rule being triggered)
5. Is there any way to increase the amount of information displayed in the report comparison? If two reports don't match then display the 2 lines above and below the issue (which is possible for text-report but obviously not an ideal solution for this scenario).
6. If I did try and use the text-report option and define all the reports to be compared, how should I go about grouping or adding all the information together in a single file? I tried experimenting with append but without luck.

E.g.
bcompare.exe @CompareText.txt D:\Reports\Mike\Active\Report1 D:\Reports\Mike\Master\Report1 bob.html
bcompare.exe @CompareText.txt D:\Reports\Mike\Active\Report2 D:\Reports\Mike\Master\Report2 append bob.html

CompareText.txt
load D:\Reports\Mike\Master D:\Reports\Mike\Active
text-report layout:side-by-side &
options:ignore-unimportant,display-context &
output-to:%3 output-options:html-color %1 %2

Thanks for the help, sorry for the long note. No panic on my end as I'm probably going to disappear for a couple of weeks soon.
Thanks,
Rob.

Aaron
22-Dec-2011, 01:19 PM
Hello,

I believe your step 5 is the ideal solution, and your sample script is really close to what is needed, but you need to also have an expand all and select statement:

bcompare.exe "@C:\bcscript.txt"

criteria timestamp:2sec rules-based
load D:\Reports\Active D:\Reports\Master
expand all
select diff.files newer.files older.files
text-report layout:side-by-side &
options:ignore-unimportant,display-context &
output-to:"c:\bcoutput.html" output-options:html-color

How does a script like that work for you? To generate the same report in the graphical interface, boot up the Folder Compare and load your folders. You can then enable a rules-based comparison to auto-scan all of your files. Then use the Edit menu -> Expand All, Edit menu -> Select All Files. Then the Actions menu -> File Compare Report.

For more detailed info on comparison status changing when viewing files, please check out this KB article:
http://www.scootersoftware.com/support.php?zz=kb_differentthensame

As for your leading questions: BC3 does not currently support the ignore unimportant differences toggle in the script for Folder Compare, so while similar the files are still considered Different. This is why they are still colored red.

Erik
04-Jan-2012, 09:15 AM
I've tried using "options:ignore-unimportant,display-context" but I don't believe this is compatible with the folder-report type yet. Is that correct?

Yes. "display-context" is only supported by text reports. We'll consider adding support for "ignore-unimportant" by folder reports in a future release.


If a report only contains unimportant differences how can I stop it from appearing in the options:ignore-unimportant output?

Here is a workaround:

Run Beyond Compare 3 and pick "Session > New Session > Folder Compare".
Pick "View > Ignore Unimportant Differences".
Pick "Session > Save Session As..." and type in "ignore-unimportant-session".
In your script file, add the following at the beginning:
load "ignore-unimportant-session"



How can I stop the reports that only contain unimportant differences appearing as red in the HTML file? Even though it has a ≈ the text still appears as red on either side (but when I open it in BC later they all match with no red displayed).

My guess is that when you are comparing folders interactively, you have "View > Ignore Unimportant Differences" enabled. This causes similar files to be shown in black. Use the workaround above to ignore unimportant differences in your script.


I'm unable to see an option for "Enable Rules Based". Has this moved or am I overlooking it?


In your Folder Compare session, pick "Session > Session Settings..." and switch to the "Comparison" tab.
In the "Requires opening files" section, enable "Compare contents" and pick "Rules-based comparison".
Click "OK".

As you've already discovered, the equivalent script command line is:
criteria rules-based


When manually comparing the two master folders how can I get it to automatically trigger the comparison between all the files (at present they appear as red but when I drill into it they match due to the unimportant differences rule being triggered)

Enable rules-based comparison.

Idiot60
20-Mar-2012, 09:38 PM
Thanks for the reply.
The work around worked very nicely thanks.
On a side note (just for your info if interested) a DEV indicated it works well for comparing 9 files (when merging) but when attempting to compare 10 files it will freeze and require a hard reboot. However he was able to open a few dozen files if Visual Studio closed, so it is suspected suspect there might be a memory leak (though his machine was sadly still limited to only 4GB memory at the time of writing this). There are a few packages unhappy with 4GB memory these days (Microsoft's FixIt springs to mind). This (memory handling for only 4GB machine) will become a problem when merging large changes or branches back into the trunk.

Not a panic, just thought you might be interested in the feedback (using BCompare 3.3.3.14128).

Thanks again for the help.

Aaron
21-Mar-2012, 08:55 AM
Hello,

Only 10 files shouldn't cause a problem with BC3, even with another application open. Is it perhaps an issue with the 10th, specific file? If performed in the graphical interface (selecting the files, and using the Actions menu -> File Compare Report), does the same 'freeze' occur? If you wait awhile (5-15 minutes), does the report eventually generate?

Idiot60
21-Mar-2012, 03:35 PM
As far as I know there wasn't an issue with the file (or files). He was able to merge them but needed to keep a close eye on the memory usage (thus when closing Visual Studio before comparing allowed more files to be compared). He is able to work around the issue (so it isn't a show stopper) but the memory usage/freeze/crash issue did surprise him.

No, after 5-15 minutes it didn't come back and a hard reboot was required.

Not a panic/worry or complaining just passing on some comments that were made when using it.

Thanks for the help and keep up the good work, I enjoy using Beyond Compare.