OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Meta checkout manager supporting both Subversion and GIT. | 6 """Meta checkout manager supporting both Subversion and GIT. |
7 | 7 |
8 Files | 8 Files |
9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 self._ApplySafeSyncRev(dep=s) | 923 self._ApplySafeSyncRev(dep=s) |
924 if not self._options.revisions: | 924 if not self._options.revisions: |
925 return revision_overrides | 925 return revision_overrides |
926 solutions_names = [s.name for s in self.dependencies] | 926 solutions_names = [s.name for s in self.dependencies] |
927 index = 0 | 927 index = 0 |
928 for revision in self._options.revisions: | 928 for revision in self._options.revisions: |
929 if not '@' in revision: | 929 if not '@' in revision: |
930 # Support for --revision 123 | 930 # Support for --revision 123 |
931 revision = '%s@%s' % (solutions_names[index], revision) | 931 revision = '%s@%s' % (solutions_names[index], revision) |
932 sol, rev = revision.split('@', 1) | 932 sol, rev = revision.split('@', 1) |
933 | |
934 if not sol in solutions_names and sol == 'trunk': | |
935 print >> sys.stderr, 'Rewriting "trunk" to "src" in --revision' | |
936 # Fix attempt for http://crbug.com/108515 | |
937 sol = 'src' | |
938 | |
939 if not sol in solutions_names: | 933 if not sol in solutions_names: |
940 #raise gclient_utils.Error('%s is not a valid solution.' % sol) | 934 #raise gclient_utils.Error('%s is not a valid solution.' % sol) |
941 print >> sys.stderr, ('Please fix your script, having invalid ' | 935 print >> sys.stderr, ('Please fix your script, having invalid ' |
942 '--revision flags will soon considered an error.') | 936 '--revision flags will soon considered an error.') |
943 else: | 937 else: |
944 revision_overrides[sol] = rev | 938 revision_overrides[sol] = rev |
945 index += 1 | 939 index += 1 |
946 return revision_overrides | 940 return revision_overrides |
947 | 941 |
948 def _ApplySafeSyncRev(self, dep): | 942 def _ApplySafeSyncRev(self, dep): |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1532 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1539 print >> sys.stderr, 'Error: %s' % str(e) | 1533 print >> sys.stderr, 'Error: %s' % str(e) |
1540 return 1 | 1534 return 1 |
1541 | 1535 |
1542 | 1536 |
1543 if '__main__' == __name__: | 1537 if '__main__' == __name__: |
1544 fix_encoding.fix_encoding() | 1538 fix_encoding.fix_encoding() |
1545 sys.exit(Main(sys.argv[1:])) | 1539 sys.exit(Main(sys.argv[1:])) |
1546 | 1540 |
1547 # vim: ts=2:sw=2:tw=80:et: | 1541 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |