ruby-changes:19731
From: yugui <ko1@a...>
Date: Sun, 29 May 2011 08:32:46 +0900 (JST)
Subject: [ruby-changes:19731] yugui:r31776 (ruby_1_9_2): merges r31101 from trunk into ruby_1_9_2.
yugui 2011-05-29 08:32:37 +0900 (Sun, 29 May 2011) New Revision: 31776 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31776 Log: merges r31101 from trunk into ruby_1_9_2. -- * lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337] * test/test_pstore.rb: Test for above. Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337] Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/lib/pstore.rb branches/ruby_1_9_2/test/test_pstore.rb branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 31775) +++ ruby_1_9_2/ChangeLog (revision 31776) @@ -1,3 +1,11 @@ +Sun Mar 13 16:07:58 2011 Shota Fukumori <sorah@t...> + + * lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe + is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337] + + * test/test_pstore.rb: Test for above. + Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337] + Thu Mar 10 21:59:37 2011 NARUSE, Yui <naruse@r...> * parse.y (parser_encode_length): add exception as UTF8-MAC for Index: ruby_1_9_2/lib/pstore.rb =================================================================== --- ruby_1_9_2/lib/pstore.rb (revision 31775) +++ ruby_1_9_2/lib/pstore.rb (revision 31776) @@ -341,6 +341,8 @@ end end value + rescue ThreadError + raise PStore::Error, "nested transaction" end private Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 31775) +++ ruby_1_9_2/version.h (revision 31776) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 214 +#define RUBY_PATCHLEVEL 215 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 Index: ruby_1_9_2/test/test_pstore.rb =================================================================== --- ruby_1_9_2/test/test_pstore.rb (revision 31775) +++ ruby_1_9_2/test/test_pstore.rb (revision 31776) @@ -100,4 +100,14 @@ File.unlink("pstore.tmp2.#{Process.pid}") rescue nil end end + + def test_nested_transaction_raises_error + assert_raise(PStore::Error) do + @pstore.transaction { @pstore.transaction { } } + end + pstore = PStore.new("pstore.tmp2.#{Process.pid}", true) + assert_raise(PStore::Error) do + pstore.transaction { pstore.transaction { } } + end + end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/