Merge and port master to api, and refactor

Review Request #3738 — Created Jan. 10, 2013 and submitted

Information

RBTools
api

Reviewers

Merged master into api and ported recent changes to the new commands.
I also started the process of refactoring things a bit:

Port capabilities to rbt post

rbt post will now download and use capabilities when generating
diffs. Diffs generated by git may now use -M.


Refactor rbt post to use common code

Removed a lot of the repeated code rbt post was using which had been
moved into the Command base class. Also stopped creating some of the
variables on self, and instead passed them into the methods which need
them.


Port capabilities to rbt diff

rbt diff will now use the new capabilities change when generating
diffs. This adds moved file detection to git diffs.

The python API bindings were also modified to allow accessing resource
fields using the '[]' operator. Now fields may be accessed either by
attribute (e.g. 'resource.<field_name>') or using the '[]' operator
(e.g. 'resource["<field_name>"]').

Adding '[]' operator access made porting the capabilities change while
maintaining compatibility with post-review much cleaner.


Port 494a21d145 from post-review to rbt post

Port 85f43d522e from post-review to rbt post
Generated diffs and observed proper capabilities behaviour.
Posted review requests using rbt post.
Description From Last Updated

Not part of this change, but I noticed the indentation was wrong here.

chipx86chipx86

It'd be nice to do this only in one place. Currently, each tool that needs to provide this is at …

chipx86chipx86

Can we just enforce that every SCMClient has this function (defaulting to raising NotImplementedException)? Then this check can go away, …

chipx86chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/post.py
        rbtools/api/transport/sync.py
        rbtools/commands/__init__.py
        rbtools/commands/diff.py
      Ignored Files:
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/api/transport/sync.py (Diff revision 1)
     
     
     
    Show all issues
    Not part of this change, but I noticed the indentation was wrong here.
  3. rbtools/commands/post.py (Diff revision 1)
     
     
    Show all issues
    It'd be nice to do this only in one place. Currently, each tool that needs to provide this is at some point duplicating this.
  4. rbtools/commands/post.py (Diff revision 1)
     
     
     
     
    Show all issues
    Can we just enforce that every SCMClient has this function (defaulting to raising NotImplementedException)? Then this check can go away, and the call to sanitize_changenum can be moved inline to the call to get_changenum above.
    
    (Another thing we should look into is whether we need the two separate functions, or if get_changenum can just do the sanitizing work.)
    1. Yeah we probably don't need two function calls here,
      get_changenum could just do the sanitizing, or even
      call sanitize_changenum before returning.
      
      I'll leave this as two calls for now though, until
      we've gutted post-review. I've added a TODO to
      remind me.
  5. 
      
SM
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/api/transport/sync.py
        rbtools/clients/__init__.py
        rbtools/commands/post.py
        rbtools/commands/__init__.py
        rbtools/commands/diff.py
      Ignored Files:
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
SM
Review request changed
Status:
Completed
Change Summary:
Pushed to api 
(2f8044109d023925506cfe94c3d7cb25c1091500
2e7593e8677ffc8735f6f02cc0b8bd7541fe10c3
ec9b58b246bf2253ebdfccfeb79ee5f72dbc39de
b26eb87e2196e72f9c6442c8da44e11ec6e5da8f
c8fa222a902abc624f4840b31b14200c63eb77c4
a29426a8f4036d04b0bb6bbbcaf6e33ef524fb85
02975ef6ed4dc6d917ba752584cf62211553da2d).