emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in copy-directory


From: Thierry Volpiatto
Subject: Re: bug in copy-directory
Date: Wed, 09 Feb 2011 08:13:30 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2.93 (gnu/linux)

Chong Yidong <address@hidden> writes:

> Michael Albinus <address@hidden> writes:
>
>>> I asumme that, by (copy-directory "/tmp/test" "~/"), you mean
>>> M-: (copy-directory "/tmp/test" "~/") RET.
>>
>> Yes.
>>
>>> The behavior for that is the same as on 23.2.  If you want to copy into
>>> a subdirectory in ~/, give it a non-nil copy-as-subdir arg.
>>
>> "/tmp/test" is a directory. "~/test" does not exist yet. Therefore, I
>> would expect that a directory "~/test" is created, which is the copy of
>> "/tmp/test".
>
> To get copy-directory to behave like cp when optional args aren't
> specified, we have to change all the calls to copy-directory, in Dired
> and in Tramp.  The entire point of adding the COPY-AS-SUBDIR argument
> was to avoid having to do that.
>
> Given that we are well into pretest for 23.3, here are two options:
>
> 1. Keep the code that's in the emacs-23 branch.  From now on,
>    copy-directory needs a non-nil COPY-AS-SUBDIR arg to get cp-like
>    copying, when called from Lisp.  In the meantime, users of
>    M-x copy-directory will be surprised, but that's life.
Not anymore needed.

> 2. Revert the code in the emacs-23 branch to what it was in 23.2.
>    Change copy-directory on the trunk (probably by flipping the meaning
>    of the optional arg, and changing Dired and Tramp accordingly.)

I think you must fix that for 23.3, copying is important.

> Any arguments for either choice?

Finally, COPY-AS-SUBDIR is not needed, to remove it we used a second
function called copy-directory-1 and call copy-directory-1 from dired.
Now with these change the state is:

--8<---------------cut here---------------start------------->8---
Executing expectations in /home/thierry/.emacs.d/save-scratch.el...
5 expectations, 1 failures, 0 errors
Expectations finished at Wed Feb  9 07:51:24 2011
==== Failures and Errors ====
12 :FAIL: Expected <("/ssh:thievol:/home/thierry/test/a" 
"/ssh:thievol:/home/thierry/test/test" 
"/ssh:thievol:/home/thierry/test/test/b")> but was 
<("/ssh:thievol:/home/thierry/test/a" "/ssh:thievol:/home/thierry/test/test" 
"/ssh:thievol:/home/thierry/test/test/a" 
"/ssh:thievol:/home/thierry/test/test/b" 
"/ssh:thievol:/home/thierry/test/test/test" 
"/ssh:thievol:/home/thierry/test/test/test/b")>

==== All Results ====
1  :+++++ New expectations +++++
2  :copy-directory and overwrite
3  :OK
4  :+++++ New expectations +++++
5  :copy-directory and overwrite with tramp ssh method
6  :OK
7  :+++++ New expectations +++++
8  :Simulation copy-directory and overwrite from dired
9  :OK
10 :+++++ New expectations +++++
11 :Simulation copy-directory and overwrite from dired with ssh tramp names
12 :FAIL: Expected <("/ssh:thievol:/home/thierry/test/a" 
"/ssh:thievol:/home/thierry/test/test" 
"/ssh:thievol:/home/thierry/test/test/b")> but was 
<("/ssh:thievol:/home/thierry/test/a" "/ssh:thievol:/home/thierry/test/test" 
"/ssh:thievol:/home/thierry/test/test/a" 
"/ssh:thievol:/home/thierry/test/test/b" 
"/ssh:thievol:/home/thierry/test/test/test" 
"/ssh:thievol:/home/thierry/test/test/test/b")>
13 :+++++ New expectations +++++
14 :Simulation copy-directory and overwrite from dired with scpc tramp names
15 :OK

5 expectations, 1 failures, 0 errors
Expectations finished at Wed Feb  9 07:51:24 2011
--8<---------------cut here---------------end--------------->8---

So it fail only in one place, copying from dired with ssh method.
Because it seem ssh is the only method that call copy-directory, 
so dired call copy-directory-1 but the handler reuse copy-directory.
Otherwise other methods seem to work fine (here default method scpc
tested).

NOTE: In this version, if i add the call to handler also in
copy-directory, copying from dired from ssh method succeed, but
non--interactive call to copy-directory with ssh method fail:

--8<---------------cut here---------------start------------->8---
Executing expectations in /home/thierry/.emacs.d/save-scratch.el...
5 expectations, 1 failures, 0 errors
Expectations finished at Wed Feb  9 08:09:14 2011
==== Failures and Errors ====
6  :FAIL: Expected <("/ssh:thievol:/home/thierry/test/a" 
"/ssh:thievol:/home/thierry/test/test" 
"/ssh:thievol:/home/thierry/test/test/b")> but was 
<("/ssh:thievol:/home/thierry/test/b")>

==== All Results ====
1  :+++++ New expectations +++++
2  :copy-directory and overwrite
3  :OK
4  :+++++ New expectations +++++
5  :copy-directory and overwrite with tramp ssh method
6  :FAIL: Expected <("/ssh:thievol:/home/thierry/test/a" 
"/ssh:thievol:/home/thierry/test/test" 
"/ssh:thievol:/home/thierry/test/test/b")> but was 
<("/ssh:thievol:/home/thierry/test/b")>
7  :+++++ New expectations +++++
8  :Simulation copy-directory and overwrite from dired
9  :OK
10 :+++++ New expectations +++++
11 :Simulation copy-directory and overwrite from dired with ssh tramp names
12 :OK
13 :+++++ New expectations +++++
14 :Simulation copy-directory and overwrite from dired with scpc tramp names
15 :OK

5 expectations, 1 failures, 0 errors
Expectations finished at Wed Feb  9 08:09:14 2011
--8<---------------cut here---------------end--------------->8---

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]