Fix double messages about pending changes when posting or stamping.

Review Request #6771 — Created Jan. 14, 2015 and submitted

Information

RBTools
master
7c3d585...

Reviewers

Posting and stamping made use of some of the new utility functions that
were pulled out of rbt post. Each of these utility functions ended up
calling get_revisions(), which, in the case of Git, could cause the same
warning about pending changes in the working directory to be displayed.

There was really one major utility function that needed to be called,
and it was calling other utility functions that each called
get_revisions(). Now the main utility function, used for guessing review
requests, takes the revisions as an argument, ensuring we only ever
perform that logic once.

Along with fixing the warning, this should also speed things up a little
bit by reducing the number of calls that need to be made to other
command line apps, such as git.

Posted this change, along with some modified files not staged for commit.
Only saw one message.

Then I posted again with rbt post -u. Only saw the message once, not twice.

Ran rbt stamp against this review request. Worked fine.

In debug mode, I didn't see extra invocations of git.

Unit tests pass.

Pyflakes had nothing to complain about.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/utils/review_request.py
        rbtools/commands/post.py
        rbtools/commands/stamp.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/utils/review_request.py
        rbtools/commands/post.py
        rbtools/commands/stamp.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (d5afed2)