diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-28 05:16:46 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-28 05:16:46 +0000 |
commit | 7829c32eaf4bfbd0bdd4a63cf13dd09929057c8c (patch) | |
tree | 680706f6e755b7add3794ebc360520f661f11d14 | |
parent | 513b313db1b102f330b994b8fd908a2c10553d7b (diff) |
merge revision(s) 50141: [Backport #11021]
* lib/fileutils.rb (FileUtils#mv): show the exact target path in
the error message instead of the destination parent directory
name. patched by Joao Britto <jabcalves AT gmail.com> at
[ruby-core:68706]. [Bug #11021]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/fileutils.rb | 2 | ||||
-rw-r--r-- | test/fileutils/test_fileutils.rb | 3 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,10 @@ +Tue Apr 28 14:15:49 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/fileutils.rb (FileUtils#mv): show the exact target path in + the error message instead of the destination parent directory + name. patched by Joao Britto <jabcalves AT gmail.com> at + [ruby-core:68706]. [Bug #11021] + Tue Apr 28 14:14:16 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> * thread_pthread.c (reserve_stack): keep sp safe zone to get rid diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 335d60d4a2..5af756be4c 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -516,7 +516,7 @@ module FileUtils begin if destent.exist? if destent.directory? - raise Errno::EEXIST, dest + raise Errno::EEXIST, d else destent.remove_file if rename_cannot_overwrite_file? end diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 6aa89c49ef..c409447def 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -390,7 +390,8 @@ class TestFileUtils mkdir 'tmp/tmpdir' mkdir_p 'tmp/dest2/tmpdir' - assert_raise(Errno::EEXIST) { + assert_raise_with_message(Errno::EEXIST, %r' - tmp/dest2/tmpdir\z', + '[ruby-core:68706] [Bug #11021]') { mv 'tmp/tmpdir', 'tmp/dest2' } mkdir 'tmp/dest2/tmpdir/junk' @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.1.7" #define RUBY_RELEASE_DATE "2015-04-28" -#define RUBY_PATCHLEVEL 339 +#define RUBY_PATCHLEVEL 340 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 4 |