304 |
(defun vc-checkout-model (file) |
(defun vc-checkout-model (file) |
305 |
"Indicate how FILE is checked out. |
"Indicate how FILE is checked out. |
306 |
|
|
307 |
Possible values: |
If FILE is not registered, this function always returns nil. |
308 |
|
For registered files, the possible values are: |
309 |
|
|
310 |
'implicit File is always writeable, and checked out `implicitly' |
'implicit FILE is always writeable, and checked out `implicitly' |
311 |
when the user saves the first changes to the file. |
when the user saves the first changes to the file. |
312 |
|
|
313 |
'locking File is read-only if up-to-date; user must type |
'locking FILE is read-only if up-to-date; user must type |
314 |
\\[vc-toggle-read-only] before editing. Strict locking |
\\[vc-toggle-read-only] before editing. Strict locking |
315 |
is assumed. |
is assumed. |
316 |
|
|
317 |
'announce File is read-only if up-to-date; user must type |
'announce FILE is read-only if up-to-date; user must type |
318 |
\\[vc-toggle-read-only] before editing. But other users |
\\[vc-toggle-read-only] before editing. But other users |
319 |
may be editing at the same time." |
may be editing at the same time." |
320 |
(or (vc-file-getprop file 'vc-checkout-model) |
(or (vc-file-getprop file 'vc-checkout-model) |
321 |
(vc-file-setprop file 'vc-checkout-model |
(if (vc-backend file) |
322 |
(vc-call checkout-model file)))) |
(vc-file-setprop file 'vc-checkout-model |
323 |
|
(vc-call checkout-model file))))) |
324 |
|
|
325 |
(defun vc-user-login-name (&optional uid) |
(defun vc-user-login-name (&optional uid) |
326 |
"Return the name under which the user is logged in, as a string. |
"Return the name under which the user is logged in, as a string. |
334 |
(defun vc-state (file) |
(defun vc-state (file) |
335 |
"Return the version control state of FILE. |
"Return the version control state of FILE. |
336 |
|
|
337 |
The value returned is one of: |
If FILE is not registered, this function always returns nil. |
338 |
|
For registered files, the value returned is one of: |
339 |
|
|
340 |
'up-to-date The working file is unmodified with respect to the |
'up-to-date The working file is unmodified with respect to the |
341 |
latest version on the current branch, and not locked. |
latest version on the current branch, and not locked. |
363 |
should be resolved by the user (vc-next-action will |
should be resolved by the user (vc-next-action will |
364 |
prompt the user to do it)." |
prompt the user to do it)." |
365 |
(or (vc-file-getprop file 'vc-state) |
(or (vc-file-getprop file 'vc-state) |
366 |
(vc-file-setprop file 'vc-state |
(if (vc-backend file) |
367 |
(vc-call state-heuristic file)))) |
(vc-file-setprop file 'vc-state |
368 |
|
(vc-call state-heuristic file))))) |
369 |
|
|
370 |
(defsubst vc-up-to-date-p (file) |
(defsubst vc-up-to-date-p (file) |
371 |
"Convenience function that checks whether `vc-state' of FILE is `up-to-date'." |
"Convenience function that checks whether `vc-state' of FILE is `up-to-date'." |
378 |
(vc-call-backend backend 'state file)) |
(vc-call-backend backend 'state file)) |
379 |
|
|
380 |
(defun vc-workfile-version (file) |
(defun vc-workfile-version (file) |
381 |
"Return version level of the current workfile FILE." |
"Return the version level of the current workfile FILE. |
382 |
|
If FILE is not registered, this function always returns nil." |
383 |
(or (vc-file-getprop file 'vc-workfile-version) |
(or (vc-file-getprop file 'vc-workfile-version) |
384 |
(vc-file-setprop file 'vc-workfile-version |
(if (vc-backend file) |
385 |
(vc-call workfile-version file)))) |
(vc-file-setprop file 'vc-workfile-version |
386 |
|
(vc-call workfile-version file))))) |
387 |
|
|
388 |
;;; actual version-control code starts here |
;;; actual version-control code starts here |
389 |
|
|
418 |
(if (consp result) (car result) result))))) |
(if (consp result) (car result) result))))) |
419 |
|
|
420 |
(defun vc-check-master-templates (file templates) |
(defun vc-check-master-templates (file templates) |
421 |
"Return non-nil if there is a master corresponding to FILE, |
"Return non-nil if there is a master corresponding to FILE. |
|
according to any of the elements in TEMPLATES. |
|
422 |
|
|
423 |
TEMPLATES is a list of strings or functions. If an element is a |
TEMPLATES is a list of strings or functions. If an element is a |
424 |
string, it must be a control string as required by `format', with two |
string, it must be a control string as required by `format', with two |
468 |
(define-key global-map "\C-x\C-q" 'vc-toggle-read-only) |
(define-key global-map "\C-x\C-q" 'vc-toggle-read-only) |
469 |
|
|
470 |
(defun vc-default-make-version-backups-p (backend file) |
(defun vc-default-make-version-backups-p (backend file) |
471 |
"Return non-nil if unmodified repository versions should be backed up locally. |
"Return non-nil if unmodified versions should be backed up locally. |
472 |
The default is to switch off this feature." |
The default is to switch off this feature." |
473 |
nil) |
nil) |
474 |
|
|