mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
(vc-user-login-name): New function.
(vc-fetch-master-properties, vc-lock-from-permissions, vc-file-owner, vc-fetch-properties, vc-after-save, vc-mode-line, vc-status): Use `vc-user-login-name' instead of `user-login-name'.
This commit is contained in:
parent
4e782c8e16
commit
2a11c6f32f
1 changed files with 17 additions and 7 deletions
|
|
@ -289,7 +289,7 @@ See also variable `vc-consult-headers'.")
|
|||
(vc-parse-buffer
|
||||
(list '("^\001d D \\([^ ]+\\)" 1)
|
||||
(list (concat "^\001d D \\([^ ]+\\) .* "
|
||||
(regexp-quote (user-login-name)) " ") 1))
|
||||
(regexp-quote (vc-user-login-name)) " ") 1))
|
||||
file
|
||||
'(vc-latest-version vc-your-latest-version)))
|
||||
|
||||
|
|
@ -564,12 +564,22 @@ For CVS, the full name of CVS/Entries is returned."
|
|||
(vc-file-setprop file 'vc-locking-user 'none))
|
||||
((and (= (nth 2 attributes) (user-uid))
|
||||
(string-match ".rw..-..-." (nth 8 attributes)))
|
||||
(vc-file-setprop file 'vc-locking-user (user-login-name)))
|
||||
(vc-file-setprop file 'vc-locking-user (vc-user-login-name)))
|
||||
(nil)))))
|
||||
|
||||
(defun vc-user-login-name (&optional uid)
|
||||
;; Return the name under which the user is logged in, as a string.
|
||||
;; (With optional argument UID, return the name of that user.)
|
||||
;; This function does the same as `user-login-name', but unlike
|
||||
;; that, it never returns nil. If a UID cannot be resolved, that
|
||||
;; UID is returned as a string.
|
||||
(or (user-login-name uid)
|
||||
(and uid (number-to-string uid))
|
||||
(number-to-string (user-uid))))
|
||||
|
||||
(defun vc-file-owner (file)
|
||||
;; Return who owns FILE (user name, as a string).
|
||||
(user-login-name (nth 2 (file-attributes file))))
|
||||
(vc-user-login-name (nth 2 (file-attributes file))))
|
||||
|
||||
(defun vc-rcs-lock-from-diff (file)
|
||||
;; Diff the file against the master version. If differences are found,
|
||||
|
|
@ -686,7 +696,7 @@ For CVS, the full name of CVS/Entries is returned."
|
|||
(list (concat "^\\([0-9]+\\.[0-9.]+\\)\n"
|
||||
"date[ \t]+\\([0-9.]+\\);[ \t]+"
|
||||
"author[ \t]+"
|
||||
(regexp-quote (user-login-name)) ";") 1 2))
|
||||
(regexp-quote (vc-user-login-name)) ";") 1 2))
|
||||
file
|
||||
'(vc-latest-version vc-your-latest-version))
|
||||
(if (get-buffer "*vc-info*")
|
||||
|
|
@ -853,7 +863,7 @@ of the buffer. With prefix argument, ask for version number."
|
|||
t)
|
||||
(not (vc-locking-user file))
|
||||
(eq (vc-checkout-model file) 'implicit)
|
||||
(vc-file-setprop file 'vc-locking-user (user-login-name))
|
||||
(vc-file-setprop file 'vc-locking-user (vc-user-login-name))
|
||||
(or (and (eq (vc-backend file) 'CVS)
|
||||
(vc-file-setprop file 'vc-cvs-status nil))
|
||||
t)
|
||||
|
|
@ -876,7 +886,7 @@ control system name."
|
|||
(and vc-type
|
||||
(equal file (buffer-file-name))
|
||||
(vc-locking-user file)
|
||||
(not (string= (user-login-name) (vc-locking-user file)))
|
||||
(not (string= (vc-user-login-name) (vc-locking-user file)))
|
||||
(setq buffer-read-only t))
|
||||
;; If the user is root, and the file is not owner-writable,
|
||||
;; then pretend that we can't write it
|
||||
|
|
@ -914,7 +924,7 @@ control system name."
|
|||
" @@")
|
||||
((not locker)
|
||||
(concat "-" rev))
|
||||
((string= locker (user-login-name))
|
||||
((string= locker (vc-user-login-name))
|
||||
(concat ":" rev))
|
||||
(t
|
||||
(concat ":" locker ":" rev)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue