]> code.delx.au - gnu-emacs/commitdiff
(vc-next-action-on-file): With implicit checkout, make
authorRichard M. Stallman <rms@gnu.org>
Fri, 21 Mar 1997 20:06:04 +0000 (20:06 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 21 Mar 1997 20:06:04 +0000 (20:06 +0000)
sure not to lose unsaved changes.

lisp/vc.el

index 70abb77b545c507355b1bb1b2e2eb075c6f752e7..e4ffc8dcf9f3f175f93f6cdf939510ec14296c06 100644 (file)
@@ -620,8 +620,12 @@ to an optional list of FLAGS."
                 (vc-resynch-buffer file t (not (buffer-modified-p buffer)))))
        (error "%s needs update" (buffer-name))))
 
-     ;; if there is no lock on the file, assert one and get it
-     ((not (setq owner (vc-locking-user file)))
+     ;; If there is no lock on the file, assert one and get it.
+     ;; (With implicit checkout, make sure not to lose unsaved changes.)
+     ((progn (and (eq (vc-checkout-model file) 'implicit)
+                  (buffer-modified-p buffer)
+                  (vc-buffer-sync))
+             (not (setq owner (vc-locking-user file))))
       (if (and vc-checkout-carefully
               (not (vc-workfile-unchanged-p file t)))
          (if (save-window-excursion