Commit 792ea881 authored by joi@chromium.org's avatar joi@chromium.org

Do not check the safesync_url at all if one or more --revision flags are

specified.

BUG=49625
TEST=tests\gclient_smoketest.py runs successfully


Review URL: http://codereview.chromium.org/4698006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@65620 0039d316-1c4b-4281-b951-d872f2087c98
parent 0661727b
...@@ -677,17 +677,18 @@ solutions = [ ...@@ -677,17 +677,18 @@ solutions = [
revision_overrides = {} revision_overrides = {}
if self._options.head: if self._options.head:
return revision_overrides return revision_overrides
for s in self.dependencies: # Do not check safesync_url if one or more --revision flag is specified.
if not s.safesync_url: if not self._options.revisions:
continue for s in self.dependencies:
handle = urllib.urlopen(s.safesync_url) if not s.safesync_url:
rev = handle.read().strip() continue
handle.close() handle = urllib.urlopen(s.safesync_url)
if len(rev): rev = handle.read().strip()
self._options.revisions.append('%s@%s' % (s.name, rev)) handle.close()
if len(rev):
self._options.revisions.append('%s@%s' % (s.name, rev))
if not self._options.revisions: if not self._options.revisions:
return revision_overrides return revision_overrides
# --revision will take over safesync_url.
solutions_names = [s.name for s in self.dependencies] solutions_names = [s.name for s in self.dependencies]
index = 0 index = 0
for revision in self._options.revisions: for revision in self._options.revisions:
...@@ -1037,7 +1038,8 @@ def CMDsync(parser, args): ...@@ -1037,7 +1038,8 @@ def CMDsync(parser, args):
'format src@rev. The src@ part is optional and can be ' 'format src@rev. The src@ part is optional and can be '
'skipped. -r can be used multiple times when .gclient ' 'skipped. -r can be used multiple times when .gclient '
'has multiple solutions configured and will work even ' 'has multiple solutions configured and will work even '
'if the src@ part is skipped.') 'if the src@ part is skipped. Note that specifying '
'--revision means your safesync_url gets ignored.')
parser.add_option('-H', '--head', action='store_true', parser.add_option('-H', '--head', action='store_true',
help='skips any safesync_urls specified in ' help='skips any safesync_urls specified in '
'configured solutions and sync to head instead') 'configured solutions and sync to head instead')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment