PDA

View Full Version : Moved lines and Alignment on File comparsion.


sgmoore
02-Jun-2006, 09:33 AM
Is there any option to complete ignore lines which have been merely moved?

For example, Visual Studio (2003) Form designer automatically generates a lot of code relating to the form's controls. Whenever a change is made to the control, it re-generates this section which can quite often be in a completely different order. Unfortunately it also sometimes decide to change the position of the controls slightly resulting in the controls driftly slightly out of alignment.
Correcting this using Beyond Compare is usually very straight forward, except when VS has moved all the lines around.

I have tried changing the alignment options in the viewer, but this does not seem to help. I am not sure whether this could be because there is no large section of un-changed code, because maybe every tenth line has been amended (as well as being moved)

Does this make sense and is should Beyond Compare cope with this?

Thanks

Stephen

Chris
02-Jun-2006, 03:45 PM
Hello Stephen,

Beyond Compare doesn't currently detect moved lines. If the lines are out of order, it will only see a difference. Moved line detection is something we're considering for the future.

Right now your best option is probably to use something to preformat the code into a standard order. This is what our HTML Tidy/XML Tidy Rule does, as does our Jalopy - Java Source Code Formatter rule.

Both rules are on our Additional Rules page:
http://www.scootersoftware.com/download.php?c=kb_morerules

If you can find a program to standardize the formatting of the text you want to compare, you can configure it to be called by BC before the text is opened for comparison in the File Viewer. Details are in the Rules>File Conversion Rules section of Beyond Compare's help file.

mgillespie
02-Mar-2011, 05:04 AM
Sorry for bumping an old post. Did anything ever happen about this? I have the exact same scenario, VS Designer moved lots of code blocks around and removed the event handers, I want to try and diff them to put them back!

Aaron
02-Mar-2011, 09:22 AM
We still handle it similarly as before, and have added a few additional conversion processes to our list:
http://www.scootersoftware.com/download.php?zz=kb_moreformats

and have a KB article on how to handle it with a custom solution (example: RESX files) here:
http://www.scootersoftware.com/support.php?zz=kb_externalconversion