With tf.exe diff , I can get a diff.
Can I use this with ediff to visualize the diff in emacs?
I'm under the impression that ediff normally takes 2 or 3 files. I just have the one file, and a diff.
With tf.exe diff , I can get a diff.
Can I use this with ediff to visualize the diff in emacs?
I'm under the impression that ediff normally takes 2 or 3 files. I just have the one file, and a diff.
Here's a script I wrote that does it (I think!):
#!/bin/bash
# quit on error
set -e
# create a temporary file for the patched output
# note that the mkfifo command is optional - it will save disc space
patched_file=/tmp/diff_$RANDOM
mkfifo $patched_file
patch -o $patched_file "$1" "$2" &
vimdiff "$1" $patched_file
rm $patched_file
An option you might get to work is to use
M-x ediff-patch-buffer
It will prompt you for the patch file (or buffer if you have it open already), and the buffer to be patched. It then will march you through the differences.
Because the diff shows changes from the repository version to the current version, the patch is wrong direction. I'd write a command that generated the proper diff and use that - if you really want to use a diff.
Personally, I'd probably try to plug some code in to get 'ediff-revision
(which I have bound to C-x v -
) to get it to work.
Or just write some lisp which follows this pseudo code (since I don't have tf to do actual testing):
(defun ediff-tf-file-with-previous-version (file &optional version)
"DTRT and call ediff with the previous version of this file"
(interactive)
(ediff-files (progn
(unless version
(setq version (<parse-to-get-version> (shell-command (concat "tf.exe properties " file)))))
(shell-command (concat "tf.exe view " file (<munge-itemspec-version> version) " > " file ".older")))
file))
thanks R Berg for the fix
It looks as though someone has written a rudimentary Team Foundation mode, which you can grab from the wiki page here. It doesn't look like it has plugged anything into ediff
though.