Scripts should not care about closed tree when committing.
I just got bitten by this when merging to branch. R=jkummerow@chromium.org, machenbach@chromium.org BUG= Review URL: https://codereview.chromium.org/24254005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
227bd35489
commit
b8534d6a82
18
PRESUBMIT.py
18
PRESUBMIT.py
@ -58,6 +58,17 @@ def _CommonChecks(input_api, output_api):
|
||||
return results
|
||||
|
||||
|
||||
def _SkipTreeCheck(input_api, output_api):
|
||||
"""Check the env var whether we want to skip tree check.
|
||||
Only skip if src/version.cc has been updated."""
|
||||
src_version = 'src/version.cc'
|
||||
FilterFile = lambda file: file.LocalPath() == src_version
|
||||
if not input_api.AffectedSourceFiles(
|
||||
lambda file: file.LocalPath() == src_version):
|
||||
return False
|
||||
return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip'
|
||||
|
||||
|
||||
def CheckChangeOnUpload(input_api, output_api):
|
||||
results = []
|
||||
results.extend(_CommonChecks(input_api, output_api))
|
||||
@ -69,7 +80,8 @@ def CheckChangeOnCommit(input_api, output_api):
|
||||
results.extend(_CommonChecks(input_api, output_api))
|
||||
results.extend(input_api.canned_checks.CheckChangeHasDescription(
|
||||
input_api, output_api))
|
||||
results.extend(input_api.canned_checks.CheckTreeIsOpen(
|
||||
input_api, output_api,
|
||||
json_url='http://v8-status.appspot.com/current?format=json'))
|
||||
if not _SkipTreeCheck(input_api, output_api):
|
||||
results.extend(input_api.canned_checks.CheckTreeIsOpen(
|
||||
input_api, output_api,
|
||||
json_url='http://v8-status.appspot.com/current?format=json'))
|
||||
return results
|
||||
|
@ -229,7 +229,8 @@ if [ $START_STEP -le $CURRENT_STEP ] ; then
|
||||
git checkout $BRANCHNAME \
|
||||
|| die "cannot ensure that the current branch is $BRANCHNAME"
|
||||
wait_for_lgtm
|
||||
git cl dcommit || die "failed to commit to $MERGE_TO_BRANCH"
|
||||
PRESUBMIT_TREE_CHECK="skip" git cl dcommit \
|
||||
|| die "failed to commit to $MERGE_TO_BRANCH"
|
||||
fi
|
||||
|
||||
let CURRENT_STEP+=1
|
||||
|
@ -211,7 +211,8 @@ if [ $START_STEP -le $CURRENT_STEP ] ; then
|
||||
};
|
||||
print $0;
|
||||
}' > "$CHANGELOG_ENTRY_FILE"
|
||||
git cl dcommit || die "'git cl dcommit' failed, please try again."
|
||||
PRESUBMIT_TREE_CHECK="skip" git cl dcommit \
|
||||
|| die "'git cl dcommit' failed, please try again."
|
||||
fi
|
||||
|
||||
let CURRENT_STEP+=1
|
||||
|
Loading…
Reference in New Issue
Block a user