Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3194)

Unified Diff: roll_dep.py

Issue 2047013005: Use different exit code when desired dep roll is a no-op (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: roll_dep.py
diff --git a/roll_dep.py b/roll_dep.py
index f6db7971d2688a284fe91372907d5bb6ff55f8bd..10c58295659a33c75b1d48fe7b39f45a0aeed7d4 100755
--- a/roll_dep.py
+++ b/roll_dep.py
@@ -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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698