mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
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
This commit is contained in:
parent
36391bf5ca
commit
713c5872fb
24
project.py
24
project.py
@ -1152,12 +1152,7 @@ class Project(object):
|
|||||||
cmd = ['push']
|
cmd = ['push']
|
||||||
|
|
||||||
if url.startswith('ssh://'):
|
if url.startswith('ssh://'):
|
||||||
rp = ['gerrit receive-pack']
|
cmd.append('--receive-pack=gerrit receive-pack')
|
||||||
for e in people[0]:
|
|
||||||
rp.append('--reviewer=%s' % sq(e))
|
|
||||||
for e in people[1]:
|
|
||||||
rp.append('--cc=%s' % sq(e))
|
|
||||||
cmd.append('--receive-pack=%s' % " ".join(rp))
|
|
||||||
|
|
||||||
for push_option in (push_options or []):
|
for push_option in (push_options or []):
|
||||||
cmd.append('-o')
|
cmd.append('-o')
|
||||||
@ -1177,15 +1172,14 @@ class Project(object):
|
|||||||
if auto_topic:
|
if auto_topic:
|
||||||
ref_spec = ref_spec + '/' + branch.name
|
ref_spec = ref_spec + '/' + branch.name
|
||||||
|
|
||||||
if not url.startswith('ssh://'):
|
opts = ['r=%s' % p for p in people[0]]
|
||||||
rp = ['r=%s' % p for p in people[0]] + \
|
opts += ['cc=%s' % p for p in people[1]]
|
||||||
['cc=%s' % p for p in people[1]]
|
if private:
|
||||||
if private:
|
opts += ['private']
|
||||||
rp = rp + ['private']
|
if wip:
|
||||||
if wip:
|
opts += ['wip']
|
||||||
rp = rp + ['wip']
|
if opts:
|
||||||
if rp:
|
ref_spec = ref_spec + '%' + ','.join(opts)
|
||||||
ref_spec = ref_spec + '%' + ','.join(rp)
|
|
||||||
cmd.append(ref_spec)
|
cmd.append(ref_spec)
|
||||||
|
|
||||||
if GitCommand(self, cmd, bare=True).Wait() != 0:
|
if GitCommand(self, cmd, bare=True).Wait() != 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user