Fix double messages about pending changes when posting or stamping.
Review Request #6771 — Created Jan. 14, 2015 and submitted
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
callingget_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.