Chromium Code Reviews| Index: gclient.py |
| =================================================================== |
| --- gclient.py (revision 109214) |
| +++ gclient.py (working copy) |
| @@ -923,8 +923,17 @@ |
| 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( |
| + cwd=scm.checkout_path, url=scm.url, rev=rev, |
|
M-A Ruel
2011/11/09 19:25:51
Why pass scm.checkout_path and scm.url when you ar
Dan Beam
2011/11/09 19:36:52
I think you told me to make them @staticmethods, r
M-A Ruel
2011/11/09 19:38:50
Yes, but I told you that because you were precisel
Dan Beam
2011/11/10 10:29:15
Done.
|
| + options=self._options) |
| + if not safe_rev: |
| + raise gclient_utils.Error( |
| + 'Despite our best attempts, we couldn\'t find a useful ' |
| + '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] |