OLD | NEW |
1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | 4 |
5 from __future__ import print_function | 5 from __future__ import print_function |
6 | 6 |
7 import os | 7 import os |
8 import re | 8 import re |
9 import codecs | 9 import codecs |
10 import subprocess | 10 import subprocess |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 | 104 |
105 def can_safely_release(*repo_paths): | 105 def can_safely_release(*repo_paths): |
106 """Run repository-checks in order to bail out early if necessary""" | 106 """Run repository-checks in order to bail out early if necessary""" |
107 if repo_has_uncommitted(): | 107 if repo_has_uncommitted(): |
108 return False | 108 return False |
109 if repo_has_incoming(*repo_paths): | 109 if repo_has_incoming(*repo_paths): |
110 return False | 110 return False |
111 if repo_has_outgoing(): | 111 if repo_has_outgoing(): |
112 return continue_with_outgoing() | 112 return continue_with_outgoing() |
| 113 return True |
113 | 114 |
114 | 115 |
115 def run(baseDir, type, version, keyFile, downloadsRepo): | 116 def run(baseDir, type, version, keyFile, downloadsRepo): |
116 if not can_safely_release(baseDir, downloadsRepo): | 117 if not can_safely_release(baseDir, downloadsRepo): |
117 print('Aborting release.') | 118 print('Aborting release.') |
118 return 1 | 119 return 1 |
119 | 120 |
120 if type == 'gecko': | 121 if type == 'gecko': |
121 import buildtools.packagerGecko as packager | 122 import buildtools.packagerGecko as packager |
122 elif type == 'safari': | 123 elif type == 'safari': |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 create_sourcearchive(baseDir, archivePath) | 188 create_sourcearchive(baseDir, archivePath) |
188 downloads.append(archivePath) | 189 downloads.append(archivePath) |
189 | 190 |
190 # Now add the downloads and commit | 191 # Now add the downloads and commit |
191 subprocess.check_call(['hg', 'add', '-R', downloadsRepo] + downloads) | 192 subprocess.check_call(['hg', 'add', '-R', downloadsRepo] + downloads) |
192 subprocess.check_call(['hg', 'commit', '-R', downloadsRepo, '-m', 'Releasing
%s %s' % (extensionName, version)]) | 193 subprocess.check_call(['hg', 'commit', '-R', downloadsRepo, '-m', 'Releasing
%s %s' % (extensionName, version)]) |
193 | 194 |
194 # Push all changes | 195 # Push all changes |
195 subprocess.check_call(['hg', 'push', '-R', baseDir]) | 196 subprocess.check_call(['hg', 'push', '-R', baseDir]) |
196 subprocess.check_call(['hg', 'push', '-R', downloadsRepo]) | 197 subprocess.check_call(['hg', 'push', '-R', downloadsRepo]) |
OLD | NEW |