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

Unified Diff: gclient.py

Issue 8382030: depot_tools: Add git svn find-rev for safesync_url parsing (commonly LKGR link). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: changing more occurrences of SVN to Svn Created 9 years 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 | gclient_scm.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index e29eaa80c0fa51bddd3792ba7f141e0382bd61fe..c804186e858dc56b9d018008ceb742a5a93eb9c0 100644
--- a/gclient.py
+++ b/gclient.py
@@ -923,8 +923,15 @@ solutions = [
handle = urllib.urlopen(s.safesync_url)
rev = handle.read().strip()
handle.close()
- if len(rev):
- self._options.revisions.append('%s@%s' % (s.name, rev))
+ scm = gclient_scm.CreateSCM(s.url, s.root.root_dir, s.name)
+ safe_rev = scm.GetUsableRev(rev=rev, options=self._options)
+ if not safe_rev:
+ raise gclient_utils.Error(
+ 'Despite our best attempts, we couldn\'t find a useful\n'
+ 'safesync_url revision for you.')
+ if self._options.verbose:
+ print('Using safesync_url revision: %s.\n' % safe_rev)
+ self._options.revisions.append('%s@%s' % (s.name, safe_rev))
if not self._options.revisions:
return revision_overrides
solutions_names = [s.name for s in self.dependencies]
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698