Fix display of revision if there is a parent diff.

Review Request #2094 — Created Jan. 31, 2011 and discarded

Information

Review Board

Reviewers

Fix display of revision if there is a parent diff.

This is achieved by extending FileDiff by a field 'diff_revision' that stores the revision the user's patch is actually based on.
Post and update diff for hg.
Post and update diff for cvs.
chipx86
  1. This look pretty good.
    
    We also need to update FileDiffResource in reviewboard/webapi/resources.py. fields = {} should contain the 'diff_revision', and 'source_revision' should be updated to be closer to the help text below, so it's clear what this field is really used for.
  2. We should also add an SQLMutation in order to populate existing models with diff_revision to be source_revision. That way, it won't appear blank.
    
    You should be able to do something like:
    
    SQLMutation('populate_diff_revision', ["""
        UPDATE diffviewer_filediff
           SET diff_revision = source_revision
         WHERE source_revision == ''
    """])
    
    Might have to test to make sure that works properly (with a dummy database, of course -- I hope you're using that)
    
    This also means that you'll need to probably wipe your current dummy database in order to get this evolution to re-apply.
  3. reviewboard/diffviewer/models.py (Diff revision 1)
     
     
     
    To reduce confusion, it'd be helpful to add a help_text=_("...") to this with:
    
    "The revision fetch from the repository to generate the side-by-side diff. This may not be the revision of the diff itself if a parent diff is provided."
  4. 
      
TI
  1. 
      
  2. reviewboard/diffviewer/diffutils.py (Diff revision 2)
     
     
    this good
    
  3. 
      
TI
  1. 
      
  2. reviewboard/diffviewer/diffutils.py (Diff revision 2)
     
     
    asdjfljasdlkfjasdl
    1. Please do not use this server for testing. This is a production server. If you would like to try out review board without impacting people's work, please use http://demo.reviewboard.org/
  3. reviewboard/diffviewer/diffutils.py (Diff revision 2)
     
     
    additional
  4. 
      
david
  1. Have you tested the evolution?
    1. To test the SQLMutation I went back to the old state, created some requests, evolved the database and checked that the revisions are correct.
      I also got pysvn installed and the tests are now good (I don't have the obscure SCMs installed):
       Ran 361 tests in 191.423s OK (SKIP=6)
      (Quoted from an e-mail to Christian Hammond.  The results refer to r2.)
      
  2. 
      
david
  1. Pushed a merge of your branch as 5d9a8d2. Thanks!
  2. 
      
BA
BA
BA
BA
BA
Review request changed
Status:
Discarded