• 
      

    Add javascript for a new pre-commit review request creation UI.

    Review Request #4391 — Created Aug. 5, 2013 and submitted

    Information

    Review Board
    master

    Reviewers

    Add javascript for a new pre-commit review request creation UI.
    
    This change adds a model and view for pre-commit review request creation. This
    replaces the old form-based UI with one which is more interactive, and does a
    lot more checking and guidance.
    
    The basic workflow is that users are asked first to select their diff file,
    either through a file picker or drag-and-drop. For the most basic case, this is
    all that's required--the frontend will test that the diff is valid (parses +
    upstream files exist) and create the review request.
    
    In the case of perforce, the user will be prompted for a change number. In the
    case of SVN, the user will be prompted for a basedir. At the moment, this does
    not do parent diffs. I'm kind of conflicted about whether or not we should add
    it, since it does complicate things pretty significantly. My instinct here is to
    say no for now and defer people to the command-line tools if they want something
    fancy.
    
    This is massively improved in the case where a user tries to upload a git diff
    that was generated with partial SHAs--we'll detect that case and ask the user to
    use --full-index.
    - Created lots of different review requests for SVN and Git.
    - Tested various error conditions (wrong basedir, partial shas, badly formatted
      diff, etc).
    - Ran jshint.

    Description From Last Updated

    Model has a clear() function that resets back to defaults. That would do the equivalent of this function.

    chipx86chipx86

    Any reason to compare explicitly?

    chipx86chipx86

    This should take a context parameter, so you wouldn't need to use self.

    chipx86chipx86

    Blank line after vars.

    chipx86chipx86

    Blank line after vars.

    chipx86chipx86

    Blank line after vars.

    chipx86chipx86
    reviewbot
    1. This is a review from Review Bot.
        Tool: PEP8 Style Checker
        Processed Files:
          reviewboard/settings.py
        Ignored Files:
          reviewboard/static/rb/js/newReviewRequest/models/preCommitModel.js
          reviewboard/static/rb/js/newReviewRequest/views/preCommitView.js
          reviewboard/static/rb/js/resources/models/repositoryModel.js
      
      
    2. 
        
    reviewbot
    1. This is a review from Review Bot.
        Tool: Pyflakes
        Processed Files:
          reviewboard/settings.py
        Ignored Files:
          reviewboard/static/rb/js/newReviewRequest/models/preCommitModel.js
          reviewboard/static/rb/js/newReviewRequest/views/preCommitView.js
          reviewboard/static/rb/js/resources/models/repositoryModel.js
      
      
    2. 
        
    chipx86
    1. 
        
    2. Show all issues
      Model has a clear() function that resets back to defaults. That would do the equivalent of this function.
      1. It's not quite the same--I don't want to clear the repository or id.
      2. Ah, fair enough.
    3. Show all issues
      Any reason to compare explicitly?
    4. Show all issues
      This should take a context parameter, so you wouldn't need to use self.
      1. Model.save() doesn't have a context parameter.
      2. Model.save() doesn't, but BaseResource.save() extends it to have one.
    5. Show all issues
      Blank line after vars.
    6. Show all issues
      Blank line after vars.
    7. Show all issues
      Blank line after vars.
    8. 
        
    david
    reviewbot
    1. This is a review from Review Bot.
        Tool: PEP8 Style Checker
        Processed Files:
          reviewboard/settings.py
        Ignored Files:
          reviewboard/static/rb/js/newReviewRequest/models/preCommitModel.js
          reviewboard/static/rb/js/newReviewRequest/views/preCommitView.js
          reviewboard/static/rb/js/resources/models/repositoryModel.js
      
      
    2. 
        
    reviewbot
    1. This is a review from Review Bot.
        Tool: Pyflakes
        Processed Files:
          reviewboard/settings.py
        Ignored Files:
          reviewboard/static/rb/js/newReviewRequest/models/preCommitModel.js
          reviewboard/static/rb/js/newReviewRequest/views/preCommitView.js
          reviewboard/static/rb/js/resources/models/repositoryModel.js
      
      
    2. 
        
    david
    reviewbot
    1. This is a review from Review Bot.
        Tool: PEP8 Style Checker
        Processed Files:
          reviewboard/settings.py
        Ignored Files:
          reviewboard/static/rb/js/newReviewRequest/models/preCommitModel.js
          reviewboard/static/rb/js/newReviewRequest/views/preCommitView.js
          reviewboard/static/rb/js/resources/models/repositoryModel.js
      
      
    2. 
        
    reviewbot
    1. This is a review from Review Bot.
        Tool: Pyflakes
        Processed Files:
          reviewboard/settings.py
        Ignored Files:
          reviewboard/static/rb/js/newReviewRequest/models/preCommitModel.js
          reviewboard/static/rb/js/newReviewRequest/views/preCommitView.js
          reviewboard/static/rb/js/resources/models/repositoryModel.js
      
      
    2. 
        
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to master (5ef6aa2).