emacs-diffs
[Top][All Lists]
Advanced

[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: Fri, 09 May 2008 20:17:55 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Eric S. Raymond <esr>   08/05/09 20:17:51

Index: vc.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc.el,v
retrieving revision 1.650
retrieving revision 1.651
diff -u -b -r1.650 -r1.651
--- vc.el       9 May 2008 20:07:01 -0000       1.650
+++ vc.el       9 May 2008 20:17:50 -0000       1.651
@@ -1002,10 +1002,10 @@
        node (lambda (f) (when (vc-backend f) (push f flattened)))))
     (nreverse flattened)))
 
-(defun vc-deduce-fileset ()
+(defun vc-deduce-fileset (&optional observer)
   "Deduce a set of files and a backend to which to apply an operation and
 the common state of the fileset.  Return (BACKEND . FILESET)."
-  (let* ((fileset (vc-dispatcher-selection-set))
+  (let* ((fileset (vc-dispatcher-selection-set observer))
          ;; FIXME: Store the backend in a buffer-local variable.
          (backend (if (derived-mode-p 'vc-dir-mode)
                       (vc-responsible-backend default-directory)
@@ -1031,6 +1031,16 @@
       (unless (vc-backend buffer-file-name)
        (error "File %s is not under version control" buffer-file-name))))))
 
+(defun vc-buffer-sync (&optional not-urgent)
+  "Make sure the current buffer and its working file are in sync.
+NOT-URGENT means it is ok to continue if the user says not to save."
+  (when (buffer-modified-p)
+    (if (or vc-suppress-confirm
+           (y-or-n-p (format "Buffer %s modified; save it? " (buffer-name))))
+       (save-buffer)
+      (unless not-urgent
+       (error "Aborted")))))
+
 ;;; Support for the C-x v v command.
 ;; This is where all the single-file-oriented code from before the fileset
 ;; rewrite lives.
@@ -1561,7 +1571,7 @@
 (defun vc-version-diff (files rev1 rev2)
   "Report diffs between revisions of the fileset in the repository history."
   (interactive
-   (let* ((vc-fileset (vc-deduce-fileset))
+   (let* ((vc-fileset (vc-deduce-fileset t))
          (files (cdr vc-fileset))
           (backend (car vc-fileset))
          (first (car files))
@@ -2123,7 +2133,7 @@
   "List the change log of the current fileset in a window.
 If WORKING-REVISION is non-nil, leave the point at that revision."
   (interactive)
-  (let* ((vc-fileset (vc-deduce-fileset))
+  (let* ((vc-fileset (vc-deduce-fileset t))
         (backend (car vc-fileset))
         (files (cdr vc-fileset))
         (working-revision (or working-revision (vc-working-revision (car 
files)))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]