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


From: Andre Spiegel
Subject: [Emacs-diffs] Changes to emacs/lisp/vc.el
Date: Thu, 28 Feb 2002 08:01:48 -0500

Index: emacs/lisp/vc.el
diff -c emacs/lisp/vc.el:1.328 emacs/lisp/vc.el:1.329
*** emacs/lisp/vc.el:1.328      Thu Feb 28 04:59:08 2002
--- emacs/lisp/vc.el    Thu Feb 28 08:01:48 2002
***************
*** 6,12 ****
  ;; Maintainer: Andre Spiegel <address@hidden>
  ;; Keywords: tools
  
! ;; $Id: vc.el,v 1.328 2002/02/28 09:59:08 spiegel Exp $
  
  ;; This file is part of GNU Emacs.
  
--- 6,12 ----
  ;; Maintainer: Andre Spiegel <address@hidden>
  ;; Keywords: tools
  
! ;; $Id: vc.el,v 1.329 2002/02/28 13:01:48 spiegel Exp $
  
  ;; This file is part of GNU Emacs.
  
***************
*** 2570,2575 ****
--- 2570,2603 ----
      (message "Reverting %s..." file)
      (vc-revert-file file)
      (message "Reverting %s...done" file)))
+ 
+ ;;;###autoload
+ (defun vc-update ()
+   "Update the current buffer's file to the latest version on its branch.
+ If the file contains no changes, and is not locked, then this simply replaces
+ the working file with the latest version on its branch.  If the file contains
+ changes, and the backend supports merging news, then any recent changes from 
+ the current branch are merged into the working file."
+   (interactive)
+   (vc-ensure-vc-buffer)
+   (vc-buffer-sync nil)
+   (let ((file buffer-file-name))
+     (if (vc-up-to-date-p file)
+         (vc-checkout file nil "")
+       (if (eq (vc-checkout-model file) 'locking)
+           (if (eq (vc-state file) 'edited)
+               (error 
+                (substitute-command-keys 
+            "File is locked--type \\[vc-revert-buffer] to discard changes"))
+             (error 
+              (substitute-command-keys
+            "Unexpected file state (%s)--type \\[vc-next-action] to correct") 
+                    (vc-state file)))
+         (if (not (vc-find-backend-function (vc-backend file) 'merge-news))
+             (error "Sorry, merging news is not implemented for %s" 
+                    (vc-backend file))
+           (vc-call merge-news file)
+           (vc-resynch-window file t t))))))
  
  (defun vc-version-backup-file (file &optional rev)
    "Return name of backup file for revision REV of FILE.



reply via email to

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