summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2013-02-28 00:35:51 -0800
committerShawn Pearce <sop@google.com>2013-02-28 12:10:31 -0800
commit45d21685b93f80b67239849b2d2cfe6b217e335a (patch)
tree18e5f686341976ba5252c40839ec1de400ba647c
parent597868b4c45bba380249b739c0cf49b868cc8741 (diff)
downloadgit-repo-45d21685b93f80b67239849b2d2cfe6b217e335a.tar.gz
upload: support --re and --cc options over HTTPv1.12.2
HTTP can't use the older style of passing options as part of the git receive-pack command line. Use the new style as defined by https://gerrit-review.googlesource.com/42652 when connecting over HTTP. If the Gerrit server is too old to understand the % option syntax used here one of two outcomes is possible: - If no topic name was sent the server will fail with an error message. This happens because the user tried to do an upload to "refs/for/master%r=alice", and the branch does not exist. The user can delete the options and retry the upload. - If a topic was set the options will be read as part of the topic string and shown on the change page in the topic field. Either outcome is slightly better than the current behavior of just dropping the data on the floor and forgetting whatever the user tried to supply. Change-Id: Ib2df62679e5bf3ee93d6b18c12ab6474f96d9106
-rw-r--r--project.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/project.py b/project.py
index 295fb10f..22e4a5d6 100644
--- a/project.py
+++ b/project.py
@@ -946,6 +946,11 @@ class Project(object):
946 dest_branch) 946 dest_branch)
947 if auto_topic: 947 if auto_topic:
948 ref_spec = ref_spec + '/' + branch.name 948 ref_spec = ref_spec + '/' + branch.name
949 if not url.startswith('ssh://'):
950 rp = ['r=%s' % p for p in people[0]] + \
951 ['cc=%s' % p for p in people[1]]
952 if rp:
953 ref_spec = ref_spec + '%' + ','.join(rp)
949 cmd.append(ref_spec) 954 cmd.append(ref_spec)
950 955
951 if GitCommand(self, cmd, bare = True).Wait() != 0: 956 if GitCommand(self, cmd, bare = True).Wait() != 0: