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

Unified Diff: tools/utils.py

Issue 10834218: get svn rev num even if using git svn (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: tools/utils.py
diff --git a/tools/utils.py b/tools/utils.py
index 06fe0acf21a5b6d59b418b1d1145c018258a1d71..36ad7e1567dedaedd6121e5a88dfba68bb4623c7 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -149,6 +149,21 @@ def GetSVNRevision():
p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE,
stderr = subprocess.STDOUT, shell=IsWindows())
output, not_used = p.communicate()
+ revision = ParseSvnInfoOutput(output)
+ if revision:
+ return revision
+
+ # maybe the builder is using git-svn, try that
+ p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE,
+ stderr = subprocess.STDOUT, shell=IsWindows())
+ output, not_used = p.communicate()
+ revision = ParseSvnInfoOutput(output)
+ if revision:
+ return revision
+
+ return None
+
+def ParseSvnInfoOutput(output):
for line in output.split('\n'):
if 'Revision' in line:
return (line.strip().split())[1]
« 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