Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 77 # Tries to checkout 'tag' if 'revision' is not defined |
78 # See https://issues.adblockplus.org/ticket/3768 | |
78 if 'revision' not in kwargs: | 79 if 'revision' not in kwargs: |
79 kwargs['revision'] = kwargs.get('tag') | 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
| |
80 vcs_obj = vcs_class( | 81 vcs_obj = vcs_class( |
81 log_obj=self.log_obj, | 82 log_obj=self.log_obj, |
82 config=self.config, | 83 config=self.config, |
83 vcs_config=kwargs, | 84 vcs_config=kwargs, |
84 script_obj=self, | 85 script_obj=self, |
85 ) | 86 ) |
86 return self.retry( | 87 return self.retry( |
87 self._get_revision, | 88 self._get_revision, |
88 error_level=error_level, | 89 error_level=error_level, |
89 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... | |
134 # This is here instead of mercurial.py because importing MercurialVCS into | 135 # This is here instead of mercurial.py because importing MercurialVCS into |
135 # vcsbase from mercurial, and importing VCSScript into mercurial from | 136 # vcsbase from mercurial, and importing VCSScript into mercurial from |
136 # vcsbase, was giving me issues. | 137 # vcsbase, was giving me issues. |
137 class MercurialScript(VCSScript): | 138 class MercurialScript(VCSScript): |
138 default_vcs = 'hg' | 139 default_vcs = 'hg' |
139 | 140 |
140 | 141 |
141 # __main__ {{{1 | 142 # __main__ {{{1 |
142 if __name__ == '__main__': | 143 if __name__ == '__main__': |
143 pass | 144 pass |
LEFT | RIGHT |