commit 15c307417f7bc13b27f06994dd931cb04873a26f (HEAD, refs/remotes/origin/master) Author: Dmitry Gutov Date: Mon Jun 27 07:26:46 2016 +0300 Also handle escaping when string begins with a quote * lisp/progmodes/ruby-mode.el (ruby-toggle-string-quotes): Handle quoting of the first character in the string. * test/lisp/progmodes/ruby-mode-tests.el (ruby-toggle-string-quotes-quotes-correctly): Update. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index aa7c08c..e7b37ac 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1800,8 +1800,8 @@ If the result is do-end block, it will always be multiline." (buffer-substring-no-properties (1+ min) (1- max)))) (setq content (if (equal string-quote "'") - (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content)) - (replace-regexp-in-string "\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content)))) + (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\(\\`\\|[^\\\\]\\)'" "\\1\\\\'" content)) + (replace-regexp-in-string "\\\\'" "'" (replace-regexp-in-string "\\(\\`\\|[^\\\\]\\)\"" "\\1\\\\\"" content)))) (let ((orig-point (point))) (delete-region min max) (insert diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 5dd34f8..97f277b 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -718,8 +718,8 @@ VALUES-PLIST is a list with alternating index and value elements." (ert-deftest ruby-toggle-string-quotes-quotes-correctly () (let ((pairs - '(("puts 'foo\"\\''" . "puts \"foo\\\"'\"") - ("puts \"foo'\\\"\"" . "puts 'foo\\'\"'")))) + '(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"") + ("puts \"'foo'\\\"\"" . "puts '\\'foo\\'\"'")))) (dolist (pair pairs) (ruby-with-temp-buffer (car pair) (beginning-of-line) commit 7f02dedfcae6ba0e3a646c1367c908af9b3dbe1d Author: Sriram Thaiyar Date: Wed Jun 22 09:21:26 2016 -0700 Fix quote escaping in ruby-toggle-string-quotes * lisp/progmodes/ruby-mode.el (ruby-toggle-string-quotes): Change logic to quote based on the current quote of the string. * test/lisp/progmodes/ruby-mode-tests.el (ruby-toggle-string-quotes-quotes-correctly): Add test. Copyright-paperwork-exempt: yes diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index d75edbc..aa7c08c 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1799,7 +1799,7 @@ If the result is do-end block, it will always be multiline." (content (buffer-substring-no-properties (1+ min) (1- max)))) (setq content - (if (equal string-quote "\"") + (if (equal string-quote "'") (replace-regexp-in-string "\\\\\"" "\"" (replace-regexp-in-string "\\([^\\\\]\\)'" "\\1\\\\'" content)) (replace-regexp-in-string "\\\\'" "'" (replace-regexp-in-string "\\([^\\\\]\\)\"" "\\1\\\\\"" content)))) (let ((orig-point (point))) diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 52126a3..5dd34f8 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -716,6 +716,17 @@ VALUES-PLIST is a list with alternating index and value elements." (ruby-backward-sexp) (should (= 2 (line-number-at-pos))))) +(ert-deftest ruby-toggle-string-quotes-quotes-correctly () + (let ((pairs + '(("puts 'foo\"\\''" . "puts \"foo\\\"'\"") + ("puts \"foo'\\\"\"" . "puts 'foo\\'\"'")))) + (dolist (pair pairs) + (ruby-with-temp-buffer (car pair) + (beginning-of-line) + (search-forward "foo") + (ruby-toggle-string-quotes) + (should (string= (buffer-string) (cdr pair))))))) + (ert-deftest ruby--insert-coding-comment-ruby-style () (with-temp-buffer (let ((ruby-encoding-magic-comment-style 'ruby)) commit dd98ee8992c3246861e44447ffcd02886a52878e Author: Noam Postavsky Date: Fri Jun 24 20:44:44 2016 -0400 Fix test-completion with completion-regexp-list * src/minibuf.c (Ftest_completion): Handle alist COLLECTION with non-nil completion-regexp-list (Bug #23533). diff --git a/src/minibuf.c b/src/minibuf.c index efce7e2..57eea05 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1686,6 +1686,8 @@ the values STRING, PREDICATE and `lambda'. */) tem = Fassoc_string (string, collection, completion_ignore_case ? Qt : Qnil); if (NILP (tem)) return Qnil; + else if (CONSP (tem)) + tem = XCAR (tem); } else if (VECTORP (collection)) { commit 2989ad906048b374653d7030ebdaea62b670eed0 Author: Paul Eggert Date: Sun Jun 26 23:27:21 2016 +0200 Try other addresses when connecting to multihomed Problem reported by Juliusz Chroboczek (Bug#17976) and by Artur Malabarba (Bug#23620). Patch from a suggestion by Andreas Schwab in: http://bugs.gnu.org/17976#39 This patch is for non-MS-Windows platforms. I don't know the situation on MS-Windows. * src/process.c (connecting_status): New function, for (connect . ADDRINFOS). (connect_network_socket, check_for_dns, wait_for_socket_fds) (wait_while_connecting, wait_reading_process_output, status_notify): Use it. (decode_status, Fmake_network_process): Support (connect . ADDRINFOS) status. (connect_network_socket) [!WINDOWSNT]: If the connection failed and there are other addresses to try, do not signal an error; instead, loop around to try the next address. (wait_reading_process_output): Advance to the next address if there are multiple addresses and the first remaining address failed. * src/process.h (struct Lisp_Process.status): Adjust comment to describe (connect . ADDRINFOS). diff --git a/src/process.c b/src/process.c index e669278..ed0c529 100644 --- a/src/process.c +++ b/src/process.c @@ -533,6 +533,14 @@ status_convert (int w) return Qrun; } +/* True if STATUS is that of a process attempting connection. */ + +static bool +connecting_status (Lisp_Object status) +{ + return CONSP (status) && EQ (XCAR (status), Qconnect); +} + /* Given a status-list, extract the three pieces of information and store them individually through the three pointers. */ @@ -542,6 +550,9 @@ decode_status (Lisp_Object l, Lisp_Object *symbol, Lisp_Object *code, { Lisp_Object tem; + if (connecting_status (l)) + l = XCAR (l); + if (SYMBOLP (l)) { *symbol = l; @@ -3288,9 +3299,10 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, eassert (FD_ISSET (s, &fdset)); if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) < 0) report_file_error ("Failed getsockopt", Qnil); - if (xerrno) + if (xerrno == 0) + break; + if (NILP (addrinfos)) report_file_errno ("Failed connect", Qnil, xerrno); - break; } #endif /* !WINDOWSNT */ @@ -3399,7 +3411,9 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos, /* We may get here if connect did succeed immediately. However, in that case, we still need to signal this like a non-blocking connection. */ - pset_status (p, Qconnect); + if (! (connecting_status (p->status) + && EQ (XCDR (p->status), addrinfos))) + pset_status (p, Fcons (Qconnect, addrinfos)); if (!FD_ISSET (inch, &connect_wait_mask)) { FD_SET (inch, &connect_wait_mask); @@ -3960,7 +3974,7 @@ usage: (make-network-process &rest ARGS) */) if (!p->is_server && NILP (addrinfos)) { p->dns_request = dns_request; - p->status = Qconnect; + p->status = list1 (Qconnect); return proc; } #endif @@ -4673,7 +4687,7 @@ check_for_dns (Lisp_Object proc) addrinfos = Fnreverse (addrinfos); } /* The DNS lookup failed. */ - else if (EQ (p->status, Qconnect)) + else if (connecting_status (p->status)) { deactivate_process (proc); pset_status (p, (list2 @@ -4686,7 +4700,7 @@ check_for_dns (Lisp_Object proc) free_dns_request (proc); /* This process should not already be connected (or killed). */ - if (!EQ (p->status, Qconnect)) + if (! connecting_status (p->status)) return Qnil; return addrinfos; @@ -4698,7 +4712,7 @@ static void wait_for_socket_fds (Lisp_Object process, char const *name) { while (XPROCESS (process)->infd < 0 - && EQ (XPROCESS (process)->status, Qconnect)) + && connecting_status (XPROCESS (process)->status)) { add_to_log ("Waiting for socket from %s...", build_string (name)); wait_reading_process_output (0, 20 * 1000 * 1000, 0, 0, Qnil, NULL, 0); @@ -4708,7 +4722,7 @@ wait_for_socket_fds (Lisp_Object process, char const *name) static void wait_while_connecting (Lisp_Object process) { - while (EQ (XPROCESS (process)->status, Qconnect)) + while (connecting_status (XPROCESS (process)->status)) { add_to_log ("Waiting for connection..."); wait_reading_process_output (0, 20 * 1000 * 1000, 0, 0, Qnil, NULL, 0); @@ -5010,7 +5024,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, update_status (wait_proc); if (wait_proc && ! EQ (wait_proc->status, Qrun) - && ! EQ (wait_proc->status, Qconnect)) + && ! connecting_status (wait_proc->status)) { bool read_some_bytes = false; @@ -5520,9 +5534,18 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, #endif if (xerrno) { - p->tick = ++process_tick; - pset_status (p, list2 (Qfailed, make_number (xerrno))); + Lisp_Object addrinfos + = connecting_status (p->status) ? XCDR (p->status) : Qnil; + if (!NILP (addrinfos)) + XSETCDR (p->status, XCDR (addrinfos)); + else + { + p->tick = ++process_tick; + pset_status (p, list2 (Qfailed, make_number (xerrno))); + } deactivate_process (proc); + if (!NILP (addrinfos)) + connect_network_socket (proc, addrinfos, Qnil); } else { @@ -6999,7 +7022,7 @@ status_notify (struct Lisp_Process *deleting_process, /* If process is still active, read any output that remains. */ while (! EQ (p->filter, Qt) - && ! EQ (p->status, Qconnect) + && ! connecting_status (p->status) && ! EQ (p->status, Qlisten) /* Network or serial process not stopped: */ && ! EQ (p->command, Qt) diff --git a/src/process.h b/src/process.h index 4430377..6c227bc 100644 --- a/src/process.h +++ b/src/process.h @@ -83,7 +83,9 @@ struct Lisp_Process Lisp_Object mark; /* Symbol indicating status of process. - This may be a symbol: run, open, closed, listen, connect, or failed. + This may be a symbol: run, open, closed, listen, or failed. + Or it may be a pair (connect . ADDRINFOS) where ADDRINFOS is + a list of remaining (PROTOCOL . ADDRINFO) pairs to try. Or it may be (failed ERR) where ERR is an integer, string or symbol. Or it may be a list, whose car is stop, exit or signal and whose cdr is a pair (EXIT_CODE . COREDUMP_FLAG) commit d267aea2424783f5eefb6e733a6806ffd3323fa0 Author: Paul Eggert Date: Sun Jun 26 22:21:49 2016 +0200 Fix GNUC_PREREQ for GCC 2.8.1 etc. Problem reported by Eli Zaretskii in: http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00608.html * src/conf_post.h (GNUC_PREREQ): Port to GCC versions like GCC 2.8.1 (1998), which come before GCC 3.0 and which have nonzero patchlevel numbers. diff --git a/src/conf_post.h b/src/conf_post.h index 69b981f..99aafbf 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -39,7 +39,8 @@ along with GNU Emacs. If not, see . */ #ifndef __GNUC_MINOR__ # define GNUC_PREREQ(v, w, x) false #elif ! defined __GNUC_PATCHLEVEL__ -# define GNUC_PREREQ(v, w, x) ((v) < __GNUC__ + ((w) <= __GNUC_MINOR__)) +# define GNUC_PREREQ(v, w, x) \ + ((v) < __GNUC__ + ((w) < __GNUC_MINOR__ + ((x) == 0)) #else # define GNUC_PREREQ(v, w, x) \ ((v) < __GNUC__ + ((w) < __GNUC_MINOR__ + ((x) <= __GNUC_PATCHLEVEL__))) commit e26931cba81539673756f042472f723cdf28f97d Author: Eli Zaretskii Date: Sun Jun 26 19:51:22 2016 +0300 Don't set 'bidi-paragraph-direction' in 'ansi-term' * lisp/term.el (ansi-term): Remove unnecessary setting of 'bidi-paragraph-direction'. The underlying problem is solved in bidi.c by changing the regexps that define the paragraph beginning and end. (Bug#20611) diff --git a/lisp/term.el b/lisp/term.el index 28be8c8..87f600c 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -4150,17 +4150,7 @@ the process. Any more args are arguments to PROGRAM." ;; .emacs ... (term-set-escape-char ?\C-x)) - (switch-to-buffer term-ansi-buffer-name) - ;; For some reason, without the below setting, ansi-term behaves - ;; sluggishly, not clear why, since the buffer is typically very - ;; small. - ;; - ;; There's a larger problem here with supporting bidirectional text: - ;; the application that writes to the terminal could have its own - ;; ideas about displaying bidirectional text, and might not want us - ;; reordering the text or deciding on base paragraph direction. One - ;; such application is Emacs in TTY mode... FIXME. - (setq bidi-paragraph-direction 'left-to-right)) + (switch-to-buffer term-ansi-buffer-name)) ;;; Serial terminals commit 8419f0d166cf5107062ff74f120c591f3fce35d9 Author: Paul Eggert Date: Sun Jun 26 13:38:21 2016 +0200 ; Spelling fixes diff --git a/lisp/emacs-lisp/map.el b/lisp/emacs-lisp/map.el index 735ab8f..98a8871 100644 --- a/lisp/emacs-lisp/map.el +++ b/lisp/emacs-lisp/map.el @@ -373,7 +373,7 @@ MAP can be a list, hash-table or array." alist)) (defun map--do-array (function array) - "Private function usde to iterate over ARRAY using FUNCTION." + "Private function used to iterate over ARRAY using FUNCTION." (seq-do-indexed (lambda (elt index) (funcall function index elt)) array)) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 5fa0403..17415a2 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -5829,7 +5829,7 @@ comment at the start of cc-engine.el for more info." ;; never a backslash escaping the end of line. If the character preceding ;; this "last possible" character is itself a backslash, this preceding ;; character gets a "punctuation" `syntax-table' value. If the "(" is -;; already at the end of the macro, it gets the "punctuaion" value, and no +;; already at the end of the macro, it gets the "punctuation" value, and no ;; "string fence"s are used. ;; ;; The effect on the fontification of either of these tactics is that rest of @@ -6061,7 +6061,7 @@ comment at the start of cc-engine.el for more info." ;; ;; Point is undefined on both entry and exit, and the return value has no ;; significance. - ;; + ;; ;; This function is called as an after-change function solely due to its ;; membership of the C++ value of `c-before-font-lock-functions'. (c-save-buffer-state () commit e68fe57c52a815a4289380a8bdd3eaa1b7e6dc88 Author: Michael Albinus Date: Sun Jun 26 13:02:38 2016 +0200 Sync with Tramp 2.3.0 * doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.3.0". diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index cdd008b..6f67f35 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -8,7 +8,7 @@ @c In the Tramp GIT, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.3.0-pre +@set trampver 2.3.0 @c Other flags from configuration @set instprefix /usr/local diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el index 64cc47e..aea2605 100644 --- a/lisp/net/trampver.el +++ b/lisp/net/trampver.el @@ -6,7 +6,7 @@ ;; Author: Kai Großjohann ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.3.0-pre +;; Version: 2.3.0 ;; This file is part of GNU Emacs. @@ -32,7 +32,7 @@ ;; should be changed only there. ;;;###tramp-autoload -(defconst tramp-version "2.3.0-pre" +(defconst tramp-version "2.3.0" "This version of Tramp.") ;;;###tramp-autoload @@ -54,7 +54,7 @@ ;; Check for Emacs version. (let ((x (if (>= emacs-major-version 23) "ok" - (format "Tramp 2.3.0-pre is not fit for %s" + (format "Tramp 2.3.0 is not fit for %s" (when (string-match "^.*$" (emacs-version)) (match-string 0 (emacs-version))))))) (unless (string-match "\\`ok\\'" x) (error "%s" x))) commit 094aaf226f904638f6da22468674782bd36c18e9 Author: Paul Eggert Date: Sun Jun 26 12:44:39 2016 +0200 Fix GNUC_PREREQ off-by-1 typo Problem reported by Martin Rudalics in: http://lists.gnu.org/archive/html/emacs-devel/2016-06/msg00587.html * src/conf_post.h (GNUC_PREREQ) [__GNUC_PATCHLEVEL__]: Fix < vs <= typo. diff --git a/src/conf_post.h b/src/conf_post.h index 7aa5bae..69b981f 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -42,7 +42,7 @@ along with GNU Emacs. If not, see . */ # define GNUC_PREREQ(v, w, x) ((v) < __GNUC__ + ((w) <= __GNUC_MINOR__)) #else # define GNUC_PREREQ(v, w, x) \ - ((v) < __GNUC__ + ((w) <= __GNUC_MINOR__ + ((x) <= __GNUC_PATCHLEVEL__))) + ((v) < __GNUC__ + ((w) < __GNUC_MINOR__ + ((x) <= __GNUC_PATCHLEVEL__))) #endif /* The type of bool bitfields. Needed to compile Objective-C with commit 574904bbb305c0cda4ee6bda38076f7829a9a253 Author: Michael Albinus Date: Sun Jun 26 12:30:21 2016 +0200 Fix some oddities in Tramp's rsync and smb methods * lisp/net/tramp-sh.el (tramp-methods) : Add "-p" and "-s" arguments. (tramp-do-copy-or-rename-file-out-of-band): Call `file-name-directory' also for remote NEWNAME. * test/lisp/net/tramp-tests.el (tramp-test15-copy-directory): Do not skip for tramp-smb.el. Test als COPY-CONTENTS case. (tramp-test24-file-name-completion): Improve check for hostname completion. (tramp--test-rsync-p): New defun. (tramp-test31-special-characters) (tramp-test31-special-characters-with-stat) (tramp-test31-special-characters-with-perl) (tramp-test31-special-characters-with-ls, tramp-test32-utf8) (tramp-test32-utf8-with-stat, tramp-test32-utf8-with-perl) (tramp-test32-utf8-with-ls): Skip for "rsync". * lisp/net/tramp-smb.el (tramp-smb-handle-copy-directory): Check also for CIFS capabilities. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 19f687c..606572b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -203,7 +203,7 @@ The string is used in `tramp-methods'.") (tramp-remote-shell-login ("-l")) (tramp-remote-shell-args ("-c")) (tramp-copy-program "rsync") - (tramp-copy-args (("-t" "%k") ("-r"))) + (tramp-copy-args (("-t" "%k") ("-p") ("-r") ("-s"))) (tramp-copy-env (("RSYNC_RSH") ("ssh" "%c"))) (tramp-copy-keep-date t) (tramp-copy-keep-tmpfile t) @@ -2378,17 +2378,16 @@ The method used must be an out-of-band method." (setq source (if t1 (tramp-make-copy-program-file-name v) (shell-quote-argument filename)) - target (if t2 - (tramp-make-copy-program-file-name v) - (shell-quote-argument - (funcall + target (funcall (if (and (file-directory-p filename) (string-equal (file-name-nondirectory filename) (file-name-nondirectory newname))) 'file-name-directory 'identity) - newname)))) + (if t2 + (tramp-make-copy-program-file-name v) + (shell-quote-argument newname)))) ;; Check for host and port number. We cannot use ;; `tramp-file-name-port', because this returns also diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index fbd7cd3..a526fd9 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -129,7 +129,8 @@ call, letting the SMB client use the default one." "ERRnosuchshare" ;; Windows 4.0 (Windows NT), Windows 5.0 (Windows 2000), ;; Windows 5.1 (Windows XP), Windows 5.2 (Windows Server 2003), - ;; Windows 6.0 (Windows Vista), Windows 6.1 (Windows 7). + ;; Windows 6.0 (Windows Vista), Windows 6.1 (Windows 7), + ;; Windows 6.3 (Windows 10). "NT_STATUS_ACCESS_DENIED" "NT_STATUS_ACCOUNT_LOCKED_OUT" "NT_STATUS_BAD_NETWORK_NAME" @@ -425,7 +426,7 @@ pass to the OPERATION." (delete-directory tmpdir 'recursive)))) ;; We can copy recursively. - ((or t1 t2) + ((and (or t1 t2) (tramp-smb-get-cifs-capabilities v)) (when (and (file-directory-p newname) (not (string-equal (file-name-nondirectory dirname) (file-name-nondirectory newname)))) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index a8d89e8..b9562c1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -960,11 +960,6 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (ert-deftest tramp-test15-copy-directory () "Check `copy-directory'." (skip-unless (tramp--test-enabled)) - (skip-unless - (not - (eq - (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) - 'tramp-smb-file-name-handler))) (let* ((tmp-name1 (tramp--test-make-temp-name)) (tmp-name2 (tramp--test-make-temp-name)) @@ -973,6 +968,8 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (tmp-name4 (expand-file-name "foo" tmp-name1)) (tmp-name5 (expand-file-name "foo" tmp-name2)) (tmp-name6 (expand-file-name "foo" tmp-name3))) + + ;; Copy complete directory. (unwind-protect (progn ;; Copy empty directory. @@ -991,6 +988,31 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." ;; Cleanup. (ignore-errors (delete-directory tmp-name1 'recursive) + (delete-directory tmp-name2 'recursive))) + + ;; Copy directory contents. + (unwind-protect + (progn + ;; Copy empty directory. + (make-directory tmp-name1) + (write-region "foo" nil tmp-name4) + (should (file-directory-p tmp-name1)) + (should (file-exists-p tmp-name4)) + (copy-directory tmp-name1 tmp-name2 nil 'parents 'contents) + (should (file-directory-p tmp-name2)) + (should (file-exists-p tmp-name5)) + ;; Target directory does exist already. + (delete-file tmp-name5) + (should-not (file-exists-p tmp-name5)) + (copy-directory tmp-name1 tmp-name2 nil 'parents 'contents) + (should (file-directory-p tmp-name2)) + (should (file-exists-p tmp-name5)) + (should-not (file-directory-p tmp-name3)) + (should-not (file-exists-p tmp-name6))) + + ;; Cleanup. + (ignore-errors + (delete-directory tmp-name1 'recursive) (delete-directory tmp-name2 'recursive))))) (ert-deftest tramp-test16-directory-files () @@ -1390,10 +1412,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (format "%s:" method) (file-name-all-completions (substring method 0 1) "/")))) (unless (zerop (length host)) - (should - (member - (format "%s:" host) - (file-name-all-completions (substring host 0 1) "/")))) + (let ((tramp-default-method (or method tramp-default-method))) + (should + (member + (format "%s:" host) + (file-name-all-completions (substring host 0 1) "/"))))) (unless (or (zerop (length method)) (zerop (length host))) (should (member @@ -1846,6 +1869,12 @@ This does not support globbing characters in file names (yet)." (string-match "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method)))) +(defun tramp--test-rsync-p () + "Check, whether the rsync method is used. +This does not support special file names." + (string-equal + "rsync" (file-remote-p tramp-test-temporary-file-directory 'method))) + (defun tramp--test-gvfs-p () "Check, whether the remote host runs a GVFS based method. This requires restrictions of file name syntax." @@ -2045,6 +2074,7 @@ Several special characters do not work properly there." (ert-deftest tramp-test31-special-characters () "Check special characters in file names." (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (tramp--test-special-characters)) @@ -2053,6 +2083,7 @@ Several special characters do not work properly there." Use the `stat' command." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (skip-unless (eq (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) @@ -2072,6 +2103,7 @@ Use the `stat' command." Use the `perl' command." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (skip-unless (eq (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) @@ -2094,6 +2126,7 @@ Use the `perl' command." Use the `ls' command." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (skip-unless (eq (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) @@ -2129,6 +2162,7 @@ Use the `ls' command." (ert-deftest tramp-test32-utf8 () "Check UTF8 encoding in file names and file contents." (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (tramp--test-utf8)) @@ -2137,6 +2171,7 @@ Use the `ls' command." Use the `stat' command." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (skip-unless (eq (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) @@ -2156,6 +2191,7 @@ Use the `stat' command." Use the `perl' command." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (skip-unless (eq (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) @@ -2178,6 +2214,7 @@ Use the `perl' command." Use the `ls' command." :tags '(:expensive-test) (skip-unless (tramp--test-enabled)) + (skip-unless (not (tramp--test-rsync-p))) (skip-unless (eq (tramp-find-foreign-file-name-handler tramp-test-temporary-file-directory) @@ -2355,8 +2392,7 @@ Since it unloads Tramp, it shall be the last test to run." ;; * Work on skipped tests. Make a comment, when it is impossible. ;; * Fix `tramp-test06-directory-file-name' for `ftp'. -;; * Fix `tramp-test15-copy-directory' for `smb'. Using tar in a pipe -;; doesn't work well when an interactive password must be provided. +;; * Fix `tramp-test15-copy-directory' for `rsync'. ;; * Fix `tramp-test27-start-file-process' on MS Windows (`process-send-eof'?). ;; * Fix Bug#16928. Set expected error of `tramp-test33-asynchronous-requests'. ;; * Fix `tramp-test35-unload' (Not all symbols are unbound). Set