diff options
| author | André Spiegel | 2001-12-14 07:58:33 +0000 |
|---|---|---|
| committer | André Spiegel | 2001-12-14 07:58:33 +0000 |
| commit | cb5af02aede4977d7e6a2ffbea6b84c659911721 (patch) | |
| tree | dd0cef5b0d55501babaeb17a0925432a8652f6fb | |
| parent | bebb2253f617b3142f381ca96b98e5af87f030bd (diff) | |
| download | emacs-cb5af02aede4977d7e6a2ffbea6b84c659911721.tar.gz emacs-cb5af02aede4977d7e6a2ffbea6b84c659911721.zip | |
(vc-checkout-model, vc-state, vc-workfile-version): Return nil if
FILE is not registered.
(vc-check-master-templates, vc-default-make-version-backups-p): Doc fix.
| -rw-r--r-- | lisp/vc-hooks.el | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 5141ed3cf1c..44ccf43889f 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | ;; Author: FSF (see vc.el for full credits) | 5 | ;; Author: FSF (see vc.el for full credits) |
| 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 6 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
| 7 | 7 | ||
| 8 | ;; $Id: vc-hooks.el,v 1.135 2001/11/09 14:58:21 spiegel Exp $ | 8 | ;; $Id: vc-hooks.el,v 1.136 2001/12/11 07:35:18 pj Exp $ |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| @@ -304,21 +304,23 @@ If the file is not registered, or the master name is not known, return nil." | |||
| 304 | (defun vc-checkout-model (file) | 304 | (defun vc-checkout-model (file) |
| 305 | "Indicate how FILE is checked out. | 305 | "Indicate how FILE is checked out. |
| 306 | 306 | ||
| 307 | Possible values: | 307 | If FILE is not registered, this function always returns nil. |
| 308 | For registered files, the possible values are: | ||
| 308 | 309 | ||
| 309 | 'implicit File is always writeable, and checked out `implicitly' | 310 | 'implicit FILE is always writeable, and checked out `implicitly' |
| 310 | when the user saves the first changes to the file. | 311 | when the user saves the first changes to the file. |
| 311 | 312 | ||
| 312 | 'locking File is read-only if up-to-date; user must type | 313 | 'locking FILE is read-only if up-to-date; user must type |
| 313 | \\[vc-toggle-read-only] before editing. Strict locking | 314 | \\[vc-toggle-read-only] before editing. Strict locking |
| 314 | is assumed. | 315 | is assumed. |
| 315 | 316 | ||
| 316 | 'announce File is read-only if up-to-date; user must type | 317 | 'announce FILE is read-only if up-to-date; user must type |
| 317 | \\[vc-toggle-read-only] before editing. But other users | 318 | \\[vc-toggle-read-only] before editing. But other users |
| 318 | may be editing at the same time." | 319 | may be editing at the same time." |
| 319 | (or (vc-file-getprop file 'vc-checkout-model) | 320 | (or (vc-file-getprop file 'vc-checkout-model) |
| 320 | (vc-file-setprop file 'vc-checkout-model | 321 | (if (vc-backend file) |
| 321 | (vc-call checkout-model file)))) | 322 | (vc-file-setprop file 'vc-checkout-model |
| 323 | (vc-call checkout-model file))))) | ||
| 322 | 324 | ||
| 323 | (defun vc-user-login-name (&optional uid) | 325 | (defun vc-user-login-name (&optional uid) |
| 324 | "Return the name under which the user is logged in, as a string. | 326 | "Return the name under which the user is logged in, as a string. |
| @@ -332,7 +334,8 @@ UID is returned as a string." | |||
| 332 | (defun vc-state (file) | 334 | (defun vc-state (file) |
| 333 | "Return the version control state of FILE. | 335 | "Return the version control state of FILE. |
| 334 | 336 | ||
| 335 | The value returned is one of: | 337 | If FILE is not registered, this function always returns nil. |
| 338 | For registered files, the value returned is one of: | ||
| 336 | 339 | ||
| 337 | 'up-to-date The working file is unmodified with respect to the | 340 | 'up-to-date The working file is unmodified with respect to the |
| 338 | latest version on the current branch, and not locked. | 341 | latest version on the current branch, and not locked. |
| @@ -360,8 +363,9 @@ The value returned is one of: | |||
| 360 | should be resolved by the user (vc-next-action will | 363 | should be resolved by the user (vc-next-action will |
| 361 | prompt the user to do it)." | 364 | prompt the user to do it)." |
| 362 | (or (vc-file-getprop file 'vc-state) | 365 | (or (vc-file-getprop file 'vc-state) |
| 363 | (vc-file-setprop file 'vc-state | 366 | (if (vc-backend file) |
| 364 | (vc-call state-heuristic file)))) | 367 | (vc-file-setprop file 'vc-state |
| 368 | (vc-call state-heuristic file))))) | ||
| 365 | 369 | ||
| 366 | (defsubst vc-up-to-date-p (file) | 370 | (defsubst vc-up-to-date-p (file) |
| 367 | "Convenience function that checks whether `vc-state' of FILE is `up-to-date'." | 371 | "Convenience function that checks whether `vc-state' of FILE is `up-to-date'." |
| @@ -374,10 +378,12 @@ and does not employ any heuristic at all." | |||
| 374 | (vc-call-backend backend 'state file)) | 378 | (vc-call-backend backend 'state file)) |
| 375 | 379 | ||
| 376 | (defun vc-workfile-version (file) | 380 | (defun vc-workfile-version (file) |
| 377 | "Return version level of the current workfile FILE." | 381 | "Return the version level of the current workfile FILE. |
| 382 | If FILE is not registered, this function always returns nil." | ||
| 378 | (or (vc-file-getprop file 'vc-workfile-version) | 383 | (or (vc-file-getprop file 'vc-workfile-version) |
| 379 | (vc-file-setprop file 'vc-workfile-version | 384 | (if (vc-backend file) |
| 380 | (vc-call workfile-version file)))) | 385 | (vc-file-setprop file 'vc-workfile-version |
| 386 | (vc-call workfile-version file))))) | ||
| 381 | 387 | ||
| 382 | ;;; actual version-control code starts here | 388 | ;;; actual version-control code starts here |
| 383 | 389 | ||
| @@ -412,8 +418,7 @@ and does not employ any heuristic at all." | |||
| 412 | (if (consp result) (car result) result))))) | 418 | (if (consp result) (car result) result))))) |
| 413 | 419 | ||
| 414 | (defun vc-check-master-templates (file templates) | 420 | (defun vc-check-master-templates (file templates) |
| 415 | "Return non-nil if there is a master corresponding to FILE, | 421 | "Return non-nil if there is a master corresponding to FILE. |
| 416 | according to any of the elements in TEMPLATES. | ||
| 417 | 422 | ||
| 418 | TEMPLATES is a list of strings or functions. If an element is a | 423 | TEMPLATES is a list of strings or functions. If an element is a |
| 419 | string, it must be a control string as required by `format', with two | 424 | string, it must be a control string as required by `format', with two |
| @@ -463,7 +468,7 @@ to do that, use this command a second time with no argument." | |||
| 463 | (define-key global-map "\C-x\C-q" 'vc-toggle-read-only) | 468 | (define-key global-map "\C-x\C-q" 'vc-toggle-read-only) |
| 464 | 469 | ||
| 465 | (defun vc-default-make-version-backups-p (backend file) | 470 | (defun vc-default-make-version-backups-p (backend file) |
| 466 | "Return non-nil if unmodified repository versions should be backed up locally. | 471 | "Return non-nil if unmodified versions should be backed up locally. |
| 467 | The default is to switch off this feature." | 472 | The default is to switch off this feature." |
| 468 | nil) | 473 | nil) |
| 469 | 474 | ||