OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 """A wrapper script to manage a set of client modules in different SCM. | 6 """A wrapper script to manage a set of client modules in different SCM. |
7 | 7 |
8 This script is intended to be used to help basic management of client | 8 This script is intended to be used to help basic management of client |
9 program sources residing in one or more Subversion modules and Git | 9 program sources residing in one or more Subversion modules and Git |
10 repositories, along with other modules it depends on, also in Subversion or Git, | 10 repositories, along with other modules it depends on, also in Subversion or Git, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 import pprint | 65 import pprint |
66 import re | 66 import re |
67 import sys | 67 import sys |
68 import urlparse | 68 import urlparse |
69 import urllib | 69 import urllib |
70 | 70 |
71 import breakpad | 71 import breakpad |
72 | 72 |
73 import gclient_scm | 73 import gclient_scm |
74 import gclient_utils | 74 import gclient_utils |
| 75 from third_party.repo.progress import Progress |
75 | 76 |
76 # default help text | 77 # default help text |
77 DEFAULT_USAGE_TEXT = ( | 78 DEFAULT_USAGE_TEXT = ( |
78 """usage: %prog <subcommand> [options] [--] [SCM options/args...] | 79 """usage: %prog <subcommand> [options] [--] [SCM options/args...] |
79 a wrapper for managing a set of svn client modules and/or git repositories. | 80 a wrapper for managing a set of svn client modules and/or git repositories. |
80 Version """ + __version__ + """ | 81 Version """ + __version__ + """ |
81 | 82 |
82 subcommands: | 83 subcommands: |
83 cleanup | 84 cleanup |
84 config | 85 config |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 deps_content = "" | 678 deps_content = "" |
678 entries_deps_content[name] = deps_content | 679 entries_deps_content[name] = deps_content |
679 | 680 |
680 # Process the dependencies next (sort alphanumerically to ensure that | 681 # Process the dependencies next (sort alphanumerically to ensure that |
681 # containing directories get populated first and for readability) | 682 # containing directories get populated first and for readability) |
682 deps = self._ParseAllDeps(entries, entries_deps_content) | 683 deps = self._ParseAllDeps(entries, entries_deps_content) |
683 deps_to_process = deps.keys() | 684 deps_to_process = deps.keys() |
684 deps_to_process.sort() | 685 deps_to_process.sort() |
685 | 686 |
686 # First pass for direct dependencies. | 687 # First pass for direct dependencies. |
| 688 if command == 'update' and not self._options.verbose: |
| 689 pm = Progress('Syncing projects', len(deps_to_process)) |
687 for d in deps_to_process: | 690 for d in deps_to_process: |
| 691 if command == 'update' and not self._options.verbose: |
| 692 pm.update() |
688 if type(deps[d]) == str: | 693 if type(deps[d]) == str: |
689 url = deps[d] | 694 url = deps[d] |
690 entries[d] = url | 695 entries[d] = url |
691 if run_scm: | 696 if run_scm: |
692 self._options.revision = revision_overrides.get(d) | 697 self._options.revision = revision_overrides.get(d) |
693 scm = gclient_scm.CreateSCM(url, self._root_dir, d) | 698 scm = gclient_scm.CreateSCM(url, self._root_dir, d) |
694 scm.RunCommand(command, self._options, args, file_list) | 699 scm.RunCommand(command, self._options, args, file_list) |
695 self._options.revision = None | 700 self._options.revision = None |
| 701 if command == 'update' and not self._options.verbose: |
| 702 pm.end() |
696 | 703 |
697 # Second pass for inherited deps (via the From keyword) | 704 # Second pass for inherited deps (via the From keyword) |
698 for d in deps_to_process: | 705 for d in deps_to_process: |
699 if type(deps[d]) != str: | 706 if type(deps[d]) != str: |
700 filename = os.path.join(self._root_dir, | 707 filename = os.path.join(self._root_dir, |
701 deps[d].module_name, | 708 deps[d].module_name, |
702 self._options.deps_file) | 709 self._options.deps_file) |
703 content = gclient_utils.FileRead(filename) | 710 content = gclient_utils.FileRead(filename) |
704 sub_deps = self._ParseSolutionDeps(deps[d].module_name, content, {}) | 711 sub_deps = self._ParseSolutionDeps(deps[d].module_name, content, {}) |
705 url = sub_deps[d] | 712 url = sub_deps[d] |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 | 1180 |
1174 if "__main__" == __name__: | 1181 if "__main__" == __name__: |
1175 try: | 1182 try: |
1176 result = Main(sys.argv) | 1183 result = Main(sys.argv) |
1177 except gclient_utils.Error, e: | 1184 except gclient_utils.Error, e: |
1178 print >> sys.stderr, "Error: %s" % str(e) | 1185 print >> sys.stderr, "Error: %s" % str(e) |
1179 result = 1 | 1186 result = 1 |
1180 sys.exit(result) | 1187 sys.exit(result) |
1181 | 1188 |
1182 # vim: ts=2:sw=2:tw=80:et: | 1189 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |