summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-01-26 10:55:39 -0800
committerShawn O. Pearce <sop@google.com>2009-01-26 10:55:39 -0800
commit370e3fa6660fa2eb675199104cde9e9d02063cfd (patch)
tree5ff9e8399be3a6ba7db48f20c00c86989634445f /project.py
parentb54a392c9a267a06058b663377282c9dcec6878e (diff)
downloadgit-repo-370e3fa6660fa2eb675199104cde9e9d02063cfd.tar.gz
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>
Diffstat (limited to 'project.py')
-rw-r--r--project.py29
1 files changed, 1 insertions, 28 deletions
diff --git a/project.py b/project.py
index 5d036c35..eebe96d5 100644
--- a/project.py
+++ b/project.py
@@ -24,10 +24,8 @@ import urllib2
24from color import Coloring 24from color import Coloring
25from git_command import GitCommand 25from git_command import GitCommand
26from git_config import GitConfig, IsId 26from git_config import GitConfig, IsId
27from gerrit_upload import UploadBundle
28from error import GitError, ImportError, UploadError 27from error import GitError, ImportError, UploadError
29from remote import Remote 28from remote import Remote
30from codereview import proto_client
31 29
32HEAD = 'HEAD' 30HEAD = 'HEAD'
33R_HEADS = 'refs/heads/' 31R_HEADS = 'refs/heads/'
@@ -481,32 +479,7 @@ class Project(object):
481 branch.remote.projectname = self.name 479 branch.remote.projectname = self.name
482 branch.remote.Save() 480 branch.remote.Save()
483 481
484 if branch.remote.ReviewProtocol == 'http-post': 482 if branch.remote.ReviewProtocol == 'ssh':
485 base_list = []
486 for name, id in self._allrefs.iteritems():
487 if branch.remote.WritesTo(name):
488 base_list.append(not_rev(name))
489 if not base_list:
490 raise GitError('no base refs, cannot upload %s' % branch.name)
491
492 print >>sys.stderr, ''
493 _info("Uploading %s to %s:", branch.name, self.name)
494 try:
495 UploadBundle(project = self,
496 server = branch.remote.review,
497 email = self.UserEmail,
498 dest_project = branch.remote.projectname,
499 dest_branch = dest_branch,
500 src_branch = R_HEADS + branch.name,
501 bases = base_list,
502 people = people,
503 replace_changes = replace_changes)
504 except proto_client.ClientLoginError:
505 raise UploadError('Login failure')
506 except urllib2.HTTPError, e:
507 raise UploadError('HTTP error %d' % e.code)
508
509 elif branch.remote.ReviewProtocol == 'ssh':
510 if dest_branch.startswith(R_HEADS): 483 if dest_branch.startswith(R_HEADS):
511 dest_branch = dest_branch[len(R_HEADS):] 484 dest_branch = dest_branch[len(R_HEADS):]
512 485