[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Ruby bindings follow on to r26229

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2007-08-23 13:27:10 CEST

Hi,

In <ae6cb1100708222252i7ff49919wbb91ae3d35527506@mail.gmail.com>
  "[PATCH] Ruby bindings follow on to r26229" on Wed, 22 Aug 2007 22:52:09 -0700,
  "Joe Swatosh" <joe.swatosh@gmail.com> wrote:

> [[[
> Follow on to r26229 which added support for non-inheritable
> mergeinfo revision ranges.
>
> * subversion\bindings\swig\core.i
> (svn_swig_rb_mergeinfo_merge and svn_swig_rb_rangelist_merge)
> added new svn_merge_range_inheritance_t argument and forwarded to
> svn_mergeinfo_merge and svn_rangelist_merge respectively
>
> * subversion\bindings\swig\ruby\svn\core.rb
> (Svn::Core::MergeInfo#diff, Svn::Core::MergeInfo#merge,
> Svn::Core::RangeList#diff, Svn::Core::RangeList#merge,
> Svn::Core::RangeList#remove) each got a new argument consider_inheritance
> which is defaulted to RANGELIST_IGNORE_INHERITANCE.
>
> * subversion\bindings\swig\ruby\test\test_core.rb
> (SvnCoreTest#test_merge_info_to_s) now has to include the 'non-inheritable'
> suffix.
> ]]]

> Index: subversion/bindings/swig/ruby/svn/core.rb
> ===================================================================
> --- subversion/bindings/swig/ruby/svn/core.rb (revision 26229)
> +++ subversion/bindings/swig/ruby/svn/core.rb (working copy)
> @@ -624,14 +624,16 @@
> end
> end
>
> - def diff(to)
> - Core.mergeinfo_diff(self, to).collect do |result|
> + def diff(to, consider_inheritance=nil)
> + consider_inheritance ||= RANGELIST_IGNORE_INHERITANCE
> + Core.mergeinfo_diff(self, to, consider_inheritance).collect do |result|

I think we can use svn_depth_t like approach: We can set
default value by SWIG not Ruby. %typemap(in) svn_depth_t
typemap in include/svn_types.swg will help you.

In the feature, I want to support another way to specify
constant value. Currently, we use SOME_CONSTANT
(e.g. RANGELIST_IGNORE_INHERITANCE) to specify constant
value but I want to support :constant_name
(e.g. :inheritance). I think we can do this in SWIG layer.

> Index: subversion/bindings/swig/ruby/test/test_core.rb
> ===================================================================
> --- subversion/bindings/swig/ruby/test/test_core.rb (revision 26229)
> +++ subversion/bindings/swig/ruby/test/test_core.rb (working copy)
> @@ -746,7 +746,7 @@
>
> def test_merge_info_to_s
> info = Svn::Core::MergeInfo.parse("/trunk: 5,7,9-13")
> - assert_equal("/trunk:5,7,9-13", info.to_s)
> + assert_equal("/trunk:5*,7*,9-13*", info.to_s)
> assert_not_equal("/trunk:5,7,9-13", info.inspect)

Does we need to update the above assert_not_equal line too?

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 23 13:24:45 2007

This is an archived mail posted to the Subversion Dev mailing list.