# HG changeset patch # User Dan Nicolaescu # Date 1206749874 0 # Node ID 84a5da4da42292303ad8e38d917672fc2baa9ac8 # Parent 3a47285f02937ac9aaf224c9317d6a1c1b4331f0 (vc-update): Check if the buffer is unsaved only if it actually exists. (vc-status-mode-map, vc-status-menu-map): Bind vc-update. diff -r 3a47285f0293 -r 84a5da4da422 lisp/ChangeLog --- a/lisp/ChangeLog Fri Mar 28 21:37:03 2008 +0000 +++ b/lisp/ChangeLog Sat Mar 29 00:17:54 2008 +0000 @@ -1,3 +1,9 @@ +2008-03-29 Dan Nicolaescu + + * 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 * net/dns.el (dns-write): Use set-buffer-multibyte. diff -r 3a47285f0293 -r 84a5da4da422 lisp/vc.el --- a/lisp/vc.el Fri Mar 28 21:37:03 2008 +0000 +++ b/lisp/vc.el Sat Mar 29 00:17:54 2008 +0000 @@ -2750,6 +2750,9 @@ (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 @@ ;; 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 @@ 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)