Function: vc-svn-diff

vc-svn-diff is a byte-compiled function defined in vc-svn.el.gz.

Signature

(vc-svn-diff FILES &optional OLDVERS NEWVERS BUFFER ASYNC)

Documentation

Get a difference report using SVN between two revisions of fileset FILES.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc-svn.el.gz
(defun vc-svn-diff (files &optional oldvers newvers buffer async)
  "Get a difference report using SVN between two revisions of fileset FILES."
  (and oldvers
       (not newvers)
       files
       (catch 'no
	 (dolist (f files)
	   (or (equal oldvers (vc-working-revision 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))
  (setq async (and async (or oldvers newvers)))	; Svn diffs those locally.
  (let* ((switches
	    (if vc-svn-diff-switches
		(vc-switches 'SVN 'diff)
	      (list (concat "--diff-cmd=" diff-command) "-x"
		    (mapconcat #'identity (vc-switches nil 'diff) " ")))))
      (apply #'vc-svn-command buffer
	     (if async 'async 0)
	     files "diff"
	     (append
	      switches
	      (when oldvers
		(list "-r" (if newvers (concat oldvers ":" newvers)
			     oldvers)))))
      (if async 1		      ; async diff => pessimistic assumption
	;; For some reason `svn diff' does not return a useful
	;; status w.r.t whether the diff was empty or not.
	(buffer-size (get-buffer buffer)))))