+ ;; If a buffer has unsaved changes, a checkout would discard those
+ ;; changes, so treat the buffer as having unlocked changes.
+ (when (and (not (eq model 'implicit)) (eq state 'up-to-date))
+ (dolist (file files)
+ (let ((buffer (get-file-buffer file)))
+ (and buffer
+ (buffer-modified-p buffer)
+ (setq state 'unlocked-changes)))))
+
+ ;; Do the right thing.