Attached is a patch to make VC grok remote users better.
VC now uses the login that you connected to the remote machine with
rather than the local login. This means that files you check out
remotely (under a different login) are no longer incorrectly thought to
be owned by another user.
This has had about five minutes testing locally.
If you have the error 'rcp-handle-vc-user-login-name cannot map a uid to
a name.' at any point, please '(setq debug-on-error t)', repeat the
failure and send me the backtrace.
This should never happen, ever, but if it does I want to know. :)
Daniel
Changes:
* (defun rcp-handle-vc-user-login-name)
Return the login used for a remote machine rather than the local one.
* (defadvice vc-user-login-name)
Call 'rcp-handle-vc-user-login-name' when the current file is remote.
diff -ubNr --exclude=*~ /home/daniel/.xemacs/rcp.kai/lisp/rcp.el /home/daniel/.xemacs/rcp/lisp/rcp.el
--- /home/daniel/.xemacs/rcp.kai/lisp/rcp.el Mon Oct 11 06:11:21 1999
+++ /home/daniel/.xemacs/rcp/lisp/rcp.el Mon Oct 11 12:23:02 1999
@@ -1980,6 +1980,26 @@
;;
;; 1999-10-10 Daniel Pittman <[EMAIL PROTECTED]>
+(defun rcp-handle-vc-user-login-name (&optional uid)
+ "Return the default user name on the remote machine.
+Generate an error if we are asked to map a uid to a name.
+
+This should only be called when 'file' is bound to the
+filename we are thinking about..."
+ (if uid
+ (cerror "rcp-handle-vc-user-login-name cannot map a uid to a name.")
+ (let ((v (rcp-dissect-file-name (rcp-handle-expand-file-name filename))))
+ (rcp-file-name-user v))))
+
+(defadvice vc-user-login-name
+ (around rcp-vc-user-login-name activate)
+ "Support for files on remote machines accessed by RCP."
+ (or (and (stringp file)
+ (rcp-rcp-file-p file) ; rcp file
+ (setq ad-return-value
+ (rcp-handle-vc-user-login-name uid))) ; get the owner name
+ ad-do-it)) ; else call the original
+
;; Determine the name of the user owning a file.
(defun rcp-file-owner (filename)
"Return who owns FILE (user name, as a string)."
--
Permissiveness is the principle of treating children as if they were adults;
and the tactic of making sure they never reach that stage.
-- Thomas Szasz