Showing posts with label 3 Way Diff. Show all posts
Showing posts with label 3 Way Diff. Show all posts

Thursday, 8 January 2009

Merging and Rollbacks

Recent work has been now been focussed on finishing of the functions that I've been planning from the beginning, that got left behind for the extension re-write.

No new builds yet, but the source is coming along. I've had to spend some time re-familiarising myself with the folder diff engine, the gnu diff integration and the scintilla.Net controls. Finally I cleared up some rather tatty code behind the 3-way diff visualiser. This is neatly laid out in a set of classes under LizardDiff.Diff3Docs, one class per view, instead of a big single mess.

New features are:
  • Uncontrolled Changes in Lizard Review - see changes to files not checked out, new files added to TFS controlled folders but not 'added' and files deleted from the file system but not from TFS. This was a popular request.
  • Create Patch from the Folder Compare screen; you can build/save a gnu unified diff based patch file from the difference found by the comparer.
  • Proper (and improved) version browsing from the Folder Compare screen
  • Rename Tracking when comparing file system to TFS or TFS to TFS when 'to' and 'from' have the same repository path. This is done be parsing the changesets between 'to' and 'from' for renames. These are displayed in the output.
  • 2 Way Diff now shows numbers of Inserts, Changes and Deletions.

The next step is to manage applying the generated patch file to another folder/branch and list updated files and conflicts, and allow conflict resolution through the diff/merge tool. This be the 'Lizard Merge' tool, and will allow merging across any folders, 2nd/3rd, etc generation branches as well as strict TFS 1st generation branches. This will also become the 'Lizard Rollback' tool by taking the difference between a higher and lower change set (rather than lower to higher) and applying to the higher version.

All the current work is being checked into the .Net 2.0 branch, and will be merged into the 3.5 branch (using Lizard Merge) prior to the next.

I'll have to check my notes, but I think that will make LizardTF feature complete and ready for Beta!

Sunday, 24 February 2008

New Release LizardTF.alpha.v.0.2.0

Yep, that's right, I've finally published a release, here is some of what is in it:

Conflict resolution:

One spanking new merge/conflict resolution tool! Colours are a little toned down a bit since the prototype (below), but it took a while to get from prototype to production code, mainly due to the number of scenarios involved. I wanted the merge output window to show exactly what would be written out/saved, so where lines are removed these are shown only in the margins. The lines above and below the 'missing' section right-click to give 'redo above' or 'undo-merge below' options. Some lines can have both above and below options which can be for undo/redo merges or undo resolution.

Hopefully the system should be fairly intuitive to use and should be much better than the MS DiffMerge tool.

Options include:

Two diff views, diff view and merge/conflict view.
Diff view shows differences base:server (theirs) on the left and base:local (yours) on the right. Blank lines are used to keep the files in sync. In merge/conflict view all conflict areas are highlighted and all changes base:server that can/will be merged are shown merged into the right hand base:local view. Clicking between them and looking at the results is proably the best way to get a feel for this.

Context lines
Quite often there are long sections of code with no changes/conflicts, you can choose not to see them by choosing how many context lines around changes/conflicts to show

Three Layouts
Arrange the two diff views and output windows all side-by-side (good for wide screen monitors), diffs together, output beneath (like the MS DiffMerge tool), or my favorite, diffs side-by-side and output in a different window (great for twin monitor set ups)

Also :

Help Text
Don't know what all the colours mean? Hover over any coloured section and help text will explain what the section is showing.

Also new in this release a new history browser:
History on the left, full details of check-in on the right. Clink file on right to see history of that, use back button to return, or up-level button for folder history. Right click one or two versions for diff options.

Fed up with the 'Binary Files Differ' response when diffing dlls? Not with LizardTF:
(test data a little suspect, but trying to diff dlls or exes will give this screen to compare version stamps, etc)

Text diffs are like this:
(note line differnces shown beneath)
or:
(inline diff, only three context lines).

Note the left and right folder/repo/version browse buttons. once a diff is in view you can reload either side from any file or repository item. If a repository item is loaded you can choose any historic version.

All version picker combo boxes have a 'browse' item, when selected this launches the history browser (shown above) to help you pick the right version.

Also from the explorer context menu:
Blame (anotate) shows originating changeset id/author for all lines in a source file.
Check out/lock, allows locking
Lizard Review, shows all conflicts, out-of-dates, pending changes and other checkouts for selected path
Get specific version - version combo for 'Get' option now works!

Create Workspace option asks if you want to get latest for new workspace and scans/builds Lizard meta data.

Soon I am going to have to write a manual.

Thursday, 31 January 2008

Well, it's certainly colourful...

I use to use TortoiseSVN a lot. It is the inspiration for LizardTF. I was pretty good at branch management and use to do the hard to keep up with merges for some of my colleagues. I quite liked the 3-way diff/merge tool, but could never understand all the colours. It seemed to have hundreds, and I never found a key.

Zoom forward a year and a bit, I use TFS at work now, I hate the Microsoft merge tool, so I'm writing a fresh one. I've got the two-way diffs all sorted (should be released this weekend) and I'm feeling all cocky, I can read the diff3 output, and I'm ready to go...

So you've got add, deletes and changes, easy. You have changes which are the same in both server and local files, you don't have to anything with these, easy. You have changes only on the server, these can merge straight into the local target, still easy. You have different changes to server and local, mark it up as a conflict, still pretty easy. These conflicts can be any of the three types on either side. Arrrggghhh! How many variations of add, deletes and changes do you end up with? Loads. How many colours do you need to clearly identify them all? Too many!

Here is the V0.1 LizardTF 3-way-diff visualiser. Base/Server changes shown inline on the left, Base/Local changes shown inline on right. Green for inserts, Blue for changes, Red for deletions, pale shades where the same change has already been made to both server and local. Mid colours for changes on the server which are mergeable (no change on local/local matches bases), and dark colours with yellow text and square glyphs for your actual, needs intervention, conflicts. Plus the usual mark up of base/local changes*.

So there you go. No wonder TortoiseSVN was rather colourful.

Scintilla also offers quite nice TipText, so hovering over a marked area will display a pop-up text describing the meaning of the colours. (not shown).


*Only if the local target shares the base with the server. With LizardTF it will be possible to merge changesets/diffs into any target irrespective of origin.