summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-03-21 20:06:04 +0000
committerRichard M. Stallman <rms@gnu.org>1997-03-21 20:06:04 +0000
commit533abb3d72b1d5ee6473e1c1843cb0842c27597c (patch)
tree5b433bbb5b0f4a0d214250f59d5b7325f0313bb0
parentf63cf9f9cfc1465e0b89f01fdf0b58a24b2ab00e (diff)
downloademacs-533abb3d72b1d5ee6473e1c1843cb0842c27597c.tar.gz
(vc-next-action-on-file): With implicit checkout, make
sure not to lose unsaved changes.
-rw-r--r--lisp/vc.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/vc.el b/lisp/vc.el
index 70abb77b545..e4ffc8dcf9f 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -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