Create a draft when uploading a new diff

Review Request #54 — Created June 12, 2007 and submitted

Information

Review Board SVN (deprecated)
trunk
73

Reviewers

This changes the two diff upload paths (JSON and view) to
create a new draft and attach the diff to that instead of
writing it to the DiffSetHistory and sending an e-mail
immediately.  This has been requested by a few folks since
they like to look over the diff to make sure it's correct
(viz. changes, trailing whitespace, etc.) before actually
making it public.

As part of this, I'm introducing some more fine-grained
change tracking when we save a draft.
Uploaded diffs, checked that various objects I expected were
in the database.  Added print statements to see whether email
code paths were correct.

This probably needs a lot more; I'll do some on reviewboard-test
to make sure post-review and actual e-mails work.
chipx86
  1. Looks good in general, but how will this work with post-review? Will we end up with a draft that would have to be saved?
    1. Correct.  I think this is actually what we want (maybe add
      a --publish option for people who don't?).  I know I've
      post-reviewed to update the diff and ended up sending 4 or
      5 emails because I missed something in the diff and had to
      do it again.
      
      Post-reviewing to a draft allows people to look it over,
      then hit publish when they want to actually send the e-mail.
      
      Speaking of e-mail, the main review request template needs
      to be updated to indicate when the draft changed.  Any
      ideas?
  2. trunk/reviewboard/reviews/views.py (Diff revision 2)
     
     
    We can move this down further in the function.
  3. trunk/reviewboard/reviews/views.py (Diff revision 2)
     
     
     
    The "or not query" is always going to be true, so there's no point in us having the if statement anymore. We should initialize query here.
  4. trunk/reviewboard/reviews/models.py (Diff revision 2)
     
     
     
    You don't want to take credit for the laziness, leaving it anonymous? ;)
  5. 
      
chipx86
  1. Cool, looks good.
  2. /trunk/reviewboard/reviews/models.py (Diff revision 4)
     
     
     
     
     
     
     
    Could shorten this to:
    
    changes[name] = bool(aset.symmetric_difference(bset))
  3.