HomePhabricator

phabstatus: clean up showsyncstatus()

Authored by simpkins.

Description

phabstatus: clean up showsyncstatus()

Summary:
Refactor the showsyncstatus function to clean up the code a little bit.

  • Don't bother to call populateresponseforphab() if the current commit does not contain a differential revision ID.
  • Only call getdiffstatus() once instead of 4 times. getdiffstatus() does cache the result instead of hitting phabricator each time, but it is still better to just re-use the return value ourselves instead of hitting the memoization code.
  • Refactor the error handling to avoid having deeply nested conditional blocks.

Test Plan: Confirmed existing tests still pass, and manually tested using the template.

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D79

Details

Committed
simpkinsJul 19 2017, 3:34 PM
Reviewer
Restricted Project
Differential Revision
D79: phabstatus: clean up showsyncstatus()
Parents
rFBHGX00215cac4956: smartlog: only count visible successors
Branches
Unknown
Tags
Unknown