1107 |
;; Check relation of buffer and file, and make sure |
;; Check relation of buffer and file, and make sure |
1108 |
;; user knows what he's doing. First, finding the file |
;; user knows what he's doing. First, finding the file |
1109 |
;; will check whether the file on disk is newer. |
;; will check whether the file on disk is newer. |
1110 |
(if vc-dired-mode |
(set-buffer visited) |
1111 |
(find-file-other-window file) |
;; ignore buffer-read-only during this test |
1112 |
(set-buffer (find-file-noselect file))) |
(let ((buffer-read-only (not (file-writable-p file)))) |
1113 |
|
(if vc-dired-mode |
1114 |
|
(find-file-other-window file) |
1115 |
|
(find-file-noselect file))) |
1116 |
(if (not (verify-visited-file-modtime (current-buffer))) |
(if (not (verify-visited-file-modtime (current-buffer))) |
1117 |
(if (yes-or-no-p "Replace file on disk with buffer contents? ") |
(if (yes-or-no-p "Replace file on disk with buffer contents? ") |
1118 |
(write-file (buffer-file-name)) |
(write-file (buffer-file-name)) |
1227 |
(yes-or-no-p (concat "File has unlocked changes. " |
(yes-or-no-p (concat "File has unlocked changes. " |
1228 |
"Claim lock retaining changes? "))) |
"Claim lock retaining changes? "))) |
1229 |
(progn (vc-call steal-lock file) |
(progn (vc-call steal-lock file) |
1230 |
|
(clear-visited-file-modtime) |
1231 |
;; Must clear any headers here because they wouldn't |
;; Must clear any headers here because they wouldn't |
1232 |
;; show that the file is locked now. |
;; show that the file is locked now. |
1233 |
(vc-clear-headers file) |
(vc-clear-headers file) |
1234 |
|
(write-file (buffer-file-name)) |
1235 |
(vc-mode-line file)) |
(vc-mode-line file)) |
1236 |
(if (not (yes-or-no-p |
(if (not (yes-or-no-p |
1237 |
"Revert to checked-in version, instead? ")) |
"Revert to checked-in version, instead? ")) |
3254 |
These bindings are added to the global keymap when you enter this mode: |
These bindings are added to the global keymap when you enter this mode: |
3255 |
\\[vc-next-action] perform next logical version-control operation on current file |
\\[vc-next-action] perform next logical version-control operation on current file |
3256 |
\\[vc-register] register current file |
\\[vc-register] register current file |
|
\\[vc-toggle-read-only] like next-action, but won't register files |
|
3257 |
\\[vc-insert-headers] insert version-control headers in current file |
\\[vc-insert-headers] insert version-control headers in current file |
3258 |
\\[vc-print-log] display change history of current file |
\\[vc-print-log] display change history of current file |
3259 |
\\[vc-revert-buffer] revert buffer to latest version |
\\[vc-revert-buffer] revert buffer to latest version |