- (setq default-directory dir)
- (if (vc-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-mcvs-dir-state-heuristic
- (unless (vc-up-to-date-p ',f)
- (message "Looking at %s" ',f)
- (vc-diff-internal ',f ',rev1 ',rev2))))))
- ;; cvs diff: use a single call for the entire tree
- (let ((coding-system-for-read
- (or coding-system-for-read 'undecided)))
- (apply 'vc-mcvs-command "*vc-diff*" 1 nil "diff"
- (and rev1 (concat "-r" rev1))
- (and rev2 (concat "-r" rev2))
- (vc-switches 'MCVS 'diff))))))
+ ;; Run the command from the root dir so that `mcvs filt' returns
+ ;; valid relative names.
+ (setq default-directory (vc-mcvs-root dir))
+ ;; cvs diff: use a single call for the entire tree
+ (let ((coding-system-for-read (or coding-system-for-read 'undecided)))
+ (apply 'vc-mcvs-command "*vc-diff*" 1 dir "diff"
+ (and rev1 (concat "-r" rev1))
+ (and rev2 (concat "-r" rev2))
+ (vc-switches 'MCVS 'diff)))))