Left: | ||
Right: |
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 # See https://issues.adblockplus.org/ticket/3768 | |
79 if 'revision' not in kwargs: | |
80 kwargs['revision'] = kwargs.get('tag') | |
anton
2017/02/15 11:00:05
BTW can it be written as 'kwargs['tag']'?
diegocarloslima
2017/02/24 19:54:08
The difference between using kwargs.get('tag') and
| |
77 vcs_obj = vcs_class( | 81 vcs_obj = vcs_class( |
78 log_obj=self.log_obj, | 82 log_obj=self.log_obj, |
79 config=self.config, | 83 config=self.config, |
80 vcs_config=kwargs, | 84 vcs_config=kwargs, |
81 script_obj=self, | 85 script_obj=self, |
82 ) | 86 ) |
83 return self.retry( | 87 return self.retry( |
84 self._get_revision, | 88 self._get_revision, |
85 error_level=error_level, | 89 error_level=error_level, |
86 error_message="Automation Error: Can't checkout %s!" % kwargs['repo' ], | 90 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 | 135 # This is here instead of mercurial.py because importing MercurialVCS into |
132 # vcsbase from mercurial, and importing VCSScript into mercurial from | 136 # vcsbase from mercurial, and importing VCSScript into mercurial from |
133 # vcsbase, was giving me issues. | 137 # vcsbase, was giving me issues. |
134 class MercurialScript(VCSScript): | 138 class MercurialScript(VCSScript): |
135 default_vcs = 'hg' | 139 default_vcs = 'hg' |
136 | 140 |
137 | 141 |
138 # __main__ {{{1 | 142 # __main__ {{{1 |
139 if __name__ == '__main__': | 143 if __name__ == '__main__': |
140 pass | 144 pass |
OLD | NEW |