CVS update by scop packages/xemacs-packages/vc ...
xemacs-cvs at xemacs.org
xemacs-cvs at xemacs.org
Sun Oct 28 13:46:58 EDT 2007
User: scop
Date: 07/10/28 18:46:58
Modified: packages/xemacs-packages/vc ChangeLog vc-hooks.el
Log:
Use tramp directly in absence of a better fix
Revision Changes Path
1.53 +6 -0 XEmacs/packages/xemacs-packages/vc/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/vc/ChangeLog,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -p -r1.52 -r1.53
--- ChangeLog 2007/09/29 06:59:32 1.52
+++ ChangeLog 2007/10/28 17:46:57 1.53
@@ -1,3 +1,9 @@
+2007-10-28 Ville Skyttä <scop at xemacs.org>
+
+ * vc-hooks.el (vc-user-login-name): Use tramp directly, we don't
+ have `process-file' in XEmacs. Warning: it is known that this
+ approach only works with tramp 2.0 (not 2.1).
+
2007-09-29 Norbert Koch <viteno at xemacs.org>
* Makefile (VERSION): XEmacs package 1.44 released.
1.15 +23 -9 XEmacs/packages/xemacs-packages/vc/vc-hooks.el
Index: vc-hooks.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/vc/vc-hooks.el,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- vc-hooks.el 2007/09/28 19:04:24 1.14
+++ vc-hooks.el 2007/10/28 17:46:57 1.15
@@ -6,7 +6,7 @@
;; Author: FSF (see vc.el for full credits)
;; Maintainer: Andre Spiegel <spiegel at gnu.org>
-;; $Id: vc-hooks.el,v 1.14 2007/09/28 19:04:24 scop Exp $
+;; $Id: vc-hooks.el,v 1.15 2007/10/28 17:46:57 scop Exp $
;; This file is part of GNU Emacs.
@@ -443,18 +443,32 @@ For registered files, the possible value
(vc-file-setprop file 'vc-checkout-model
(vc-call checkout-model file)))))
+
+;; XEmacs change: added for our with-parsed-tramp-file-name change below
+(eval-when-compile
+ (require 'tramp))
+
(defun vc-user-login-name (file)
"Return the name under which the user accesses the given FILE."
(or (and (eq (string-match tramp-file-name-regexp file) 0)
;; tramp case: execute "whoami" via tramp
- (let ((default-directory (file-name-directory file)))
- (with-temp-buffer
- (if (not (zerop (process-file "whoami" nil t)))
- ;; fall through if "whoami" didn't work
- nil
- ;; remove trailing newline
- (delete-region (1- (point-max)) (point-max))
- (buffer-string)))))
+ ;; XEmacs change: we don't have process-file or call-process for
+ ;; which we could apply the tramp handler, use tramp directly.
+ ;; TODO: this should work with tramp 2.0, but won't work with >= 2.1
+ (condition-case nil
+ (progn
+ (require 'tramp)
+ (with-parsed-tramp-file-name file nil
+ (if (not (zerop (tramp-send-command-and-check
+ multi-method method user host "whoami")))
+ nil
+ ;; First line should be the output of "whoami"
+ (goto-char (point-min))
+ (read (current-buffer)))))
+ (error
+ (message (concat "Could not resolve login name using tramp, "
+ "falling back to local (known bug: does not "
+ "work with tramp >= 2.1)")))))
;; normal case
(user-login-name)
;; if user-login-name is nil, return the UID as a string
More information about the XEmacs-CVS
mailing list