]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-update): Check if the buffer is unsaved only if it
authorDan Nicolaescu <dann@ics.uci.edu>
Sat, 29 Mar 2008 00:17:54 +0000 (00:17 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Sat, 29 Mar 2008 00:17:54 +0000 (00:17 +0000)
actually exists.
(vc-status-mode-map, vc-status-menu-map): Bind vc-update.

lisp/ChangeLog
lisp/vc.el

index 16c8cb6bc57abe7ccf747a80bc8c104d967f1de8..2b44763bea35ffb767f5a02cb4c4bd998e4c16bc 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-29  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * vc.el (vc-update): Check if the buffer is unsaved only if it
+       actually exists.
+       (vc-status-mode-map, vc-status-menu-map): Bind vc-update.
+
 2008-03-28  Magnus Henoch  <mange@freemail.hu>
 
        * net/dns.el (dns-write): Use set-buffer-multibyte.
index c252a905a3d70cd9c13ca4652a405b802477b4e7..8a707464a037ab5a3ca1d2a84a66b58f1ebcec7c 100644 (file)
@@ -2750,6 +2750,9 @@ With prefix arg READ-SWITCHES, specify a value to override
     (define-key map [register]
       '(menu-item "Register" vc-status-register
                  :help "Register file set into the version control system"))
+    (define-key map [update]
+      '(menu-item "Update" vc-update
+                 :help "Update the current fileset's files to their tip revisions"))
     ;; vc-print-log uses the current buffer, not a file.
     ;; (define-key map [log]
     ;;  '(menu-item "Show history" vc-status-print-log
@@ -2815,6 +2818,7 @@ With prefix arg READ-SWITCHES, specify a value to override
     ;; VC commands.
     (define-key map "=" 'vc-diff)
     (define-key map "a" 'vc-status-register)
+    (define-key map "+" 'vc-update)
     ;; Can't be "g" (as in vc map), so "A" for "Annotate".
     (define-key map "A" 'vc-annotate)
     ;; vc-print-log uses the current buffer, not a file.
@@ -3364,8 +3368,9 @@ contains changes, and the backend supports merging news, then any recent
 changes from the current branch are merged into the working file."
   (interactive)
   (dolist (file (vc-deduce-fileset))
-    (if (buffer-modified-p (get-file-buffer file))
-       (error "Please kill or save all modified buffers before updating."))
+    (when (let ((buf (get-file-buffer file)))
+           (and buf (buffer-modified-p buf)))
+      (error "Please kill or save all modified buffers before updating."))
     (if (vc-up-to-date-p file)
        (vc-checkout file nil t)
       (if (eq (vc-checkout-model file) 'locking)