<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>38388</bug_id>
          
          <creation_ts>2010-04-30 06:22:19 -0700</creation_ts>
          <short_desc>svn-apply: merge its implementation with svn-unapply</short_desc>
          <delta_ts>2010-05-03 15:48:23 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Zoltan Horvath">zoltan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cjerdonek</cc>
    
    <cc>dbates</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>219462</commentid>
    <comment_count>0</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2010-04-30 06:22:19 -0700</bug_when>
    <thetext>Merge svn-apply and svn-unapply into one file, since these define nearly the same methods.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219503</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-04-30 09:21:04 -0700</bug_when>
    <thetext>Another approach that can be taken in conjunction with this approach is to move/refactor methods defined in both files to a third location.  The third location can be VCSUtils.pm or a new library file in webkitperl/ named something like svnApplyUtils.pm.  I started doing this myself here, for instance:

http://trac.webkit.org/changeset/52692 

Question: are you suggesting that, in the end, svn-unapply should be invoked by calling svn-apply (e.g. by passing a -R/--reverse flag)?  That sounds good.  If so, svn-unapply could be a wrapper for svn-apply until the callers are modified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219505</commentid>
    <comment_count>2</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2010-04-30 09:33:01 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Another approach that can be taken in conjunction with this approach is to
&gt; move/refactor methods defined in both files to a third location.  The third
&gt; location can be VCSUtils.pm or a new library file in webkitperl/ named
&gt; something like svnApplyUtils.pm.  I started doing this myself here, for
&gt; instance:
&gt; 
&gt; http://trac.webkit.org/changeset/52692 

If we follow this direction the unit-testing can be more precise not by testing the whole file(s), but subroutines directly. If the merged functions can be used in other files I like the idea to put it into VCSUtils, if not, separated file would be better.

&gt; Question: are you suggesting that, in the end, svn-unapply should be invoked by
&gt; calling svn-apply (e.g. by passing a -R/--reverse flag)?  That sounds good.  If
&gt; so, svn-unapply could be a wrapper for svn-apply until the callers are
&gt; modified.

Yes. I was thinking on the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219508</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-04-30 09:45:11 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; Another approach that can be taken in conjunction with this approach is to
&gt; &gt; move/refactor methods defined in both files to a third location.
&gt; 
&gt; If we follow this direction the unit-testing can be more precise not by testing
&gt; the whole file(s), but subroutines directly.

We can still do this either way.  For example, if you look at VCSUtils_unittest/, you will see that it contains unit tests for individual subroutines defined in VCSUtils.pm.

In the end, perhaps svn-apply can have a top-level &quot;main()&quot; method.  Then if one wants to go the route of testing the whole file, testing that single subroutine is almost as good from a code coverage standpoint as testing the &quot;whole file&quot;.  It won&apos;t be as necessary to test the script by invoking it as a script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>219736</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2010-05-01 11:55:41 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Question: are you suggesting that, in the end, svn-unapply should be invoked by
&gt; calling svn-apply (e.g. by passing a -R/--reverse flag)?  That sounds good.  If
&gt; so, svn-unapply could be a wrapper for svn-apply until the callers are
&gt; modified.

Please don&apos;t remove the ability to call svn-apply and svn-unapply.  I have been happily using these scripts for many years and really don&apos;t want to change my habits.  Merging the implementations sounds fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>220339</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Jerdonek">cjerdonek</who>
    <bug_when>2010-05-03 15:46:53 -0700</bug_when>
    <thetext>Retitling with &quot;svn-apply&quot; at the beginning of the title.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>