OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # ***** BEGIN LICENSE BLOCK ***** | 2 # ***** BEGIN LICENSE BLOCK ***** |
3 # This Source Code Form is subject to the terms of the Mozilla Public | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
4 # License, v. 2.0. If a copy of the MPL was not distributed with this file, | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this file, |
5 # You can obtain one at http://mozilla.org/MPL/2.0/. | 5 # You can obtain one at http://mozilla.org/MPL/2.0/. |
6 # ***** END LICENSE BLOCK ***** | 6 # ***** END LICENSE BLOCK ***** |
7 """Generic VCS support. | 7 """Generic VCS support. |
8 """ | 8 """ |
9 | 9 |
10 from copy import deepcopy | 10 from copy import deepcopy |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 pass | 67 pass |
68 vcs_class = VCS_DICT.get(vcs) | 68 vcs_class = VCS_DICT.get(vcs) |
69 if not vcs_class: | 69 if not vcs_class: |
70 self.error("Running vcs_checkout with kwargs %s" % str(kwargs)) | 70 self.error("Running vcs_checkout with kwargs %s" % str(kwargs)) |
71 raise VCSException("No VCS set!") | 71 raise VCSException("No VCS set!") |
72 # need a better way to do this. | 72 # need a better way to do this. |
73 if 'dest' not in kwargs: | 73 if 'dest' not in kwargs: |
74 kwargs['dest'] = self.query_dest(kwargs) | 74 kwargs['dest'] = self.query_dest(kwargs) |
75 if 'vcs_share_base' not in kwargs: | 75 if 'vcs_share_base' not in kwargs: |
76 kwargs['vcs_share_base'] = c.get('%s_share_base' % vcs, c.get('vcs_s
hare_base')) | 76 kwargs['vcs_share_base'] = c.get('%s_share_base' % vcs, c.get('vcs_s
hare_base')) |
| 77 # Tries to checkout 'tag' if 'revision' is not defined |
| 78 if 'revision' not in kwargs: |
| 79 kwargs['revision'] = kwargs.get('tag') |
77 vcs_obj = vcs_class( | 80 vcs_obj = vcs_class( |
78 log_obj=self.log_obj, | 81 log_obj=self.log_obj, |
79 config=self.config, | 82 config=self.config, |
80 vcs_config=kwargs, | 83 vcs_config=kwargs, |
81 script_obj=self, | 84 script_obj=self, |
82 ) | 85 ) |
83 return self.retry( | 86 return self.retry( |
84 self._get_revision, | 87 self._get_revision, |
85 error_level=error_level, | 88 error_level=error_level, |
86 error_message="Automation Error: Can't checkout %s!" % kwargs['repo'
], | 89 error_message="Automation Error: Can't checkout %s!" % kwargs['repo'
], |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 # This is here instead of mercurial.py because importing MercurialVCS into | 134 # This is here instead of mercurial.py because importing MercurialVCS into |
132 # vcsbase from mercurial, and importing VCSScript into mercurial from | 135 # vcsbase from mercurial, and importing VCSScript into mercurial from |
133 # vcsbase, was giving me issues. | 136 # vcsbase, was giving me issues. |
134 class MercurialScript(VCSScript): | 137 class MercurialScript(VCSScript): |
135 default_vcs = 'hg' | 138 default_vcs = 'hg' |
136 | 139 |
137 | 140 |
138 # __main__ {{{1 | 141 # __main__ {{{1 |
139 if __name__ == '__main__': | 142 if __name__ == '__main__': |
140 pass | 143 pass |
OLD | NEW |