Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # TODO(hinoka): Use logging. | 6 # TODO(hinoka): Use logging. |
| 7 | 7 |
| 8 import cStringIO | 8 import cStringIO |
| 9 import codecs | 9 import codecs |
| 10 import copy | 10 import copy |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 511 | 511 |
| 512 if not path.isdir(sln_dir): | 512 if not path.isdir(sln_dir): |
| 513 git(*clone_cmd) | 513 git(*clone_cmd) |
| 514 else: | 514 else: |
| 515 git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir) | 515 git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir) |
| 516 git('fetch', 'origin', cwd=sln_dir) | 516 git('fetch', 'origin', cwd=sln_dir) |
| 517 for ref in refs: | 517 for ref in refs: |
| 518 refspec = '%s:%s' % (ref, ref.lstrip('+')) | 518 refspec = '%s:%s' % (ref, ref.lstrip('+')) |
| 519 git('fetch', 'origin', refspec, cwd=sln_dir) | 519 git('fetch', 'origin', refspec, cwd=sln_dir) |
| 520 | 520 |
| 521 # Windows sometimes has trouble deleting files. | |
| 522 # This can make git commands that rely on locks fail. | |
| 523 if sys.platform.startswith('win'): | |
| 524 call('gclient.bat', 'cleanup', '--break_repo_locks') | |
|
ddoman1
2016/10/25 21:55:23
I am afraid that it may be a better choice to copy
agable
2016/10/28 16:55:34
I'm the one deprecating cleanup (which has always
katthomas
2016/10/28 23:40:29
Done.
| |
| 525 | |
| 521 revision = get_target_revision(name, url, revisions) or 'HEAD' | 526 revision = get_target_revision(name, url, revisions) or 'HEAD' |
| 522 force_revision(sln_dir, revision) | 527 force_revision(sln_dir, revision) |
| 523 done = True | 528 done = True |
| 524 except SubprocessFailed as e: | 529 except SubprocessFailed as e: |
| 525 # Exited abnormally, theres probably something wrong. | 530 # Exited abnormally, theres probably something wrong. |
| 526 print 'Something failed: %s.' % str(e) | 531 print 'Something failed: %s.' % str(e) |
| 527 | 532 |
| 528 if time.time() > deadline: | 533 if time.time() > deadline: |
| 529 overrun = time.time() - deadline | 534 overrun = time.time() - deadline |
| 530 print 'Ran %s seconds past deadline. Aborting.' % overrun | 535 print 'Ran %s seconds past deadline. Aborting.' % overrun |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1096 # download patch failure is still an infra problem. | 1101 # download patch failure is still an infra problem. |
| 1097 if e.code == 3: | 1102 if e.code == 3: |
| 1098 # Patch download problem. | 1103 # Patch download problem. |
| 1099 return 87 | 1104 return 87 |
| 1100 # Genuine patch problem. | 1105 # Genuine patch problem. |
| 1101 return 88 | 1106 return 88 |
| 1102 | 1107 |
| 1103 | 1108 |
| 1104 if __name__ == '__main__': | 1109 if __name__ == '__main__': |
| 1105 sys.exit(main()) | 1110 sys.exit(main()) |
| OLD | NEW |