77 |
"Like `vc-do-command' but invoked for tramp files. |
"Like `vc-do-command' but invoked for tramp files. |
78 |
See `vc-do-command' for more information." |
See `vc-do-command' for more information." |
79 |
(save-match-data |
(save-match-data |
80 |
(and file (setq file (tramp-handle-expand-file-name file))) |
(and file (setq file (expand-file-name file))) |
81 |
(if (not buffer) (setq buffer "*vc*")) |
(if (not buffer) (setq buffer "*vc*")) |
82 |
(if vc-command-messages |
(if vc-command-messages |
83 |
(message "Running `%s' on `%s'..." command file)) |
(message "Running `%s' on `%s'..." command file)) |
85 |
(squeezed nil) |
(squeezed nil) |
86 |
(olddir default-directory) |
(olddir default-directory) |
87 |
vc-file status) |
vc-file status) |
88 |
(let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) |
(let* ((v (tramp-dissect-file-name (expand-file-name file))) |
89 |
(multi-method (tramp-file-name-multi-method v)) |
(multi-method (tramp-file-name-multi-method v)) |
90 |
(method (tramp-file-name-method v)) |
(method (tramp-file-name-method v)) |
91 |
(user (tramp-file-name-user v)) |
(user (tramp-file-name-user v)) |
130 |
(save-excursion |
(save-excursion |
131 |
(save-window-excursion |
(save-window-excursion |
132 |
;; Actually execute remote command |
;; Actually execute remote command |
133 |
(tramp-handle-shell-command |
(shell-command |
134 |
(mapconcat 'tramp-shell-quote-argument |
(mapconcat 'tramp-shell-quote-argument |
135 |
(cons command squeezed) " ") t) |
(cons command squeezed) " ") t) |
136 |
;;(tramp-wait-for-output) |
;;(tramp-wait-for-output) |
190 |
(let ((w32-quote-process-args t)) |
(let ((w32-quote-process-args t)) |
191 |
(when (eq okstatus 'async) |
(when (eq okstatus 'async) |
192 |
(message "Tramp doesn't do async commands, running synchronously.")) |
(message "Tramp doesn't do async commands, running synchronously.")) |
193 |
(setq status (tramp-handle-shell-command |
(setq status (shell-command |
194 |
(mapconcat 'tramp-shell-quote-argument |
(mapconcat 'tramp-shell-quote-argument |
195 |
(cons command squeezed) " ") t)) |
(cons command squeezed) " ") t)) |
196 |
(when (or (not (integerp status)) |
(when (or (not (integerp status)) |
257 |
;; Don't switch to the *vc-info* buffer before running the |
;; Don't switch to the *vc-info* buffer before running the |
258 |
;; command, because that would change its default directory |
;; command, because that would change its default directory |
259 |
(save-match-data |
(save-match-data |
260 |
(let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) |
(let* ((v (tramp-dissect-file-name (expand-file-name file))) |
261 |
(multi-method (tramp-file-name-multi-method v)) |
(multi-method (tramp-file-name-multi-method v)) |
262 |
(method (tramp-file-name-method v)) |
(method (tramp-file-name-method v)) |
263 |
(user (tramp-file-name-user v)) |
(user (tramp-file-name-user v)) |
284 |
(save-excursion |
(save-excursion |
285 |
(save-window-excursion |
(save-window-excursion |
286 |
;; Actually execute remote command |
;; Actually execute remote command |
287 |
(tramp-handle-shell-command |
(shell-command |
288 |
(mapconcat 'tramp-shell-quote-argument |
(mapconcat 'tramp-shell-quote-argument |
289 |
(append (list command) args (list localname)) " ") |
(append (list command) args (list localname)) " ") |
290 |
(get-buffer-create"*vc-info*")) |
(get-buffer-create"*vc-info*")) |
414 |
(nth 2 (file-attributes file))))) |
(nth 2 (file-attributes file))))) |
415 |
(if (and uid (/= uid remote-uid)) |
(if (and uid (/= uid remote-uid)) |
416 |
(error "tramp-handle-vc-user-login-name cannot map a uid to a name") |
(error "tramp-handle-vc-user-login-name cannot map a uid to a name") |
417 |
(let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) |
(let* ((v (tramp-dissect-file-name (expand-file-name file))) |
418 |
(u (tramp-file-name-user v))) |
(u (tramp-file-name-user v))) |
419 |
(cond ((stringp u) u) |
(cond ((stringp u) u) |
420 |
((vectorp u) (elt u (1- (length u)))) |
((vectorp u) (elt u (1- (length u)))) |
445 |
(defun tramp-file-owner (filename) |
(defun tramp-file-owner (filename) |
446 |
"Return who owns FILE (user name, as a string)." |
"Return who owns FILE (user name, as a string)." |
447 |
(let ((v (tramp-dissect-file-name |
(let ((v (tramp-dissect-file-name |
448 |
(tramp-handle-expand-file-name filename)))) |
(expand-file-name filename)))) |
449 |
(if (not (tramp-handle-file-exists-p filename)) |
(if (not (file-exists-p filename)) |
450 |
nil ; file cannot be opened |
nil ; file cannot be opened |
451 |
;; file exists, find out stuff |
;; file exists, find out stuff |
452 |
(save-excursion |
(save-excursion |