Page 1 of 1

Diff Functions

Posted: Tue Jun 15, 2010 12:35 pm
by pwdiener
I think it would be useful to have a couple of small enhancements around Diff. First, the ability to select 2 files on the buffer list and do a diff would be useful.

Second, I think it would be helpful to have a couple additional keyboard/macro functions for Diff. I know you can start the diff dialog, but it might also be useful to be able to have some functions to set the 2 file names to be compared (and any diff options) and launch the actual diff display, either the diff dialog version or the tool window difference display.

I've got a list of files that create conflicts on a sync between 2 machines, and it would be helpful to be able to write a macro to process the list in pairs, view the diff, and decide which to keep.

Posted: Mon Jul 05, 2010 6:42 pm
by Guest
First, the ability to select 2 files on the buffer list and do a diff would be useful.
There is already a macro to do this, diff2Tabs.lua. It can diff two sequential tabs. You may move the tabs to make them sequential if the tabs are not when you begin.

Code: Select all

function key_macro()
 screen_update_disable()
 local fname1 = get_file_name()
 WindowNext()
 local fname2 = get_file_name()
 WindowPrevious()
 screen_update()

 local cmd = 'p4merge.exe "' .. fname1 .. '" "' .. fname2 .. '"'
 --message_box(1,cmd)
 system(cmd)

end
key_macro()

Posted: Sun Jul 18, 2010 11:07 pm
by pwdiener
I have neither that macro nor that program, but you sent me in the right direction anyway. I had been focused on using the built-in diff, and hadn't even considered using an external diff function. I hooked up WinMerge and it works great - also a little friendlier than the built-in.

Bill

Posted: Mon Jul 19, 2010 12:21 am
by Guest
I have neither that macro nor that program
The macro code is shown in the mesaage text; just change p4merge.exe to point the WinDiff executabe. This is the difference tool that comes with Perforce.

Here is another nice difference tool: http://www.zeusedit.com/forum/viewtopic.php?t=1435