Remove the protobuf based HTTP upload code path

Now that Gerrit2 has been released and the only supported upload
protocol is direct git push over SSH we no longer need the large
and complex protobuf client library, or the upload chunking logic
in gerrit_upload.py.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-01-26 10:55:39 -08:00
parent b54a392c9a
commit 370e3fa666
25 changed files with 1 additions and 6287 deletions

View File

@ -24,10 +24,8 @@ import urllib2
from color import Coloring
from git_command import GitCommand
from git_config import GitConfig, IsId
from gerrit_upload import UploadBundle
from error import GitError, ImportError, UploadError
from remote import Remote
from codereview import proto_client
HEAD = 'HEAD'
R_HEADS = 'refs/heads/'
@ -481,32 +479,7 @@ class Project(object):
branch.remote.projectname = self.name
branch.remote.Save()
if branch.remote.ReviewProtocol == 'http-post':
base_list = []
for name, id in self._allrefs.iteritems():
if branch.remote.WritesTo(name):
base_list.append(not_rev(name))
if not base_list:
raise GitError('no base refs, cannot upload %s' % branch.name)
print >>sys.stderr, ''
_info("Uploading %s to %s:", branch.name, self.name)
try:
UploadBundle(project = self,
server = branch.remote.review,
email = self.UserEmail,
dest_project = branch.remote.projectname,
dest_branch = dest_branch,
src_branch = R_HEADS + branch.name,
bases = base_list,
people = people,
replace_changes = replace_changes)
except proto_client.ClientLoginError:
raise UploadError('Login failure')
except urllib2.HTTPError, e:
raise UploadError('HTTP error %d' % e.code)
elif branch.remote.ReviewProtocol == 'ssh':
if branch.remote.ReviewProtocol == 'ssh':
if dest_branch.startswith(R_HEADS):
dest_branch = dest_branch[len(R_HEADS):]