From 45d21685b93f80b67239849b2d2cfe6b217e335a Mon Sep 17 00:00:00 2001 From: Shawn Pearce Date: Thu, 28 Feb 2013 00:35:51 -0800 Subject: [PATCH] upload: support --re and --cc options over HTTP 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 --- project.py | 5 +++++ 1 file changed, 5 insertions(+) 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): dest_branch) if auto_topic: ref_spec = ref_spec + '/' + branch.name + if not url.startswith('ssh://'): + rp = ['r=%s' % p for p in people[0]] + \ + ['cc=%s' % p for p in people[1]] + if rp: + ref_spec = ref_spec + '%' + ','.join(rp) cmd.append(ref_spec) if GitCommand(self, cmd, bare = True).Wait() != 0: