From: Eli Zaretskii Date: Sat, 27 Jun 2015 11:27:23 +0000 (+0300) Subject: Fix VC test suite on MS-Windows X-Git-Tag: emacs-25.0.90~1629 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7baae811651d73b3e89c832a5c15ff5b40c82635;p=emacs.git Fix VC test suite on MS-Windows * lisp/vc/vc-svn.el (vc-svn-create-repo): Make sure the file: URL always starts with 3 slashes after the colon. * test/automated/vc-tests.el (vc-test--create-repo-function): Use 'w32-application-type' to invoke CVS on MS-Windows with properly formatted CVSROOT directory name. --- diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 5ce9afa02c6..f97e2ab17e9 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el @@ -279,7 +279,15 @@ RESULT is a list of conses (FILE . STATE) for directory DIR." ;; Expand default-directory because svn gets confused by eg ;; file://~/path/to/file. (Bug#15446). (vc-svn-command "*vc*" 0 "." "checkout" - (concat "file://" (expand-file-name default-directory) "SVN"))) + (let ((defdir (expand-file-name default-directory))) + (concat (if (and (stringp defdir) + (eq (aref defdir 0) ?/)) + "file://" + ;; MS-Windows files d:/foo/bar need to + ;; begin with 3 leading slashes. + "file:///") + defdir + "SVN")))) (autoload 'vc-switches "vc") diff --git a/test/automated/vc-tests.el b/test/automated/vc-tests.el index 58d22378100..a7242e95e95 100644 --- a/test/automated/vc-tests.el +++ b/test/automated/vc-tests.el @@ -130,7 +130,19 @@ For backends which dont support it, it is emulated." (make-temp-name "vc-test") temporary-file-directory))) (make-directory (expand-file-name "module" tmp-dir) 'parents) (make-directory (expand-file-name "CVSROOT" tmp-dir) 'parents) - (shell-command-to-string (format "cvs -Q -d:local:%s co module" tmp-dir)) + (if (not (fboundp 'w32-application-type)) + (shell-command-to-string (format "cvs -Q -d:local:%s co module" + tmp-dir)) + (let ((cvs-prog (executable-find "cvs")) + (tdir tmp-dir)) + ;; If CVS executable is an MSYS program, reformat the file + ;; name of TMP-DIR to have the /d/foo/bar form supported by + ;; MSYS programs. (FIXME: What about Cygwin cvs.exe?) + (if (eq (w32-application-type cvs-prog) 'msys) + (setq tdir + (concat "/" (substring tmp-dir 0 1) (substring tmp-dir 2)))) + (shell-command-to-string (format "cvs -Q -d:local:%s co module" + tdir)))) (rename-file "module/CVS" default-directory) (delete-directory "module" 'recursive) ;; We must cleanup the "remote" CVS repo as well.