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

Unified Diff: roll_dep.py

Issue 604463002: Fix roll_dep.py to print the right latest SVN revision number on error. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: address comment Created 6 years, 3 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 f071fcc01c8b82bc17097ed68e69a268e2cb8647..953b0e106d3bb207079116ef9064ce7a2c16a816 100755
--- a/roll_dep.py
+++ b/roll_dep.py
@@ -107,6 +107,7 @@ def convert_svn_revision(dep_path, revision):
"""Find the git revision corresponding to an svn revision."""
err_msg = 'Unknown error'
revision = int(revision)
+ latest_svn_rev = None
with open(os.devnull, 'w') as devnull:
for ref in ('HEAD', 'origin/master'):
try:
@@ -126,6 +127,8 @@ def convert_svn_revision(dep_path, revision):
print >> sys.stderr, (
'WARNING: Could not parse svn revision out of "%s"' % line)
continue
+ if not latest_svn_rev or int(svn_rev) > int(latest_svn_rev):
+ latest_svn_rev = svn_rev
if svn_rev == revision:
return git_rev
if svn_rev > revision:
@@ -137,7 +140,8 @@ def convert_svn_revision(dep_path, revision):
else:
err_msg = (
'latest available revision is %d; you may need to '
- '"git fetch origin" to get the latest commits.' % svn_rev)
+ '"git fetch origin" to get the latest commits.' %
+ latest_svn_rev)
finally:
log_p.terminate()
grep_p.terminate()
« 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