[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/vc.el,v
From: |
Eric S. Raymond |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/vc.el,v |
Date: |
Thu, 11 Oct 2007 15:10:33 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Eric S. Raymond <esr> 07/10/11 15:10:33
Index: vc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.465
retrieving revision 1.466
diff -u -b -r1.465 -r1.466
--- vc.el 10 Oct 2007 18:52:45 -0000 1.465
+++ vc.el 11 Oct 2007 15:10:32 -0000 1.466
@@ -1985,16 +1985,33 @@
(error "Not a valid revision range."))
(vc-diff-internal backend t files rev1 rev2 (interactive-p)))
+(defun vc-contains-version-controlled-file (dir)
+ "Return t if DIR contains a version-controlled file, nil otherwise."
+ (catch 'found
+ (mapc (lambda (f) (and (not (file-directory-p f)) (vc-backend f) (throw
'found 't))) (directory-files dir))
+ nil))
+
;;;###autoload
(defun vc-diff (historic)
"Display diffs between file revisions.
-Normally this compares the current file and buffer with the most
-recent checked in revision of that file. This uses no arguments. With
-a prefix argument HISTORIC, it reads the file name to use and two
-revision designators specifying which revisions to compare."
+Normally this compares the currently selected fileset with their
+working revisions. With a prefix argument HISTORIC, it reads two revision
+designators specifying which revisions to compare.
+
+If no current fileset is available (that is, we are not in
+VC-Dired mode and the visited file of the current buffer is not
+under version control) behave specially; if there are
+version-controlled files in the current directory, treat all
+version-controlled files recursively beneath the current
+directory as the selected fileset.
+"
+
(interactive "P")
- (if historic
- (call-interactively 'vc-history-diff)
+ (cond ((not (vc-contains-version-controlled-file default-directory))
+ (error "No version-controlled files directly beneath default
directory"))
+ (historic
+ (call-interactively 'vc-history-diff))
+ (t
(let* ((files (vc-deduce-fileset t))
(first (car files))
(backend
@@ -2002,7 +2019,7 @@
(vc-responsible-backend first))
(t
(vc-backend first)))))
- (vc-diff-internal backend t files nil nil (interactive-p)))))
+ (vc-diff-internal backend t files nil nil (interactive-p))))))
;;;###autoload
(defun vc-revision-other-window (rev)
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/10/05
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/06
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/06
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/06
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/08
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/08
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Miles Bader, 2007/10/09
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/10
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/10
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v,
Eric S. Raymond <=
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/11
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/11
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/11
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/10/11
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Dan Nicolaescu, 2007/10/11
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2007/10/17
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2007/10/19
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/20
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Eric S. Raymond, 2007/10/20
- [Emacs-diffs] Changes to emacs/lisp/vc.el,v, Stefan Monnier, 2007/10/23