diff options
| author | Eric S. Raymond | 2014-11-20 03:52:24 -0500 |
|---|---|---|
| committer | Eric S. Raymond | 2014-11-20 03:52:24 -0500 |
| commit | e7e9dbccb05175a512c40a3f433887c40abaa469 (patch) | |
| tree | 551b1a5015334f0a553d7873a1b7b45c4e52aaf2 | |
| parent | f83109f0fabe13c0175ca6fe23b475bd8a9d9d99 (diff) | |
| download | emacs-e7e9dbccb05175a512c40a3f433887c40abaa469.tar.gz emacs-e7e9dbccb05175a512c40a3f433887c40abaa469.zip | |
Remove editable argument from VC's backend checkout methods.
Alters vc/vc-bzr.el, vc/vc-cvs.el, vc/vc-dav.el, vc/vc-git.el,
vc/vc-hg.el, vc/vc-mtn.el, vc/vc-rcs.el, vc/vc-sccs.el,
vc/vc-svn.el, vc/vc.el.
where this matters (which is only in SCCS and RCS) files are now always
checked out editable. This may actually have been dynamically true
already - it looks like the vc-next-action code evolved past visiting
the other case. Tested with RCS.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/vc/vc-bzr.el | 2 | ||||
| -rw-r--r-- | lisp/vc/vc-cvs.el | 7 | ||||
| -rw-r--r-- | lisp/vc/vc-dav.el | 2 | ||||
| -rw-r--r-- | lisp/vc/vc-git.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-hg.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-mtn.el | 2 | ||||
| -rw-r--r-- | lisp/vc/vc-rcs.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-sccs.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-svn.el | 6 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 49 |
11 files changed, 49 insertions, 43 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2020fd34f37..473a1f8d745 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2014-11-20 Eric S. Raymond <esr@snark> | 1 | 2014-11-20 Eric S. Raymond <esr@snark> |
| 2 | 2 | ||
| 3 | * vc/vc-bzr.el, vc/vc-cvs.el, vc/vc-dav.el, vc/vc-git.el, | ||
| 4 | vc/vc-hg.el, vc/vc-mtn.el, vc/vc-rcs.el, vc/vc-sccs.el, | ||
| 5 | vc/vc-svn.el, vc/vc.el: Remove editable argument from the backend | ||
| 6 | checkout methods; where it matters (which is only in SCCS and RCS) | ||
| 7 | files are always checked out editable. This may actually have | ||
| 8 | been dynamically true already - it looks like the vc-next-action | ||
| 9 | code evolved past visiting the other case. Tested with RCS. | ||
| 10 | |||
| 3 | * vc/vc-arch.el, vc/vc-bzr.el, vc/vc-cvs.el, vc/vc-dav.el, | 11 | * vc/vc-arch.el, vc/vc-bzr.el, vc/vc-cvs.el, vc/vc-dav.el, |
| 4 | vc/vc-git.el, vc/vc-hg.el, vc/vc-mtn.el, vc/vc-rcs.el, | 12 | vc/vc-git.el, vc/vc-hg.el, vc/vc-mtn.el, vc/vc-rcs.el, |
| 5 | vc/vc-sccs.el, vc/vc-svn.el, vc/vc.el: Remove never-used rev | 13 | vc/vc-sccs.el, vc/vc-svn.el, vc/vc.el: Remove never-used rev |
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 2c1941bf6a8..073c355df6f 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el | |||
| @@ -655,7 +655,7 @@ or a superior directory.") | |||
| 655 | (expand-file-name ".bzrignore" | 655 | (expand-file-name ".bzrignore" |
| 656 | (vc-bzr-root file))) | 656 | (vc-bzr-root file))) |
| 657 | 657 | ||
| 658 | (defun vc-bzr-checkout (_file &optional _editable rev) | 658 | (defun vc-bzr-checkout (_file &optional rev) |
| 659 | (if rev (error "Operation not supported") | 659 | (if rev (error "Operation not supported") |
| 660 | ;; Else, there's nothing to do. | 660 | ;; Else, there's nothing to do. |
| 661 | nil)) | 661 | nil)) |
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 6fbfa727138..4bce79c5d5b 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el | |||
| @@ -395,9 +395,8 @@ its parents." | |||
| 395 | "-p" | 395 | "-p" |
| 396 | (vc-switches 'CVS 'checkout))) | 396 | (vc-switches 'CVS 'checkout))) |
| 397 | 397 | ||
| 398 | (defun vc-cvs-checkout (file &optional editable rev) | 398 | (defun vc-cvs-checkout (file &optional rev) |
| 399 | "Checkout a revision of FILE into the working area. | 399 | "Checkout a revision of FILE into the working area. |
| 400 | EDITABLE non-nil means that the file should be writable. | ||
| 401 | REV is the revision to check out." | 400 | REV is the revision to check out." |
| 402 | (message "Checking out %s..." file) | 401 | (message "Checking out %s..." file) |
| 403 | ;; Change buffers to get local value of vc-checkout-switches. | 402 | ;; Change buffers to get local value of vc-checkout-switches. |
| @@ -405,7 +404,7 @@ REV is the revision to check out." | |||
| 405 | (if (and (file-exists-p file) (not rev)) | 404 | (if (and (file-exists-p file) (not rev)) |
| 406 | ;; If no revision was specified, just make the file writable | 405 | ;; If no revision was specified, just make the file writable |
| 407 | ;; if necessary (using `cvs-edit' if requested). | 406 | ;; if necessary (using `cvs-edit' if requested). |
| 408 | (and editable (not (eq (vc-cvs-checkout-model (list file)) 'implicit)) | 407 | (and (not (eq (vc-cvs-checkout-model (list file)) 'implicit)) |
| 409 | (if vc-cvs-use-edit | 408 | (if vc-cvs-use-edit |
| 410 | (vc-cvs-command nil 0 file "edit") | 409 | (vc-cvs-command nil 0 file "edit") |
| 411 | (set-file-modes file (logior (file-modes file) 128)) | 410 | (set-file-modes file (logior (file-modes file) 128)) |
| @@ -413,7 +412,7 @@ REV is the revision to check out." | |||
| 413 | ;; Check out a particular revision (or recreate the file). | 412 | ;; Check out a particular revision (or recreate the file). |
| 414 | (vc-file-setprop file 'vc-working-revision nil) | 413 | (vc-file-setprop file 'vc-working-revision nil) |
| 415 | (apply 'vc-cvs-command nil 0 file | 414 | (apply 'vc-cvs-command nil 0 file |
| 416 | (and editable "-w") | 415 | "-w" |
| 417 | "update" | 416 | "update" |
| 418 | (when rev | 417 | (when rev |
| 419 | (unless (eq rev t) | 418 | (unless (eq rev t) |
diff --git a/lisp/vc/vc-dav.el b/lisp/vc/vc-dav.el index 77979d696d3..df7801f6333 100644 --- a/lisp/vc/vc-dav.el +++ b/lisp/vc/vc-dav.el | |||
| @@ -87,7 +87,7 @@ See `vc-checkout-model' for a list of possible values." | |||
| 87 | ;; This should PUT the resource and release any locks that we hold. | 87 | ;; This should PUT the resource and release any locks that we hold. |
| 88 | ) | 88 | ) |
| 89 | 89 | ||
| 90 | (defun vc-dav-checkout (url &optional editable rev destfile) | 90 | (defun vc-dav-checkout (url &optional rev destfile) |
| 91 | "Check out revision REV of URL into the working area. | 91 | "Check out revision REV of URL into the working area. |
| 92 | 92 | ||
| 93 | If EDITABLE is non-nil URL should be writable by the user and if | 93 | If EDITABLE is non-nil URL should be writable by the user and if |
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 3e45eabee0e..75098904f32 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el | |||
| @@ -66,7 +66,7 @@ | |||
| 66 | ;; - unregister (file) OK | 66 | ;; - unregister (file) OK |
| 67 | ;; * checkin (files rev comment) OK | 67 | ;; * checkin (files rev comment) OK |
| 68 | ;; * find-revision (file rev buffer) OK | 68 | ;; * find-revision (file rev buffer) OK |
| 69 | ;; * checkout (file &optional editable rev) OK | 69 | ;; * checkout (file &optional rev) OK |
| 70 | ;; * revert (file &optional contents-done) OK | 70 | ;; * revert (file &optional contents-done) OK |
| 71 | ;; - rollback (files) COULD BE SUPPORTED | 71 | ;; - rollback (files) COULD BE SUPPORTED |
| 72 | ;; - merge (file rev1 rev2) It would be possible to merge | 72 | ;; - merge (file rev1 rev2) It would be possible to merge |
| @@ -709,7 +709,7 @@ It is based on `log-edit-mode', and has Git-specific extensions.") | |||
| 709 | (expand-file-name ".gitignore" | 709 | (expand-file-name ".gitignore" |
| 710 | (vc-git-root file))) | 710 | (vc-git-root file))) |
| 711 | 711 | ||
| 712 | (defun vc-git-checkout (file &optional _editable rev) | 712 | (defun vc-git-checkout (file &optional rev) |
| 713 | (vc-git-command nil 0 file "checkout" (or rev "HEAD"))) | 713 | (vc-git-command nil 0 file "checkout" (or rev "HEAD"))) |
| 714 | 714 | ||
| 715 | (defun vc-git-revert (file &optional contents-done) | 715 | (defun vc-git-revert (file &optional contents-done) |
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 583fa6c6909..dab2c7256ba 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el | |||
| @@ -63,7 +63,7 @@ | |||
| 63 | ;; - unregister (file) OK | 63 | ;; - unregister (file) OK |
| 64 | ;; * checkin (files rev comment) OK | 64 | ;; * checkin (files rev comment) OK |
| 65 | ;; * find-revision (file rev buffer) OK | 65 | ;; * find-revision (file rev buffer) OK |
| 66 | ;; * checkout (file &optional editable rev) OK | 66 | ;; * checkout (file &optional rev) OK |
| 67 | ;; * revert (file &optional contents-done) OK | 67 | ;; * revert (file &optional contents-done) OK |
| 68 | ;; - rollback (files) ?? PROBABLY NOT NEEDED | 68 | ;; - rollback (files) ?? PROBABLY NOT NEEDED |
| 69 | ;; - merge (file rev1 rev2) NEEDED | 69 | ;; - merge (file rev1 rev2) NEEDED |
| @@ -499,7 +499,7 @@ REV is ignored." | |||
| 499 | (vc-hg-root file))) | 499 | (vc-hg-root file))) |
| 500 | 500 | ||
| 501 | ;; Modeled after the similar function in vc-bzr.el | 501 | ;; Modeled after the similar function in vc-bzr.el |
| 502 | (defun vc-hg-checkout (file &optional _editable rev) | 502 | (defun vc-hg-checkout (file &optional rev) |
| 503 | "Retrieve a revision of FILE. | 503 | "Retrieve a revision of FILE. |
| 504 | EDITABLE is ignored. | 504 | EDITABLE is ignored. |
| 505 | REV is the revision to check out into WORKFILE." | 505 | REV is the revision to check out into WORKFILE." |
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el index fdaca546afd..145fdeb93d8 100644 --- a/lisp/vc/vc-mtn.el +++ b/lisp/vc/vc-mtn.el | |||
| @@ -197,7 +197,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." | |||
| 197 | (defun vc-mtn-find-revision (file rev buffer) | 197 | (defun vc-mtn-find-revision (file rev buffer) |
| 198 | (vc-mtn-command buffer 0 file "cat" "-r" rev)) | 198 | (vc-mtn-command buffer 0 file "cat" "-r" rev)) |
| 199 | 199 | ||
| 200 | ;; (defun vc-mtn-checkout (file &optional editable rev) | 200 | ;; (defun vc-mtn-checkout (file &optional rev) |
| 201 | ;; ) | 201 | ;; ) |
| 202 | 202 | ||
| 203 | (defun vc-mtn-revert (file &optional contents-done) | 203 | (defun vc-mtn-revert (file &optional contents-done) |
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el index 4b06b0923ba..2d713c9a70c 100644 --- a/lisp/vc/vc-rcs.el +++ b/lisp/vc/vc-rcs.el | |||
| @@ -421,7 +421,7 @@ whether to remove it." | |||
| 421 | (concat "-p" rev) | 421 | (concat "-p" rev) |
| 422 | (vc-switches 'RCS 'checkout))) | 422 | (vc-switches 'RCS 'checkout))) |
| 423 | 423 | ||
| 424 | (defun vc-rcs-checkout (file &optional editable rev) | 424 | (defun vc-rcs-checkout (file &optional rev) |
| 425 | "Retrieve a copy of a saved version of FILE. If FILE is a directory, | 425 | "Retrieve a copy of a saved version of FILE. If FILE is a directory, |
| 426 | attempt the checkout for all registered files beneath it." | 426 | attempt the checkout for all registered files beneath it." |
| 427 | (if (file-directory-p file) | 427 | (if (file-directory-p file) |
| @@ -452,7 +452,7 @@ attempt the checkout for all registered files beneath it." | |||
| 452 | ;; If locking is not strict, force to overwrite | 452 | ;; If locking is not strict, force to overwrite |
| 453 | ;; the writable workfile. | 453 | ;; the writable workfile. |
| 454 | (if (eq (vc-rcs-checkout-model (list file)) 'implicit) "-f") | 454 | (if (eq (vc-rcs-checkout-model (list file)) 'implicit) "-f") |
| 455 | (if editable "-l") | 455 | "-l" |
| 456 | (if (stringp rev) | 456 | (if (stringp rev) |
| 457 | ;; a literal revision was specified | 457 | ;; a literal revision was specified |
| 458 | (concat "-r" rev) | 458 | (concat "-r" rev) |
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el index db777ab11e4..f1e437b1d9f 100644 --- a/lisp/vc/vc-sccs.el +++ b/lisp/vc/vc-sccs.el | |||
| @@ -272,7 +272,7 @@ expanded if `vc-keep-workfiles' is non-nil, otherwise, delete the workfile." | |||
| 272 | (vc-sccs-lookup-triple file rev))) | 272 | (vc-sccs-lookup-triple file rev))) |
| 273 | (vc-switches 'SCCS 'checkout))) | 273 | (vc-switches 'SCCS 'checkout))) |
| 274 | 274 | ||
| 275 | (defun vc-sccs-checkout (file &optional editable rev) | 275 | (defun vc-sccs-checkout (file &optional rev) |
| 276 | "Retrieve a copy of a saved revision of SCCS controlled FILE. | 276 | "Retrieve a copy of a saved revision of SCCS controlled FILE. |
| 277 | If FILE is a directory, all version-controlled files beneath are checked out. | 277 | If FILE is a directory, all version-controlled files beneath are checked out. |
| 278 | EDITABLE non-nil means that the file should be writable and | 278 | EDITABLE non-nil means that the file should be writable and |
| @@ -299,7 +299,7 @@ locked. REV is the revision to check out." | |||
| 299 | (not (stringp rev))) | 299 | (not (stringp rev))) |
| 300 | (setq rev nil)) | 300 | (setq rev nil)) |
| 301 | (apply 'vc-sccs-do-command nil 0 "get" (vc-name file) | 301 | (apply 'vc-sccs-do-command nil 0 "get" (vc-name file) |
| 302 | (if editable "-e") | 302 | "-e" |
| 303 | (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) | 303 | (and rev (concat "-r" (vc-sccs-lookup-triple file rev))) |
| 304 | switches)))) | 304 | switches)))) |
| 305 | (message "Checking out %s...done" file)))) | 305 | (message "Checking out %s...done" file)))) |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index bd22fbf6a16..30d66e45be0 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -375,14 +375,14 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY." | |||
| 375 | "Return the administrative directory of FILE." | 375 | "Return the administrative directory of FILE." |
| 376 | (expand-file-name vc-svn-admin-directory (vc-svn-root file))) | 376 | (expand-file-name vc-svn-admin-directory (vc-svn-root file))) |
| 377 | 377 | ||
| 378 | (defun vc-svn-checkout (file &optional editable rev) | 378 | (defun vc-svn-checkout (file &optional rev) |
| 379 | (message "Checking out %s..." file) | 379 | (message "Checking out %s..." file) |
| 380 | (with-current-buffer (or (get-file-buffer file) (current-buffer)) | 380 | (with-current-buffer (or (get-file-buffer file) (current-buffer)) |
| 381 | (vc-svn-update file editable rev (vc-switches 'SVN 'checkout))) | 381 | (vc-svn-update file rev (vc-switches 'SVN 'checkout))) |
| 382 | (vc-mode-line file 'SVN) | 382 | (vc-mode-line file 'SVN) |
| 383 | (message "Checking out %s...done" file)) | 383 | (message "Checking out %s...done" file)) |
| 384 | 384 | ||
| 385 | (defun vc-svn-update (file _editable rev switches) | 385 | (defun vc-svn-update (file rev switches) |
| 386 | (if (and (file-exists-p file) (not rev)) | 386 | (if (and (file-exists-p file) (not rev)) |
| 387 | ;; If no revision was specified, there's nothing to do. | 387 | ;; If no revision was specified, there's nothing to do. |
| 388 | nil | 388 | nil |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 2efa4503a3a..f0fe51bcae9 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -281,16 +281,17 @@ | |||
| 281 | ;; The implementation should pass the value of vc-checkout-switches | 281 | ;; The implementation should pass the value of vc-checkout-switches |
| 282 | ;; to the backend command. | 282 | ;; to the backend command. |
| 283 | ;; | 283 | ;; |
| 284 | ;; * checkout (file &optional editable rev) | 284 | ;; * checkout (file &optional rev) |
| 285 | ;; | 285 | ;; |
| 286 | ;; Check out revision REV of FILE into the working area. If EDITABLE | 286 | ;; Check out revision REV of FILE into the working area. FILE |
| 287 | ;; is non-nil, FILE should be writable by the user and if locking is | 287 | ;; should be writable by the user and if locking is used for FILE, a |
| 288 | ;; used for FILE, a lock should also be set. If REV is non-nil, that | 288 | ;; lock should also be set. If REV is non-nil, that is the revision |
| 289 | ;; is the revision to check out (default is the working revision). | 289 | ;; to check out (default is the working revision). If REV is t, |
| 290 | ;; If REV is t, that means to check out the head of the current branch; | 290 | ;; that means to check out the head of the current branch; if it is |
| 291 | ;; if it is the empty string, check out the head of the trunk. | 291 | ;; the empty string, check out the head of the trunk. The |
| 292 | ;; The implementation should pass the value of vc-checkout-switches | 292 | ;; implementation should pass the value of vc-checkout-switches to |
| 293 | ;; to the backend command. | 293 | ;; the backend command. The 'editable' argument of older VC versions |
| 294 | ;; is gone; all files are checked out editable. | ||
| 294 | ;; | 295 | ;; |
| 295 | ;; * revert (file &optional contents-done) | 296 | ;; * revert (file &optional contents-done) |
| 296 | ;; | 297 | ;; |
| @@ -1138,10 +1139,10 @@ For old-style locking-based version control systems, like RCS: | |||
| 1138 | (let ((vsym (intern-soft revision-downcase))) | 1139 | (let ((vsym (intern-soft revision-downcase))) |
| 1139 | (dolist (file files) (vc-transfer-file file vsym))) | 1140 | (dolist (file files) (vc-transfer-file file vsym))) |
| 1140 | (dolist (file files) | 1141 | (dolist (file files) |
| 1141 | (vc-checkout file (eq model 'implicit) revision))))) | 1142 | (vc-checkout file revision))))) |
| 1142 | ((not (eq model 'implicit)) | 1143 | ((not (eq model 'implicit)) |
| 1143 | ;; check the files out | 1144 | ;; check the files out |
| 1144 | (dolist (file files) (vc-checkout file t))) | 1145 | (dolist (file files) (vc-checkout file))) |
| 1145 | (t | 1146 | (t |
| 1146 | ;; do nothing | 1147 | ;; do nothing |
| 1147 | (message "Fileset is up-to-date")))) | 1148 | (message "Fileset is up-to-date")))) |
| @@ -1227,10 +1228,10 @@ For old-style locking-based version control systems, like RCS: | |||
| 1227 | (if (yes-or-no-p (format | 1228 | (if (yes-or-no-p (format |
| 1228 | "%s is not up-to-date. Get latest revision? " | 1229 | "%s is not up-to-date. Get latest revision? " |
| 1229 | (file-name-nondirectory file))) | 1230 | (file-name-nondirectory file))) |
| 1230 | (vc-checkout file (eq model 'implicit) t) | 1231 | (vc-checkout file t) |
| 1231 | (when (and (not (eq model 'implicit)) | 1232 | (when (and (not (eq model 'implicit)) |
| 1232 | (yes-or-no-p "Lock this revision? ")) | 1233 | (yes-or-no-p "Lock this revision? ")) |
| 1233 | (vc-checkout file t))))) | 1234 | (vc-checkout file))))) |
| 1234 | ;; needs-merge | 1235 | ;; needs-merge |
| 1235 | ((eq state 'needs-merge) | 1236 | ((eq state 'needs-merge) |
| 1236 | (dolist (file files) | 1237 | (dolist (file files) |
| @@ -1267,7 +1268,7 @@ For old-style locking-based version control systems, like RCS: | |||
| 1267 | "Revert to checked-in revision, instead? ")) | 1268 | "Revert to checked-in revision, instead? ")) |
| 1268 | (error "Checkout aborted") | 1269 | (error "Checkout aborted") |
| 1269 | (vc-revert-buffer-internal t t) | 1270 | (vc-revert-buffer-internal t t) |
| 1270 | (vc-checkout file t))))) | 1271 | (vc-checkout file))))) |
| 1271 | ;; Unknown fileset state | 1272 | ;; Unknown fileset state |
| 1272 | (t | 1273 | (t |
| 1273 | (error "Fileset is in an unknown state %s" state))))) | 1274 | (error "Fileset is in an unknown state %s" state))))) |
| @@ -1426,29 +1427,27 @@ Argument BACKEND is the backend you are using." | |||
| 1426 | (replace-match "")) | 1427 | (replace-match "")) |
| 1427 | (write-region (point-min) (point-max) file))) | 1428 | (write-region (point-min) (point-max) file))) |
| 1428 | 1429 | ||
| 1429 | (defun vc-checkout (file &optional writable rev) | 1430 | (defun vc-checkout (file &optional rev) |
| 1430 | "Retrieve a copy of the revision REV of FILE. | 1431 | "Retrieve a copy of the revision REV of FILE. |
| 1431 | If WRITABLE is non-nil, make sure the retrieved file is writable. | ||
| 1432 | REV defaults to the latest revision. | 1432 | REV defaults to the latest revision. |
| 1433 | 1433 | ||
| 1434 | After check-out, runs the normal hook `vc-checkout-hook'." | 1434 | After check-out, runs the normal hook `vc-checkout-hook'." |
| 1435 | (and writable | 1435 | (and (not rev) |
| 1436 | (not rev) | ||
| 1437 | (vc-call make-version-backups-p file) | 1436 | (vc-call make-version-backups-p file) |
| 1438 | (vc-up-to-date-p file) | 1437 | (vc-up-to-date-p file) |
| 1439 | (vc-make-version-backup file)) | 1438 | (vc-make-version-backup file)) |
| 1440 | (let ((backend (vc-backend file))) | 1439 | (let ((backend (vc-backend file))) |
| 1441 | (with-vc-properties (list file) | 1440 | (with-vc-properties (list file) |
| 1442 | (condition-case err | 1441 | (condition-case err |
| 1443 | (vc-call-backend backend 'checkout file writable rev) | 1442 | (vc-call-backend backend 'checkout file rev) |
| 1444 | (file-error | 1443 | (file-error |
| 1445 | ;; Maybe the backend is not installed ;-( | 1444 | ;; Maybe the backend is not installed ;-( |
| 1446 | (when writable | 1445 | (when t |
| 1447 | (let ((buf (get-file-buffer file))) | 1446 | (let ((buf (get-file-buffer file))) |
| 1448 | (when buf (with-current-buffer buf (read-only-mode -1))))) | 1447 | (when buf (with-current-buffer buf (read-only-mode -1))))) |
| 1449 | (signal (car err) (cdr err)))) | 1448 | (signal (car err) (cdr err)))) |
| 1450 | `((vc-state . ,(if (or (eq (vc-checkout-model backend (list file)) 'implicit) | 1449 | `((vc-state . ,(if (or (eq (vc-checkout-model backend (list file)) 'implicit) |
| 1451 | (not writable)) | 1450 | nil) |
| 1452 | (if (vc-call-backend backend 'latest-on-branch-p file) | 1451 | (if (vc-call-backend backend 'latest-on-branch-p file) |
| 1453 | 'up-to-date | 1452 | 'up-to-date |
| 1454 | 'needs-update) | 1453 | 'needs-update) |
| @@ -2544,14 +2543,14 @@ tip revision are merged into the working file." | |||
| 2544 | (and file (member file files)))))) | 2543 | (and file (member file files)))))) |
| 2545 | (dolist (file files) | 2544 | (dolist (file files) |
| 2546 | (if (vc-up-to-date-p file) | 2545 | (if (vc-up-to-date-p file) |
| 2547 | (vc-checkout file nil t) | 2546 | (vc-checkout file t) |
| 2548 | (vc-maybe-resolve-conflicts | 2547 | (vc-maybe-resolve-conflicts |
| 2549 | file (vc-call-backend backend 'merge-news file))))) | 2548 | file (vc-call-backend backend 'merge-news file))))) |
| 2550 | ;; For a locking VCS, check out each file. | 2549 | ;; For a locking VCS, check out each file. |
| 2551 | ((eq (vc-checkout-model backend files) 'locking) | 2550 | ((eq (vc-checkout-model backend files) 'locking) |
| 2552 | (dolist (file files) | 2551 | (dolist (file files) |
| 2553 | (if (vc-up-to-date-p file) | 2552 | (if (vc-up-to-date-p file) |
| 2554 | (vc-checkout file nil t)))) | 2553 | (vc-checkout file t)))) |
| 2555 | (t | 2554 | (t |
| 2556 | (error "VC update is unsupported for `%s'" backend))))) | 2555 | (error "VC update is unsupported for `%s'" backend))))) |
| 2557 | 2556 | ||
| @@ -2673,7 +2672,7 @@ backend to NEW-BACKEND, and unregister FILE from the current backend. | |||
| 2673 | (when modified-file | 2672 | (when modified-file |
| 2674 | (vc-switch-backend file new-backend) | 2673 | (vc-switch-backend file new-backend) |
| 2675 | (unless (eq (vc-checkout-model new-backend (list file)) 'implicit) | 2674 | (unless (eq (vc-checkout-model new-backend (list file)) 'implicit) |
| 2676 | (vc-checkout file t nil)) | 2675 | (vc-checkout file)) |
| 2677 | (rename-file modified-file file 'ok-if-already-exists) | 2676 | (rename-file modified-file file 'ok-if-already-exists) |
| 2678 | (vc-file-setprop file 'vc-checkout-time nil))))) | 2677 | (vc-file-setprop file 'vc-checkout-time nil))))) |
| 2679 | (when move | 2678 | (when move |