Cherrypick post upload hook changes in PRESUBMIT.py of m40 branch

CLs uploaded from this branch will now automatically contain 'NOTRY=true' and 'NOTREECHECKS=true'.

These CLs are cherrypicked:
https://codereview.chromium.org/960203002/ ('Automatically add a docs preview link and NOTRY=true when there are only docs changes')
https://codereview.chromium.org/963553002/ ('Automatically add NOTREECHECKS when uploading CLs from non master branches')

BUG=skia:
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1010603003
2 files changed