Update the "change" field with submitted perforce changesets.

Review Request #6512 — Created Oct. 27, 2014 and submitted

Information

Review Board
release-2.0.x
84d1d68...

Reviewers

When a perforce changeset is submitted, it will often be given a new number in
order to ensure that changeset IDs are monotonically increasing. One
long-standing request we've had is to update the 'change' field on review
requests when this happens.

Without a hook on the SCM side, we don't have any notification that a changeset
was submitted, but it turns out that we do already query the perforce server to
determine whether or not to display "(pending)" next to the change number. This
change adds some logic to find whether or not the change number was updated,
and if so, store the new value. As part of this, we also now cache the
information on whether a changeset is pending or not.

I've also removed the now-unused get_pending_changesets() method.

Created and submitted several perforce changesets, and saw that the 'commit_id'
field on both the review request and any drafts was updated properly when the
page was reloaded after submitting the change. Verified that caching is working
as expected.

Ran unit tests.

Description From Last Updated

Swap these.

chipx86chipx86

These params should go on the next line.

chipx86chipx86

Alphabetical order.

chipx86chipx86

""" on next line.

chipx86chipx86
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/scmtools/tests.py
        reviewboard/scmtools/perforce.py
        reviewboard/scmtools/core.py
        reviewboard/reviews/models/review_request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/reviews/builtin_fields.py
        reviewboard/scmtools/tests.py
        reviewboard/scmtools/perforce.py
        reviewboard/scmtools/core.py
        reviewboard/reviews/models/review_request.py
    
    
  2. 
      
chipx86
  1. Can we add some unit tests to handle the change number changing?

  2. reviewboard/scmtools/perforce.py (Diff revision 1)
     
     
     
    Show all issues

    Swap these.

  3. reviewboard/scmtools/perforce.py (Diff revision 1)
     
     
    Show all issues

    These params should go on the next line.

  4. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        reviewboard/scmtools/tests.py
        reviewboard/reviews/tests.py
        reviewboard/scmtools/core.py
        reviewboard/scmtools/perforce.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/models/review_request.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/scmtools/tests.py
        reviewboard/reviews/tests.py
        reviewboard/scmtools/core.py
        reviewboard/scmtools/perforce.py
        reviewboard/reviews/builtin_fields.py
        reviewboard/reviews/models/review_request.py
    
    
  2. 
      
chipx86
  1. Just two trivial things.

  2. reviewboard/reviews/tests.py (Diff revision 2)
     
     
    Show all issues

    Alphabetical order.

  3. reviewboard/reviews/tests.py (Diff revision 2)
     
     
    Show all issues

    """ on next line.

  4. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (27f3ccc)
Loading...