summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/project.py b/project.py
index 6e6a605e..a3b6312e 100644
--- a/project.py
+++ b/project.py
@@ -1116,7 +1116,8 @@ class Project(object):
1116 if not re.match(r"^.+[+-][0-9]+$", label): 1116 if not re.match(r"^.+[+-][0-9]+$", label):
1117 raise UploadError( 1117 raise UploadError(
1118 f'invalid label syntax "{label}": labels use forms like ' 1118 f'invalid label syntax "{label}": labels use forms like '
1119 "CodeReview+1 or Verified-1" 1119 "CodeReview+1 or Verified-1",
1120 project=self.name,
1120 ) 1121 )
1121 1122
1122 if dest_branch is None: 1123 if dest_branch is None:
@@ -1132,7 +1133,7 @@ class Project(object):
1132 1133
1133 url = branch.remote.ReviewUrl(self.UserEmail, validate_certs) 1134 url = branch.remote.ReviewUrl(self.UserEmail, validate_certs)
1134 if url is None: 1135 if url is None:
1135 raise UploadError("review not configured") 1136 raise UploadError("review not configured", project=self.name)
1136 cmd = ["push"] 1137 cmd = ["push"]
1137 if dryrun: 1138 if dryrun:
1138 cmd.append("-n") 1139 cmd.append("-n")
@@ -1177,8 +1178,9 @@ class Project(object):
1177 ref_spec = ref_spec + "%" + ",".join(opts) 1178 ref_spec = ref_spec + "%" + ",".join(opts)
1178 cmd.append(ref_spec) 1179 cmd.append(ref_spec)
1179 1180
1180 if GitCommand(self, cmd, bare=True).Wait() != 0: 1181 GitCommand(
1181 raise UploadError("Upload failed") 1182 self, cmd, bare=True, capture_stderr=True, verify_command=True
1183 ).Wait()
1182 1184
1183 if not dryrun: 1185 if not dryrun:
1184 msg = "posted to %s for %s" % (branch.remote.review, dest_branch) 1186 msg = "posted to %s for %s" % (branch.remote.review, dest_branch)