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

[PATCH] Add a new method, Svn::Core::LogChangedPath#copied? for the SWIG/Ruby bindings.

From: Kobayashi Noritada <nori1_at_dolphin.c.u-tokyo.ac.jp>
Date: 2006-06-12 07:48:18 CEST

Hi,

Here is a patch to add a new method, Svn::Core::LogChangedPath#copied?
implemented with Svn::Util.copy?.
Currently in the SWIG/Ruby bindings, although Svn::Core::LogChangedPath has
instance methods 'copyfrom_path' and 'copyfrom_rev' to know which path and
which revision the copy was taken from, it does not seem to have methods
determining whether the path was copied or not.
I know anyone can do determine by using copyfrom_path and copyfrom_rev, but
it is better for API to have a method to do so.
Fortunately, I find Svn::Util.copy? exactly does the determination.

Please review it and its way of naming.
# Which is better, 'copy?' or 'copied?'? ;-)

Thanks,

-nori

[[[
* subversion/bindings/swig/ruby/svn/core.rb
  (Svn::Core::LogChangedPath#copied?): A new method for determining whether
  the path was copied or not.
]]]

Index: subversion/bindings/swig/ruby/svn/core.rb
===================================================================
--- subversion/bindings/swig/ruby/svn/core.rb (revision 20043)
+++ subversion/bindings/swig/ruby/svn/core.rb (working copy)
@@ -456,5 +456,11 @@
         __date && Time.from_svn_format(__date)
       end
     end
+
+ class LogChangedPath
+ def copied?
+ Util.copy?(copyfrom_path, copyfrom_rev)
+ end
+ end
   end
 end

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jun 12 07:48:44 2006

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