[WIP] Add support for multi-commit review requests.

Review Request #6618 — Created Nov. 21, 2014 and discarded

Information

Review Board
master

Reviewers

Add the a diffviewer.Commit model. Each Commit belongs to a
DiffSet (which may have many commits) and may have many FileDiffs.
However, an old-fashioned review request (of squashed changes) will
not have any Commits associated with it.

Add a foreign key on the FileDiff model which links it to a
Commit. Every FileDiff still corresponds to a DiffSet, but they
now can optionally correspond to a Commit.

Add a RelationCounterField on the DiffSet model to keep track of
the number of Commits corresponding to the DiffSet. This way, the
DiffSet can easily be checked if it is a multi-commit review request
or not.

Add evolution (new_commit_fields.py) for new fields on FileDiff
and DiffSet.

TODO:
- Add an API endpoint so that multiple commits can be attached a review
request


 
Description From Last Updated

Col: 38 W292 no newline at end of file

reviewbotreviewbot

Two blank lines.

chipx86chipx86

We use whatever_count instead of num_whatevers for all other counter fields, so we should stick with that for this one.

chipx86chipx86

We usually swap this around to be named like COMMIT_TYPE_MERGE and COMMIT_TYPE_CHANGE.

chipx86chipx86

There are some crucial differences between how TEXT (TextField) and VARCHAR(x) (CharField(max_length=x)) columns are stored. If we ever want to …

chipx86chipx86

This should take a choices= argument that limits it to one of the commit types. It helps with validation and …

chipx86chipx86

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
  2. reviewboard/diffviewer/models.py (Diff revision 1)
     
     
    Show all issues
    Col: 38
     W292 no newline at end of file
    
  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    Two blank lines.

  3. reviewboard/diffviewer/models.py (Diff revision 2)
     
     
    Show all issues

    We use whatever_count instead of num_whatevers for all other counter fields, so we should stick with that for this one.

  4. reviewboard/diffviewer/models.py (Diff revision 2)
     
     
     
    Show all issues

    We usually swap this around to be named like COMMIT_TYPE_MERGE and COMMIT_TYPE_CHANGE.

  5. reviewboard/diffviewer/models.py (Diff revision 2)
     
     
     
    Show all issues

    There are some crucial differences between how TEXT (TextField) and VARCHAR(x) (CharField(max_length=x)) columns are stored. If we ever want to do any queries on authors or committers (I can see us wanting to do that), then we're going to want to use a CharField for performance.

    I think it's safe to say that an author or committer will always be a reasonable size (< 256 chars, probably < 128 chars). Given that, I think we can use a CharField here.

  6. reviewboard/diffviewer/models.py (Diff revision 2)
     
     
    Show all issues

    This should take a choices= argument that limits it to one of the commit types. It helps with validation and display in the admin UI.

  7. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/diffviewer/evolutions/__init__.py
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/diffviewer/evolutions/__init__.py
        reviewboard/webapi/resources/commit.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/diffviewer/models.py
        reviewboard/diffviewer/evolutions/add_commit_fields.py
        reviewboard/webapi/resources/__init__.py
        reviewboard/diffviewer/evolutions/__init__.py
        reviewboard/webapi/resources/commit.py
    
    
  2. reviewboard/webapi/resources/commit.py (Diff revision 6)
     
     
    Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. 
      
brennie
Review request changed
Status:
Discarded