43 |
;; This used to blow away the file-name-handler-alist and reinstall |
;; This used to blow away the file-name-handler-alist and reinstall |
44 |
;; TRAMP into it. This was intended to let VC work remotely. It didn't, |
;; TRAMP into it. This was intended to let VC work remotely. It didn't, |
45 |
;; at least not in my XEmacs 21.2 install. |
;; at least not in my XEmacs 21.2 install. |
46 |
;; |
;; |
47 |
;; In any case, tramp-run-real-handler now deals correctly with disabling |
;; In any case, tramp-run-real-handler now deals correctly with disabling |
48 |
;; the things that should be, making this a no-op. |
;; the things that should be, making this a no-op. |
49 |
;; |
;; |
88 |
(set (make-local-variable 'vc-parent-buffer-name) |
(set (make-local-variable 'vc-parent-buffer-name) |
89 |
(concat " from " (buffer-name camefrom))) |
(concat " from " (buffer-name camefrom))) |
90 |
(setq default-directory olddir) |
(setq default-directory olddir) |
91 |
|
|
92 |
(erase-buffer) |
(erase-buffer) |
93 |
|
|
94 |
(mapcar |
(mapcar |
216 |
(if (or (and (stringp file) (tramp-tramp-file-p file)) |
(if (or (and (stringp file) (tramp-tramp-file-p file)) |
217 |
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))) |
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))) |
218 |
(setq ad-return-value |
(setq ad-return-value |
219 |
(apply 'tramp-vc-do-command-new buffer okstatus command |
(apply 'tramp-vc-do-command-new buffer okstatus command |
220 |
file ;(or file (buffer-file-name)) |
file ;(or file (buffer-file-name)) |
221 |
flags)) |
flags)) |
222 |
ad-do-it))) |
ad-do-it))) |
229 |
(if (or (and (stringp file) (tramp-tramp-file-p file)) |
(if (or (and (stringp file) (tramp-tramp-file-p file)) |
230 |
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))) |
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))) |
231 |
(setq ad-return-value |
(setq ad-return-value |
232 |
(apply 'tramp-vc-do-command buffer okstatus command |
(apply 'tramp-vc-do-command buffer okstatus command |
233 |
(or file (buffer-file-name)) last flags)) |
(or file (buffer-file-name)) last flags)) |
234 |
ad-do-it)))) |
ad-do-it)))) |
235 |
;;-) |
;;-) |
283 |
(tramp-wait-for-output) |
(tramp-wait-for-output) |
284 |
(setq exec-status (read (current-buffer))) |
(setq exec-status (read (current-buffer))) |
285 |
(message "Command %s returned status %d." command exec-status))) |
(message "Command %s returned status %d." command exec-status))) |
286 |
|
|
287 |
;; Maybe okstatus can be `async' here. But then, maybe the |
;; Maybe okstatus can be `async' here. But then, maybe the |
288 |
;; async thing is new in Emacs 21, but this function is only |
;; async thing is new in Emacs 21, but this function is only |
289 |
;; used in Emacs 20. |
;; used in Emacs 20. |
304 |
(if (or (and (stringp file) (tramp-tramp-file-p file)) |
(if (or (and (stringp file) (tramp-tramp-file-p file)) |
305 |
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))) |
(and (buffer-file-name) (tramp-tramp-file-p (buffer-file-name)))) |
306 |
(setq ad-return-value |
(setq ad-return-value |
307 |
(apply 'tramp-vc-simple-command okstatus command |
(apply 'tramp-vc-simple-command okstatus command |
308 |
(or file (buffer-file-name)) args)) |
(or file (buffer-file-name)) args)) |
309 |
ad-do-it))) |
ad-do-it))) |
310 |
|
|
362 |
|
|
363 |
|
|
364 |
;; Do we need to advise the vc-user-login-name function anyway? |
;; Do we need to advise the vc-user-login-name function anyway? |
365 |
;; This will return the correct login name for the owner of a |
;; This will return the correct login name for the owner of a |
366 |
;; file. It does not deal with the default remote user name... |
;; file. It does not deal with the default remote user name... |
367 |
;; |
;; |
368 |
;; That is, when vc calls (vc-user-login-name), we return the |
;; That is, when vc calls (vc-user-login-name), we return the |
369 |
;; local login name, something that may be different to the remote |
;; local login name, something that may be different to the remote |
370 |
;; default. |
;; default. |
371 |
;; |
;; |
372 |
;; The remote VC operations will occur as the user that we logged |
;; The remote VC operations will occur as the user that we logged |
373 |
;; in with however - not always the same as the local user. |
;; in with however - not always the same as the local user. |
374 |
;; |
;; |
375 |
;; In the end, I did advise the function. This is because, well, |
;; In the end, I did advise the function. This is because, well, |
376 |
;; the thing didn't work right otherwise ;) |
;; the thing didn't work right otherwise ;) |
377 |
;; |
;; |
378 |
;; Daniel Pittman <daniel@danann.net> |
;; Daniel Pittman <daniel@danann.net> |
417 |
(tramp-handle-vc-user-login-name uid)))) ; get the owner name |
(tramp-handle-vc-user-login-name uid)))) ; get the owner name |
418 |
ad-do-it))) ; else call the original |
ad-do-it))) ; else call the original |
419 |
|
|
420 |
|
|
421 |
;; Determine the name of the user owning a file. |
;; Determine the name of the user owning a file. |
422 |
(defun tramp-file-owner (filename) |
(defun tramp-file-owner (filename) |
423 |
"Return who owns FILE (user name, as a string)." |
"Return who owns FILE (user name, as a string)." |
424 |
(let ((v (tramp-dissect-file-name |
(let ((v (tramp-dissect-file-name |
425 |
(tramp-handle-expand-file-name filename)))) |
(tramp-handle-expand-file-name filename)))) |
426 |
(if (not (tramp-handle-file-exists-p filename)) |
(if (not (tramp-handle-file-exists-p filename)) |
427 |
nil ; file cannot be opened |
nil ; file cannot be opened |