Commit 1525b516 authored by André Spiegel's avatar André Spiegel
Browse files

(vc-file-owner): Always return user name, using the optional argument

of user-login-name.
(vc-locking-user, vc-status): Discard checks for numerical value of
vc-locking-user.
parent a697fc62
...@@ -568,16 +568,8 @@ For CVS, the full name of CVS/Entries is returned." ...@@ -568,16 +568,8 @@ For CVS, the full name of CVS/Entries is returned."
(nil))))) (nil)))))
(defun vc-file-owner (file) (defun vc-file-owner (file)
;; The expression below should return the username of the owner ;; Return who owns FILE (user name, as a string).
;; of the file. It doesn't. It returns the username if it is (user-login-name (nth 2 (file-attributes file))))
;; you, or otherwise the UID of the owner of the file. The UID
;; is returned as a string, so that the rest of VC doesn't notice
;; the difference.
;; The *proper* way to fix this would be to implement a built-in
;; function in Emacs, say, (username UID), that returns the
;; username of a given UID.
(let ((uid (nth 2 (file-attributes file))))
(if (= uid (user-uid)) (user-login-name) (number-to-string uid))))
(defun vc-rcs-lock-from-diff (file) (defun vc-rcs-lock-from-diff (file)
;; Diff the file against the master version. If differences are found, ;; Diff the file against the master version. If differences are found,
...@@ -600,8 +592,7 @@ For CVS, the full name of CVS/Entries is returned." ...@@ -600,8 +592,7 @@ For CVS, the full name of CVS/Entries is returned."
(defun vc-locking-user (file) (defun vc-locking-user (file)
;; Return the name of the person currently holding a lock on FILE. ;; Return the name of the person currently holding a lock on FILE.
;; Return nil if there is no such person. (Sometimes, not the name ;; Return nil if there is no such person.
;; of the locking user but his uid will be returned.)
;; Under CVS, a file is considered locked if it has been modified since ;; Under CVS, a file is considered locked if it has been modified since
;; it was checked out. ;; it was checked out.
;; The property is cached. It is only looked up if it is currently nil. ;; The property is cached. It is only looked up if it is currently nil.
...@@ -621,10 +612,7 @@ For CVS, the full name of CVS/Entries is returned." ...@@ -621,10 +612,7 @@ For CVS, the full name of CVS/Entries is returned."
(and (equal (vc-file-getprop file 'vc-checkout-time) (and (equal (vc-file-getprop file 'vc-checkout-time)
(nth 5 (file-attributes file))) (nth 5 (file-attributes file)))
(vc-file-setprop file 'vc-locking-user 'none)) (vc-file-setprop file 'vc-locking-user 'none))
(let ((locker (vc-file-owner file))) (vc-file-setprop file 'vc-locking-user (vc-file-owner file))))
(vc-file-setprop file 'vc-locking-user
(if (stringp locker) locker
(format "%d" locker))))))
((eq (vc-backend file) 'RCS) ((eq (vc-backend file) 'RCS)
(let (p-lock) (let (p-lock)
...@@ -926,9 +914,7 @@ control system name." ...@@ -926,9 +914,7 @@ control system name."
" @@") " @@")
((not locker) ((not locker)
(concat "-" rev)) (concat "-" rev))
((if (stringp locker) ((string= locker (user-login-name))
(string= locker (user-login-name))
(= locker (user-uid)))
(concat ":" rev)) (concat ":" rev))
(t (t
(concat ":" locker ":" rev))))) (concat ":" locker ":" rev)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment