summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--subcmds/upload.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 4fa5b432..ba532461 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -13,6 +13,7 @@
13# See the License for the specific language governing permissions and 13# See the License for the specific language governing permissions and
14# limitations under the License. 14# limitations under the License.
15 15
16import copy
16import re 17import re
17import sys 18import sys
18 19
@@ -83,6 +84,14 @@ to "true" then repo will assume you always answer "y" at the prompt,
83and will not prompt you further. If it is set to "false" then repo 84and will not prompt you further. If it is set to "false" then repo
84will assume you always answer "n", and will abort. 85will assume you always answer "n", and will abort.
85 86
87review.URL.autocopy:
88
89To automatically copy a user or mailing list to all uploaded reviews,
90you can set a per-project or global Git option to do so. Specifically,
91review.URL.autocopy can be set to a comma separated list of reviewers
92who you always want copied on all uploads with a non-empty --re
93argument.
94
86The URL must match the review URL listed in the manifest XML file, 95The URL must match the review URL listed in the manifest XML file,
87or in the .git/config within the project. For example: 96or in the .git/config within the project. For example:
88 97
@@ -92,6 +101,7 @@ or in the .git/config within the project. For example:
92 101
93 [review "http://review.example.com/"] 102 [review "http://review.example.com/"]
94 autoupload = true 103 autoupload = true
104 autocopy = johndoe@company.com,my-team-alias@company.com
95 105
96References 106References
97---------- 107----------
@@ -219,6 +229,19 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
219 229
220 self._UploadAndReport(todo, people) 230 self._UploadAndReport(todo, people)
221 231
232 def _AppendAutoCcList(self, branch, people):
233 """
234 Appends the list of users in the CC list in the git project's config if a
235 non-empty reviewer list was found.
236 """
237
238 name = branch.name
239 project = branch.project
240 key = 'review.%s.autocopy' % project.GetBranch(name).remote.review
241 raw_list = project.config.GetString(key)
242 if not raw_list is None and len(people[0]) > 0:
243 people[1].extend([entry.strip() for entry in raw_list.split(',')])
244
222 def _FindGerritChange(self, branch): 245 def _FindGerritChange(self, branch):
223 last_pub = branch.project.WasPublished(branch.name) 246 last_pub = branch.project.WasPublished(branch.name)
224 if last_pub is None: 247 if last_pub is None:
@@ -290,10 +313,13 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
290 branch.replace_changes = to_replace 313 branch.replace_changes = to_replace
291 self._UploadAndReport([branch], people) 314 self._UploadAndReport([branch], people)
292 315
293 def _UploadAndReport(self, todo, people): 316 def _UploadAndReport(self, todo, original_people):
294 have_errors = False 317 have_errors = False
295 for branch in todo: 318 for branch in todo:
296 try: 319 try:
320 people = copy.deepcopy(original_people)
321 self._AppendAutoCcList(branch, people)
322
297 branch.UploadForReview(people) 323 branch.UploadForReview(people)
298 branch.uploaded = True 324 branch.uploaded = True
299 except UploadError, e: 325 except UploadError, e: