# HG changeset patch # User Andr Spiegel # Date 1003666889 0 # Node ID b2e4b1a5315a621817536529fd5a5d22c905194a # Parent 9031427edfa33a01b7f95189e4a03304599f16b4 (vc-cvs-diff-tree): New function. diff -r 9031427edfa3 -r b2e4b1a5315a lisp/vc-cvs.el --- a/lisp/vc-cvs.el Sun Oct 21 12:15:22 2001 +0000 +++ b/lisp/vc-cvs.el Sun Oct 21 12:21:29 2001 +0000 @@ -5,7 +5,7 @@ ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel -;; $Id: vc-cvs.el,v 1.23 2001/07/04 15:51:18 monnier Exp $ +;; $Id: vc-cvs.el,v 1.24 2001/08/28 17:06:36 spiegel Exp $ ;; This file is part of GNU Emacs. @@ -523,6 +523,30 @@ 1 ;; async diff, pessimistic assumption status)))) +(defun vc-cvs-diff-tree (dir &optional rev1 rev2) + "Diff all files at and below DIR." + (with-current-buffer "*vc-diff*" + (setq default-directory dir) + (if (vc-cvs-stay-local-p dir) + ;; local diff: do it filewise, and only for files that are modified + (vc-file-tree-walk + dir + (lambda (f) + (vc-exec-after + `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) + ;; possible optimization: fetch the state of all files + ;; in the tree via vc-cvs-dir-state-heuristic + (unless (vc-up-to-date-p ',f) + (message "Looking at %s" ',f) + (vc-diff-internal ',f ',rel1 ',rel2)))))) + ;; cvs diff: use a single call for the entire tree + (let ((coding-system-for-read + (or coding-system-for-read 'undecided))) + (apply 'vc-do-command "*vc-diff*" 1 "cvs" nil "diff" + (and rel1 (concat "-r" rel1)) + (and rel2 (concat "-r" rel2)) + (vc-diff-switches-list cvs)))))) + (defun vc-cvs-annotate-command (file buffer &optional version) "Execute \"cvs annotate\" on FILE, inserting the contents in BUFFER. Optional arg VERSION is a version to annotate from."