Commit 7036c4f0 authored by smut's avatar smut Committed by Commit bot

Use different exit code when desired dep roll is a no-op

BUG=609899

Review-Url: https://codereview.chromium.org/2047013005
parent dcd84048
......@@ -22,6 +22,10 @@ class Error(Exception):
pass
class AlreadyRolledError(Error):
pass
def check_output(*args, **kwargs):
"""subprocess.check_output() passing shell=True on Windows for git."""
kwargs.setdefault('shell', NEED_SHELL)
......@@ -109,7 +113,7 @@ def roll(root, deps_dir, roll_to, key, reviewers, bug, no_log, log_limit,
print('Found new revision %s' % roll_to)
if roll_to == head:
raise Error('No revision to roll!')
raise AlreadyRolledError('No revision to roll!')
commit_range = '%s..%s' % (head[:9], roll_to[:9])
......@@ -213,7 +217,7 @@ def main():
except Error as e:
sys.stderr.write('error: %s\n' % e)
return 1
return 2 if isinstance(e, AlreadyRolledError) else 1
return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment