aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/vc-hooks.el24
1 files changed, 5 insertions, 19 deletions
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index da978dbd078..fc9242980ea 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -568,16 +568,8 @@ For CVS, the full name of CVS/Entries is returned."
568 (nil))))) 568 (nil)))))
569 569
570(defun vc-file-owner (file) 570(defun vc-file-owner (file)
571 ;; The expression below should return the username of the owner 571 ;; Return who owns FILE (user name, as a string).
572 ;; of the file. It doesn't. It returns the username if it is 572 (user-login-name (nth 2 (file-attributes file))))
573 ;; you, or otherwise the UID of the owner of the file. The UID
574 ;; is returned as a string, so that the rest of VC doesn't notice
575 ;; the difference.
576 ;; The *proper* way to fix this would be to implement a built-in
577 ;; function in Emacs, say, (username UID), that returns the
578 ;; username of a given UID.
579 (let ((uid (nth 2 (file-attributes file))))
580 (if (= uid (user-uid)) (user-login-name) (number-to-string uid))))
581 573
582(defun vc-rcs-lock-from-diff (file) 574(defun vc-rcs-lock-from-diff (file)
583 ;; Diff the file against the master version. If differences are found, 575 ;; 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 592
601(defun vc-locking-user (file) 593(defun vc-locking-user (file)
602 ;; Return the name of the person currently holding a lock on FILE. 594 ;; Return the name of the person currently holding a lock on FILE.
603 ;; Return nil if there is no such person. (Sometimes, not the name 595 ;; Return nil if there is no such person.
604 ;; of the locking user but his uid will be returned.)
605 ;; Under CVS, a file is considered locked if it has been modified since 596 ;; Under CVS, a file is considered locked if it has been modified since
606 ;; it was checked out. 597 ;; it was checked out.
607 ;; The property is cached. It is only looked up if it is currently nil. 598 ;; 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 (and (equal (vc-file-getprop file 'vc-checkout-time) 612 (and (equal (vc-file-getprop file 'vc-checkout-time)
622 (nth 5 (file-attributes file))) 613 (nth 5 (file-attributes file)))
623 (vc-file-setprop file 'vc-locking-user 'none)) 614 (vc-file-setprop file 'vc-locking-user 'none))
624 (let ((locker (vc-file-owner file))) 615 (vc-file-setprop file 'vc-locking-user (vc-file-owner file))))
625 (vc-file-setprop file 'vc-locking-user
626 (if (stringp locker) locker
627 (format "%d" locker))))))
628 616
629 ((eq (vc-backend file) 'RCS) 617 ((eq (vc-backend file) 'RCS)
630 (let (p-lock) 618 (let (p-lock)
@@ -926,9 +914,7 @@ control system name."
926 " @@") 914 " @@")
927 ((not locker) 915 ((not locker)
928 (concat "-" rev)) 916 (concat "-" rev))
929 ((if (stringp locker) 917 ((string= locker (user-login-name))
930 (string= locker (user-login-name))
931 (= locker (user-uid)))
932 (concat ":" rev)) 918 (concat ":" rev))
933 (t 919 (t
934 (concat ":" locker ":" rev))))) 920 (concat ":" locker ":" rev)))))