You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by jo...@apache.org on 2010/02/15 19:51:16 UTC
svn commit: r910298 - in /subversion/trunk/subversion/bindings/swig:
include/svn_types.swg ruby/svn/wc.rb ruby/test/test_wc.rb
Author: joeswatosh
Date: Mon Feb 15 18:51:12 2010
New Revision: 910298
URL: http://svn.apache.org/viewvc?rev=910298&view=rev
Log:
First baby-step toward supporting WC-NG APIs in the Ruby Bindings: Provide a
way to create a Context object.
* subversion/bindings/swig/ruby/test/test_wc.rb
(SvnWcTest#test_context_new_default_config,
SvnWcTest#test_context_new_specified_config,
SvnWcTest#test_context_create): New methods.
* subversion/bindings/swig/ruby/svn/wc.rb
(Svn::Wc::Context): New class.
(Svn::Wc::Context.create, Svn::Wc::Context.new,
Svn::Wc::Context#destroy): New methods.
* subversion/bindings/swig/include/svn_types.swg
(OUTPARAM): add svn_wc_context_t for Ruby so it will be wrapped correctly.
(%apply apr_pool_t *pool): add *scratch_pool to the list of known names for
pools for Ruby bindings so it will be wrapped correctly.
Modified:
subversion/trunk/subversion/bindings/swig/include/svn_types.swg
subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb
subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb
Modified: subversion/trunk/subversion/bindings/swig/include/svn_types.swg
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/include/svn_types.swg?rev=910298&r1=910297&r2=910298&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/include/svn_types.swg (original)
+++ subversion/trunk/subversion/bindings/swig/include/svn_types.swg Mon Feb 15 18:51:12 2010
@@ -157,6 +157,10 @@
svn_wc_status_t **,
svn_wc_status2_t **,
svn_wc_committed_queue_t **,
+#ifdef SWIGRUBY
+ /* Only tested for Ruby */
+ svn_wc_context_t **,
+#endif
void **set_locks_baton
};
@@ -592,7 +596,8 @@
apr_pool_t *dir_pool,
apr_pool_t *file_pool,
apr_pool_t *node_pool,
- apr_pool_t *result_pool
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool
};
#endif
Modified: subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb?rev=910298&r1=910297&r2=910298&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb Mon Feb 15 18:51:12 2010
@@ -704,5 +704,50 @@
Wc.process_committed_queue(self, access, new_rev, rev_date, rev_author)
end
end
+
+ Context = SWIG::TYPE_p_svn_wc_context_t
+ # A context is not associated with a particular working copy, but as
+ # operations are performed, will load the appropriate working copy
+ # information.
+ class Context
+ class << self
+
+ # Creates an new instance of Context.
+ #
+ # ==== arguments
+ #
+ # * <tt>:config</tt> <i>(default=>nil)</i> A \
+ # Svn::Core::Config with options that apply to this Context.
+ def new(arguments={})
+ optional_arguments_defaults = { :config => nil }
+ arguments = optional_arguments_defaults.merge(arguments)
+ context = Wc.context_create(arguments[:config])
+ return context
+ end
+
+ # Creates an new instance of Context for use in the block, the context
+ # is destroyed when the block completes.
+ #
+ # ==== arguments
+ #
+ # see new.
+ def create(arguments={})
+ context = new(arguments)
+ begin
+ yield context
+ ensure
+ context.destroy if context
+ end
+ end
+
+ end
+
+ # Destroys the context, releasing any acquired resources.
+ # The context is unavailable for any further operations.
+ def destroy
+ Wc.context_destroy(self)
+ end
+ end
+
end
end
Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb?rev=910298&r1=910297&r2=910298&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb Mon Feb 15 18:51:12 2010
@@ -1073,4 +1073,30 @@
end
end
end
+
+
+ def test_context_new_default_config
+ assert_not_nil context = Svn::Wc::Context.new
+ ensure
+ context.destroy
+ end
+
+ def test_context_new_specified_config
+ config_file = File.join(@config_path, Svn::Core::CONFIG_CATEGORY_CONFIG)
+ config = Svn::Core::Config.read(config_file)
+ assert_not_nil context = Svn::Wc::Context.new(:config=>config)
+ ensure
+ context.destroy
+ end
+
+ def test_context_create
+ assert_nothing_raised do
+ result = Svn::Wc::Context.create do |context|
+ assert_not_nil context
+ assert_kind_of Svn::Wc::Context, context
+ end
+ assert_nil result;
+ end
+ end
+
end
Re: svn commit: r910298 - in /subversion/trunk/subversion/bindings/swig: include/svn_types.swg ruby/svn/wc.rb ruby/test/test_wc.rb
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Feb 15, 2010, at 9:44 PM, Joe Swatosh wrote:
> Hi Hyrum,
>
> On Mon, Feb 15, 2010 at 11:54 AM, Hyrum K. Wright
> <hy...@mail.utexas.edu> wrote:
>> Joe,
>> Great to see this work happening. Be aware that some of the APIs are still moving targets, so some things might break.
>>
>> -Hyrum
>>
>
> With you mentioning elsewhere that a branch could happen as early as
> May, I figured I better get started. Understanding that there are no
> guarantees, would you please point me at the most stable of the 1.7
> moving targets? :-) Or perhaps I should just table until you give me
> a high sign?
Anything with the double underscore (e.g., svn_wc__node_foo()) is considered private, and shouldn't be wrapped, but I presume you knew that. Some of those APIs may be publicized in the future, others may not. Anything which is "New in 1.7" could change, but we've been pretty conservative about what we've put in the public header thus far, so it's more likely that the API surface will grow, rather than existing APIs change. We still reserve that right, though.
The May date is my optimistic if-everybody-pitches-in-and-helps estimate. Please don't read anything more into it than that. :)
> Any hope of getting the Ubuntu buildbot going again?
Um...er...uh...
I've actually been trying to get into the box since Friday. I think something took it down, but due to the long holiday weekend in the US, nobody has been in to fix it. If nothing has happens by this evening, I'll ping the parties responsible. Sorry for the delay.
-Hyrum
Re: svn commit: r910298 - in /subversion/trunk/subversion/bindings/swig:
include/svn_types.swg ruby/svn/wc.rb ruby/test/test_wc.rb
Posted by Joe Swatosh <jo...@gmail.com>.
Hi Hyrum,
On Mon, Feb 15, 2010 at 11:54 AM, Hyrum K. Wright
<hy...@mail.utexas.edu> wrote:
> Joe,
> Great to see this work happening. Be aware that some of the APIs are still moving targets, so some things might break.
>
> -Hyrum
>
With you mentioning elsewhere that a branch could happen as early as
May, I figured I better get started. Understanding that there are no
guarantees, would you please point me at the most stable of the 1.7
moving targets? :-) Or perhaps I should just table until you give me
a high sign?
Any hope of getting the Ubuntu buildbot going again?
Thanks,
--
Joe
Re: svn commit: r910298 - in /subversion/trunk/subversion/bindings/swig: include/svn_types.swg ruby/svn/wc.rb ruby/test/test_wc.rb
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Joe,
Great to see this work happening. Be aware that some of the APIs are still moving targets, so some things might break.
-Hyrum
On Feb 15, 2010, at 12:51 PM, joeswatosh@apache.org wrote:
> Author: joeswatosh
> Date: Mon Feb 15 18:51:12 2010
> New Revision: 910298
>
> URL: http://svn.apache.org/viewvc?rev=910298&view=rev
> Log:
> First baby-step toward supporting WC-NG APIs in the Ruby Bindings: Provide a
> way to create a Context object.
>
> * subversion/bindings/swig/ruby/test/test_wc.rb
> (SvnWcTest#test_context_new_default_config,
> SvnWcTest#test_context_new_specified_config,
> SvnWcTest#test_context_create): New methods.
>
> * subversion/bindings/swig/ruby/svn/wc.rb
> (Svn::Wc::Context): New class.
> (Svn::Wc::Context.create, Svn::Wc::Context.new,
> Svn::Wc::Context#destroy): New methods.
>
> * subversion/bindings/swig/include/svn_types.swg
> (OUTPARAM): add svn_wc_context_t for Ruby so it will be wrapped correctly.
> (%apply apr_pool_t *pool): add *scratch_pool to the list of known names for
> pools for Ruby bindings so it will be wrapped correctly.
>
> Modified:
> subversion/trunk/subversion/bindings/swig/include/svn_types.swg
> subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb
> subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb
>
> Modified: subversion/trunk/subversion/bindings/swig/include/svn_types.swg
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/include/svn_types.swg?rev=910298&r1=910297&r2=910298&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/swig/include/svn_types.swg (original)
> +++ subversion/trunk/subversion/bindings/swig/include/svn_types.swg Mon Feb 15 18:51:12 2010
> @@ -157,6 +157,10 @@
> svn_wc_status_t **,
> svn_wc_status2_t **,
> svn_wc_committed_queue_t **,
> +#ifdef SWIGRUBY
> + /* Only tested for Ruby */
> + svn_wc_context_t **,
> +#endif
> void **set_locks_baton
> };
>
> @@ -592,7 +596,8 @@
> apr_pool_t *dir_pool,
> apr_pool_t *file_pool,
> apr_pool_t *node_pool,
> - apr_pool_t *result_pool
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool
> };
> #endif
>
>
> Modified: subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb?rev=910298&r1=910297&r2=910298&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb (original)
> +++ subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb Mon Feb 15 18:51:12 2010
> @@ -704,5 +704,50 @@
> Wc.process_committed_queue(self, access, new_rev, rev_date, rev_author)
> end
> end
> +
> + Context = SWIG::TYPE_p_svn_wc_context_t
> + # A context is not associated with a particular working copy, but as
> + # operations are performed, will load the appropriate working copy
> + # information.
> + class Context
> + class << self
> +
> + # Creates an new instance of Context.
> + #
> + # ==== arguments
> + #
> + # * <tt>:config</tt> <i>(default=>nil)</i> A \
> + # Svn::Core::Config with options that apply to this Context.
> + def new(arguments={})
> + optional_arguments_defaults = { :config => nil }
> + arguments = optional_arguments_defaults.merge(arguments)
> + context = Wc.context_create(arguments[:config])
> + return context
> + end
> +
> + # Creates an new instance of Context for use in the block, the context
> + # is destroyed when the block completes.
> + #
> + # ==== arguments
> + #
> + # see new.
> + def create(arguments={})
> + context = new(arguments)
> + begin
> + yield context
> + ensure
> + context.destroy if context
> + end
> + end
> +
> + end
> +
> + # Destroys the context, releasing any acquired resources.
> + # The context is unavailable for any further operations.
> + def destroy
> + Wc.context_destroy(self)
> + end
> + end
> +
> end
> end
>
> Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb?rev=910298&r1=910297&r2=910298&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb (original)
> +++ subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb Mon Feb 15 18:51:12 2010
> @@ -1073,4 +1073,30 @@
> end
> end
> end
> +
> +
> + def test_context_new_default_config
> + assert_not_nil context = Svn::Wc::Context.new
> + ensure
> + context.destroy
> + end
> +
> + def test_context_new_specified_config
> + config_file = File.join(@config_path, Svn::Core::CONFIG_CATEGORY_CONFIG)
> + config = Svn::Core::Config.read(config_file)
> + assert_not_nil context = Svn::Wc::Context.new(:config=>config)
> + ensure
> + context.destroy
> + end
> +
> + def test_context_create
> + assert_nothing_raised do
> + result = Svn::Wc::Context.create do |context|
> + assert_not_nil context
> + assert_kind_of Svn::Wc::Context, context
> + end
> + assert_nil result;
> + end
> + end
> +
> end
>
>
Re: svn commit: r910298 - in /subversion/trunk/subversion/bindings/swig: include/svn_types.swg ruby/svn/wc.rb ruby/test/test_wc.rb
Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Joe,
Great to see this work happening. Be aware that some of the APIs are still moving targets, so some things might break.
-Hyrum
On Feb 15, 2010, at 12:51 PM, joeswatosh@apache.org wrote:
> Author: joeswatosh
> Date: Mon Feb 15 18:51:12 2010
> New Revision: 910298
>
> URL: http://svn.apache.org/viewvc?rev=910298&view=rev
> Log:
> First baby-step toward supporting WC-NG APIs in the Ruby Bindings: Provide a
> way to create a Context object.
>
> * subversion/bindings/swig/ruby/test/test_wc.rb
> (SvnWcTest#test_context_new_default_config,
> SvnWcTest#test_context_new_specified_config,
> SvnWcTest#test_context_create): New methods.
>
> * subversion/bindings/swig/ruby/svn/wc.rb
> (Svn::Wc::Context): New class.
> (Svn::Wc::Context.create, Svn::Wc::Context.new,
> Svn::Wc::Context#destroy): New methods.
>
> * subversion/bindings/swig/include/svn_types.swg
> (OUTPARAM): add svn_wc_context_t for Ruby so it will be wrapped correctly.
> (%apply apr_pool_t *pool): add *scratch_pool to the list of known names for
> pools for Ruby bindings so it will be wrapped correctly.
>
> Modified:
> subversion/trunk/subversion/bindings/swig/include/svn_types.swg
> subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb
> subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb
>
> Modified: subversion/trunk/subversion/bindings/swig/include/svn_types.swg
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/include/svn_types.swg?rev=910298&r1=910297&r2=910298&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/swig/include/svn_types.swg (original)
> +++ subversion/trunk/subversion/bindings/swig/include/svn_types.swg Mon Feb 15 18:51:12 2010
> @@ -157,6 +157,10 @@
> svn_wc_status_t **,
> svn_wc_status2_t **,
> svn_wc_committed_queue_t **,
> +#ifdef SWIGRUBY
> + /* Only tested for Ruby */
> + svn_wc_context_t **,
> +#endif
> void **set_locks_baton
> };
>
> @@ -592,7 +596,8 @@
> apr_pool_t *dir_pool,
> apr_pool_t *file_pool,
> apr_pool_t *node_pool,
> - apr_pool_t *result_pool
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool
> };
> #endif
>
>
> Modified: subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb?rev=910298&r1=910297&r2=910298&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb (original)
> +++ subversion/trunk/subversion/bindings/swig/ruby/svn/wc.rb Mon Feb 15 18:51:12 2010
> @@ -704,5 +704,50 @@
> Wc.process_committed_queue(self, access, new_rev, rev_date, rev_author)
> end
> end
> +
> + Context = SWIG::TYPE_p_svn_wc_context_t
> + # A context is not associated with a particular working copy, but as
> + # operations are performed, will load the appropriate working copy
> + # information.
> + class Context
> + class << self
> +
> + # Creates an new instance of Context.
> + #
> + # ==== arguments
> + #
> + # * <tt>:config</tt> <i>(default=>nil)</i> A \
> + # Svn::Core::Config with options that apply to this Context.
> + def new(arguments={})
> + optional_arguments_defaults = { :config => nil }
> + arguments = optional_arguments_defaults.merge(arguments)
> + context = Wc.context_create(arguments[:config])
> + return context
> + end
> +
> + # Creates an new instance of Context for use in the block, the context
> + # is destroyed when the block completes.
> + #
> + # ==== arguments
> + #
> + # see new.
> + def create(arguments={})
> + context = new(arguments)
> + begin
> + yield context
> + ensure
> + context.destroy if context
> + end
> + end
> +
> + end
> +
> + # Destroys the context, releasing any acquired resources.
> + # The context is unavailable for any further operations.
> + def destroy
> + Wc.context_destroy(self)
> + end
> + end
> +
> end
> end
>
> Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb?rev=910298&r1=910297&r2=910298&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb (original)
> +++ subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb Mon Feb 15 18:51:12 2010
> @@ -1073,4 +1073,30 @@
> end
> end
> end
> +
> +
> + def test_context_new_default_config
> + assert_not_nil context = Svn::Wc::Context.new
> + ensure
> + context.destroy
> + end
> +
> + def test_context_new_specified_config
> + config_file = File.join(@config_path, Svn::Core::CONFIG_CATEGORY_CONFIG)
> + config = Svn::Core::Config.read(config_file)
> + assert_not_nil context = Svn::Wc::Context.new(:config=>config)
> + ensure
> + context.destroy
> + end
> +
> + def test_context_create
> + assert_nothing_raised do
> + result = Svn::Wc::Context.create do |context|
> + assert_not_nil context
> + assert_kind_of Svn::Wc::Context, context
> + end
> + assert_nil result;
> + end
> + end
> +
> end
>
>