Chromium Code Reviews| Index: gclient_scm.py |
| diff --git a/gclient_scm.py b/gclient_scm.py |
| index 3e8f59c9ba837fb02eea5a3974bb96183c11e250..cb243a96f309c67b620cd029b0b53ef5a8b317c0 100644 |
| --- a/gclient_scm.py |
| +++ b/gclient_scm.py |
| @@ -294,7 +294,7 @@ class GitWrapper(SCMWrapper): |
| verbose = ['--verbose'] |
| printed_path = True |
| - if revision.startswith('refs/heads/'): |
| + if revision.startswith('refs/'): |
| rev_type = "branch" |
| elif revision.startswith('origin/'): |
| # For compatability with old naming, translate 'origin' to 'refs/heads' |
| @@ -402,29 +402,12 @@ class GitWrapper(SCMWrapper): |
| else: |
| raise gclient_utils.Error('Invalid Upstream: %s' % upstream_branch) |
| - if (not re.match(r'^[0-9a-fA-F]{40}$', revision) or |
| - not scm.GIT.IsValidRevision(cwd=self.checkout_path, rev=revision)): |
| + if not scm.GIT.IsValidRevision(self.checkout_path, revision, sha_only=True): |
|
iannucci
2013/07/02 04:32:02
How does this work if we don't have that hash yet?
Isaac (away)
2013/07/02 04:43:50
In that case, function returns false and we fetch.
|
| # Update the remotes first so we have all the refs. |
| - backoff_time = 5 |
| - for _ in range(10): |
| - try: |
| - remote_output = scm.GIT.Capture( |
| - ['remote'] + verbose + ['update'], |
| + remote_output = scm.GIT.Capture(['remote'] + verbose + ['update'], |
| cwd=self.checkout_path) |
| - break |
| - except subprocess2.CalledProcessError, e: |
|
iannucci
2013/07/02 04:32:02
So... Why drop all the retries? What's the alterna
Isaac (away)
2013/07/02 04:43:50
Well I don't think we were retrying before. Only
|
| - # Hackish but at that point, git is known to work so just checking for |
| - # 502 in stderr should be fine. |
| - if '502' in e.stderr: |
| - print(str(e)) |
| - print('Sleeping %.1f seconds and retrying...' % backoff_time) |
| - time.sleep(backoff_time) |
| - backoff_time *= 1.3 |
| - continue |
| - raise |
| - |
| if verbose: |
| - print(remote_output.strip()) |
| + print(remote_output) |
| self._UpdateBranchHeads(options, fetch=True) |