<?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>45838</bug_id>
          
          <creation_ts>2010-09-15 14:39:55 -0700</creation_ts>
          <short_desc>Command.tool should not need to be a WebKitPatch subclass</short_desc>
          <delta_ts>2010-11-04 15:10:19 -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>OS X 10.5</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="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>dpranke</cc>
    
    <cc>mihaip</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>279736</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-09-15 14:39:55 -0700</bug_when>
    <thetext>Command.tool should not need to be a WebKitPatch subclass

We need to break out a Tool subclass of WebKitPatch so that all the various commands which assume they have a self.tool.bugs, self.tool.scm, etc. can be run using something other than webkit-patch.

This should mostly just be moving code.  Adam started a patch to do this eons ago.

The end goal is to make it simple to create a new Tool, multi-command style or not.

For example, the following should be possible:

class MyTool(MultiCommandTool, Tool):
   pass

if __name__ == &quot;__main__&quot;:
    MyTool().main()


We&apos;d probably need to teach it things about what directory to search for commands in, or how to give it a specific set of commands.  We also eventually want to make it easy to create single-command tools.  The MultiCommandTool argument-parsing and command calling logic should just be a mix-in.  Tool is all the data storage.

Command.tool needs to be a &quot;Tool&quot; but does not need to be a MultiCommandTool.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>279843</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-09-15 17:19:48 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; We need to break out a Tool subclass of WebKitPatch so that all the various commands which assume they have a self.tool.bugs, self.tool.scm, etc. can be run using something other than webkit-patch.

I actually meant &quot;Steps&quot; not Commands. I don&apos;t expect other tools will re-use webkit-patch Command objects, but they could.  Having a self.tool is pretty central to how the webkitpy command infrastructure works though.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>