changeset 82909:01df6fb7c1e7

(vc-svn-diff): If the repository version of all the files is the same as the specified OLDVERS, do a local diff.
author Glenn Morris <rgm@gnu.org>
date Mon, 27 Aug 2007 07:04:45 +0000
parents 31119bf4489e
children 292ec9e3a20c
files lisp/vc-svn.el
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/vc-svn.el	Mon Aug 27 07:04:25 2007 +0000
+++ b/lisp/vc-svn.el	Mon Aug 27 07:04:45 2007 +0000
@@ -399,6 +399,17 @@
 
 (defun vc-svn-diff (files &optional oldvers newvers buffer)
   "Get a difference report using SVN between two versions of fileset FILES."
+  (and oldvers
+       (catch 'no
+	 (dolist (f files)
+	   (or (equal oldvers (vc-workfile-version f))
+	       (throw 'no nil)))
+	 t)
+       ;; Use nil rather than the current revision because svn handles
+       ;; it better (i.e. locally).  Note that if _any_ of the files
+       ;; has a different revision, we fetch the lot, which is
+       ;; obviously sub-optimal.
+       (setq oldvers nil))
   (let* ((switches
 	    (if vc-svn-diff-switches
 		(vc-switches 'SVN 'diff)