Added post-commit hook scripts to automatically set a review request as submitted. (hg and svn)

Review Request #8097 — Created April 3, 2016 and updated

evanhunzinger
RBTools
master
rbtools
Added `incoming` for hg repositories to automatically set a review request as submitted.


Description From Last Updated

'get_review_request_id' imported but unused

reviewbotreviewbot

Col: 39 W292 no newline at end of file

reviewbotreviewbot

Needs to import unicode_literals from __future__.

brenniebrennie

Please format this as: from rbtools.hooks.common import (close_review_request, initialize_logging, get_review_request_id)

brenniebrennie

Missing docstring

brenniebrennie

%-formatting is more efficient than string concatentation. Also, please format as: print('No matching review request ID found for changeset %s' ...

brenniebrennie

This needs to import unicode_literals from __future__

brenniebrennie

Needs args and returns.

brenniebrennie

Col: 5 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 5 W191 indentation contains tabs

reviewbotreviewbot

Col: 5 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 5 W191 indentation contains tabs

reviewbotreviewbot

Col: 5 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 5 W191 indentation contains tabs

reviewbotreviewbot

Col: 5 E101 indentation contains mixed spaces and tabs

reviewbotreviewbot

Col: 5 W191 indentation contains tabs

reviewbotreviewbot

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot

Col: 1 W391 blank line at end of file

reviewbotreviewbot

Docstrings should be of the format: """Single line summary. Optional multi-line description. """

brenniebrennie

Docstrings should be of the format: """Single line summary. Optional multi-line description. """

brenniebrennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
  2. rbtools/hooks/mercurial.py (Diff revision 1)
     
     
     'get_review_request_id' imported but unused
    
  3. rbtools/hooks/mercurial.py (Diff revision 1)
     
     
    Col: 39
     W292 no newline at end of file
    
  4. 
      
EV
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
  2. 
      
brennie
  1. 
      
  2. contrib/tools/hg-hook-set-submitted (Diff revision 2)
     
     

    Needs to import unicode_literals from __future__.

  3. contrib/tools/hg-hook-set-submitted (Diff revision 2)
     
     
     

    Please format this as:

    from rbtools.hooks.common import (close_review_request, initialize_logging,
                                      get_review_request_id)
    
  4. contrib/tools/hg-hook-set-submitted (Diff revision 2)
     
     

    Missing docstring

  5. contrib/tools/hg-hook-set-submitted (Diff revision 2)
     
     
     

    %-formatting is more efficient than string concatentation.

    Also, please format as:

    print('No matching review request ID found for changeset %s'
          % changeset_id)
    
  6. rbtools/hooks/mercurial.py (Diff revision 2)
     
     

    This needs to import unicode_literals from __future__

  7. rbtools/hooks/mercurial.py (Diff revision 2)
     
     

    Needs args and returns.

  8. 
      
EV
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
  2. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     E101 indentation contains mixed spaces and tabs
    
  3. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     W191 indentation contains tabs
    
  4. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     E101 indentation contains mixed spaces and tabs
    
  5. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     W191 indentation contains tabs
    
  6. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     E101 indentation contains mixed spaces and tabs
    
  7. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     W191 indentation contains tabs
    
  8. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     E101 indentation contains mixed spaces and tabs
    
  9. rbtools/hooks/mercurial.py (Diff revision 3)
     
     
    Col: 5
     W191 indentation contains tabs
    
  10. 
      
EV
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
    
    
  2. 
      
EV
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/hooks/svn.py
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
        contrib/tools/svn-hook-set-submitted
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/hooks/svn.py
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
        contrib/tools/svn-hook-set-submitted
    
    
  2. rbtools/hooks/svn.py (Diff revision 5)
     
     
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. rbtools/hooks/svn.py (Diff revision 5)
     
     
    Col: 1
     W391 blank line at end of file
    
  4. 
      
EV
Review request changed
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/hooks/svn.py
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
        contrib/tools/svn-hook-set-submitted
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/hooks/svn.py
        rbtools/hooks/mercurial.py
    
    Ignored Files:
        contrib/tools/hg-hook-set-submitted
        contrib/tools/svn-hook-set-submitted
    
    
  2. 
      
EV
  1. 
      
  2. rbtools/hooks/svn.py (Diff revision 6)
     
     
     

    I'm wondering how others feel about this solution, I wasn't able to find a command that could extract just the commit message, and svn log includes a bunch of information I didn't want to try to parse through. So I found out there's a way to extract the log as a string of xml, and then I made a regex expression to help extract the commit message from that string.

    1. The best way to do this would be to use xml.etree.ElementTree to parse the result of svn log --xml for the commit and parse the message out of that. It will be much more robust. The svn client has some examples of using ElementTree, but the Python docs have even more.

  3. 
      
brennie
  1. You'll want to update your description to indicate this is for both hg and svn. Also, could you include how you tested this?

  2. contrib/tools/hg-hook-set-submitted (Diff revision 6)
     
     

    Docstrings should be of the format:

    """Single line summary.
    
    Optional multi-line description.
    """
    
  3. contrib/tools/svn-hook-set-submitted (Diff revision 6)
     
     
     

    Docstrings should be of the format:

    """Single line summary.
    
    Optional multi-line description.
    """
    
  4. 
      
YU
  1. 
      
  2. How to User this?

    1. This isn't a discussion forum, and not a good place to ask for help, as it complicates our development. Please use https://groups.google.com/group/reviewboard/ instead.

  3. 
      
Loading...