diff options
author | Jonathan Nieder <jrn@google.com> | 2018-11-05 13:21:52 -0800 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2018-11-05 13:32:22 -0800 |
commit | 713c5872fb54c8094c0f5fa1523388efd81517cc (patch) | |
tree | 75766c7de7eb2b819e18aa7c86be9e550a6e61bb /project.py | |
parent | 36391bf5caa29cecaa1e7c4cfd3db503e34a17e6 (diff) | |
download | git-repo-713c5872fb54c8094c0f5fa1523388efd81517cc.tar.gz |
upload: Unify option passing in ssh and other transports
Pass options through the refspec for all transports, including ssh.
This means the behavior will be more consistent between the ssh and
https cases.
A downside is that this prevents passing special characters in
reviewer options. That already didn't work over https, so it seems
okay. It could be fixed by using push options instead.
Change-Id: Ia38d16e350cb8cb0de14463bfb3d9724e13bc4bf
Diffstat (limited to 'project.py')
-rwxr-xr-x | project.py | 24 |
1 files changed, 9 insertions, 15 deletions
@@ -1152,12 +1152,7 @@ class Project(object): | |||
1152 | cmd = ['push'] | 1152 | cmd = ['push'] |
1153 | 1153 | ||
1154 | if url.startswith('ssh://'): | 1154 | if url.startswith('ssh://'): |
1155 | rp = ['gerrit receive-pack'] | 1155 | cmd.append('--receive-pack=gerrit receive-pack') |
1156 | for e in people[0]: | ||
1157 | rp.append('--reviewer=%s' % sq(e)) | ||
1158 | for e in people[1]: | ||
1159 | rp.append('--cc=%s' % sq(e)) | ||
1160 | cmd.append('--receive-pack=%s' % " ".join(rp)) | ||
1161 | 1156 | ||
1162 | for push_option in (push_options or []): | 1157 | for push_option in (push_options or []): |
1163 | cmd.append('-o') | 1158 | cmd.append('-o') |
@@ -1177,15 +1172,14 @@ class Project(object): | |||
1177 | if auto_topic: | 1172 | if auto_topic: |
1178 | ref_spec = ref_spec + '/' + branch.name | 1173 | ref_spec = ref_spec + '/' + branch.name |
1179 | 1174 | ||
1180 | if not url.startswith('ssh://'): | 1175 | opts = ['r=%s' % p for p in people[0]] |
1181 | rp = ['r=%s' % p for p in people[0]] + \ | 1176 | opts += ['cc=%s' % p for p in people[1]] |
1182 | ['cc=%s' % p for p in people[1]] | 1177 | if private: |
1183 | if private: | 1178 | opts += ['private'] |
1184 | rp = rp + ['private'] | 1179 | if wip: |
1185 | if wip: | 1180 | opts += ['wip'] |
1186 | rp = rp + ['wip'] | 1181 | if opts: |
1187 | if rp: | 1182 | ref_spec = ref_spec + '%' + ','.join(opts) |
1188 | ref_spec = ref_spec + '%' + ','.join(rp) | ||
1189 | cmd.append(ref_spec) | 1183 | cmd.append(ref_spec) |
1190 | 1184 | ||
1191 | if GitCommand(self, cmd, bare=True).Wait() != 0: | 1185 | if GitCommand(self, cmd, bare=True).Wait() != 0: |